I'm doing this query in NEST
var result = elasticClient.Search<SearchItemClass>( s=>
s.Index("indexName")
.Type("typeName")
.Query(q => q.ConstantScore(score => score.Filter(f => f.Term("fieldName", "term"))))
);
And this will return 10 Hits by default.
Is there a way I can get ALL results, WITHOUT indicating .Size(value) or .Take(value)?
Thanks in advance!
Introduction. You can use cURL in a UNIX terminal or Windows command prompt, the Kibana Console UI, or any one of the various low-level clients available to make an API call to get all of the documents in an Elasticsearch index. All of these methods use a variation of the GET request to search the index.
By default, you cannot use from and size to page through more than 10,000 hits. This limit is a safeguard set by the index. max_result_window index setting. If you need to page through more than 10,000 hits, use the search_after parameter instead.
You can use the search API to search and aggregate data stored in Elasticsearch data streams or indices. The API's query request body parameter accepts queries written in Query DSL. The following request searches my-index-000001 using a match query. This query matches documents with a user.id value of kimchy .
The reason might be that you haven't provided the size parameter in the query. This limits the result count to 10 by default. Out of all the results the top 10 might be from the two index even thought the match is present in third index as well.
This is a dup of Elasticsearch query to return all records. To use scan and scroll, look at the NEST documentation here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With