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

Search – "cake"

Let us search for "cake" alone using the cURL command:

$ curl -LX POST -d '["cake"]' localhost:9090/api/query | jq       
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current       
                                     Dload  Upload   Total   Spent    Left  Speed         
100   123  100   115  100     8    115      8  0:00:01 --:--:--  0:00:01 61500        
[                                          
  {                                        
    "title": "Book 3",                     
    "url": "http://file_server:9876/book3" 
  },                                       
  {                                        
    "title": "Book 2",                     
    "url": "http://file_server:9876/book2" 
  }                                        
]  

The following are the docker-compose logs when we search for "cake":

concierge_1 | 2018/01/21 20:30:13 http://a_m_librarian:6060/api -> api.queryResult{Count:2, Data:[]api.docs{api.docs{DocID:"3c9c56d31ccd51bc7ac0011020819ef38ccd74a4", Score:2}, api.docs{DocID:"28582e23c02ed3f14f8b4bdae97f91106273c0fc", ...

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