Home > Blockchain >  Elasticsearch result count shows less than what it should be
Elasticsearch result count shows less than what it should be

Time:06-24

I'm not sure why when I search for the documents from an index I'm only getting 10 when it tells me I have more. From the image below you can see that it says there are 45 hits but when I count the number of hits it's far less than that.enter image description here

The command I used to grab the documents is:

curl -XGET http://localhost:9200/contextual_original/_search/?pretty

I know the count of 45 is correct but I'm not sure why only 10 of them are showing up. Does anyone know what I'm missing here?

CodePudding user response:

By default, elasticsearch limits the number of results that match your search to 10.

You must set the size parameter if you want to obtain more hits. The "size" parameter is used to provide the maximum number of results for a search that you want to return.

Modify your command as shown below (for suppose you want to retrieve 20 documents)

curl -XGET http://localhost:9200/contextual_original/_search/?size=20&pretty
  • Related