O'Reilly logo

Distributed Computing with Go by V.N. Nikhil Anurag

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Aggregated search results

The next step would be to aggregate results of the search terms from the multiple instances of Librarian and return them as a payload to the query request. This would require us to do the following:

  • Get a list of the URLs for all of the Librarians available
  • Request search results from all the Librarians¬†when a query is received
  • Aggregate search results based on DocID
  • Sort the results in descending order of relevance score
  • Form and return the JSON payload as per the Swagger API definition

Now that we understand the rationale behind having multiple instances of Librarian, and how we are going to handle queries based on this new configuration, we can apply these changes to concierge/api/query.go.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required