I have been using the size field with from field with size field set to 1000 and from field to 0. { "from : 0, "sort": .... , "_source": ... , "size": 1000 }
Even after this query i am getting more than 1000 hits. How can we solve this?
hi @Yash_Kapoor,
you can use like this , how many total hits in your Es ?
{
"query": {
"bool": {
"must": [
{
"match_all": {}
}
],
"should":
}
},
"from": 0,
"size": 1000
}
Hi @Yash_Kapoor
If you are talking about the value of "total" under hits, It is the count of document matched your search string. But the number of documents retrieved will be 1000 only.
Try testing it with lower size such as 2 or 3. This would retrieve only 2 or 3 but the value of "total" under hits would be the same.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.