February 2018
Intermediate to advanced
246 pages
6h 3m
English
In order to test /api/query we need to maintain the preceding state of the server to make useful queries:
$ # Querying for "apple"
$ curl -LX POST -d '["apple"]' localhost:9090/api/query | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 202 100 193 100 9 193 9 0:00:01 --:--:-- 0:00:01 40400
{
"count": 2,
"data": [
{
"doc_id": "Book 1",
"doc_score": 2,
"token_indices": [
{
"Index": 0,
"LIndex": 0
},
{
"Index": 0,
"LIndex": 1
}
]
},
{
"doc_id": "Book 3",
"doc_score": 1,
"token_indices": [
{
"Index": 0,
"LIndex": 0
}
]
}
]
}
$ # Querying for "cake"
$ curl -LX POST -d '["cake"]' localhost:9090/api/query | jq % Total % Received % Xferd Average Speed Time Time Time Current ...Read now
Unlock full access