Adding documents to Goophr

Since we have three documents in our file server, we can add them to Goophr using the following curl commands:

$ curl -LX POST -d '{"url":"http://file_server:9876/book1","title":"Book 1"}' localhost:9090/api/feeder | jq  && 
> curl -LX POST -d '{"url":"http://file_server:9876/book2","title":"Book 2"}' localhost:9090/api/feeder | jq  && 
> curl -LX POST -d '{"url":"http://file_server:9876/book3","title":"Book 3"}' localhost:9090/api/feeder | jq 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current 
                                 Dload  Upload   Total   Spent    Left  Speed 
100   107  100    51  100    56     51     56  0:00:01 --:--:--  0:00:01  104k 
{ 
  "code": 200, 
  "msg": "Request is being processed." 
} 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current 
                                 Dload  Upload   Total   Spent    Left  Speed 
100   107  100    51  100    56     51     56  0:00:01 --:--:--  0:00:01 21400 
{ 
  "code": 200, 
  "msg": "Request is being processed." 
} 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current 
                                 Dload  Upload   Total   Spent    Left  Speed 
100   107  100    51  100    56     51     56  0:00:01 --:--:--  0:00:01 21400 
{ 
  "code": 200, 
  "msg": "Request is being processed." 
} 

The following are the logs for the preceding cURL requests as seen by docker-compose:

n_z_librarian_1     | 2018/01/21 19:29:23 Token received api.tPayload{Token:"zebra", Title:"Book 1", DocID:"6911b2295fd23c77fca7d739c00735b14cf80d3c", LIndex:0, Index:3} 
concierge_1         | adding to librarian: zebra 
concierge_1         | adding to librarian: apple 
concierge_1         | adding to librarian: apple 
concierge_1         | adding to librarian: cat 
concierge_1         | 2018/01/21 19:29:23 INFO -  Request was posted to Librairan. Msg:{"code": 200, "msg": "Tokens are being added to index."} 
... 
concierge_1         | 2018/01/21 19:29:23 INFO -  Request was posted to Librairan. Msg:{"code": 200, "msg": "Tokens are being added to index."} 
a_m_librarian_1     | 2018/01/21 19:29:23 Token received api.tPayload{Token:"apple", Title:"Book 1", DocID:"6911b2295fd23c77fca7d739c00735b14cf80d3c", LIndex:0, Index:0} 
... 
n_z_librarian_1     | 2018/01/21 19:29:23 Token received api.tPayload{Token:"zebra", Title:"Book 2", DocID:"fbf2b6c400680389459dff13283cb01dfe9be7d6", LIndex:0, Index:2} 
concierge_1         | adding to librarian: zebra 
concierge_1         | adding to librarian: banana 
concierge_1         | adding to librarian: cake 
... 
concierge_1         | adding to librarian: whale 
concierge_1         | adding to librarian: apple 
concierge_1         | adding to librarian: cake 
concierge_1         | adding to librarian: cake 
... 
concierge_1         | 2018/01/21 19:29:23 INFO -  Request was posted to Librairan. Msg:{"code": 200, "msg": "Tokens are being added to index."} 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset