You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default query size from ES is 10 results
SearchRequest.query(query) => 10 results
If I set a smaller value, eg 5
SearchRequest.query(query)withTopK(5); => 5 results (OK)
If I set a larger value, eg 100
SearchRequest.query(query)withTopK(100); => 10 results (Not OK) I was expecting 100
This happens because the size parameter of the ES SerachRequest (co.elastic.clients.elasticsearch.core.SearchRequest) is never set, the topK is applied only after the query results, which I think is wrong.
Doing the query directly on the _search ES rest api, I get the intended response -100 results (although not being a similarity query), eg
{
"query": {
"match_all": {}
},
"size": 100
}
Changing in debug the value of SearchRequest.size to 100, I can get also the intended result.
The text was updated successfully, but these errors were encountered:
When creating a request for a query using Elasticsearch store
The default query size from ES is 10 results
SearchRequest.query(query) => 10 results
If I set a smaller value, eg 5
SearchRequest.query(query)withTopK(5); => 5 results (OK)
If I set a larger value, eg 100
SearchRequest.query(query)withTopK(100); => 10 results (Not OK) I was expecting 100
This happens because the size parameter of the ES SerachRequest (
co.elastic.clients.elasticsearch.core.SearchRequest
) is never set, the topK is applied only after the query results, which I think is wrong.Doing the query directly on the _search ES rest api, I get the intended response -100 results (although not being a similarity query), eg
Changing in debug the value of SearchRequest.size to 100, I can get also the intended result.
The text was updated successfully, but these errors were encountered: