0

Here's what I'm doing:

First, I make a search and get some documents

curl -XPOST index/type/_search
{
   "query" : {
      "match_all": {}
   },
   "size": 10
}

Then, I'm updating one of the documents resulted in the search

curl -XPOST index/type/_id/_update
{
   "doc" : {
      "some_field" : "Some modification goes here."
   }
}

And finally, I'm doing exactly the same search as above.

But the curious thing is that I get all the previous documents, except the updated one. Why is it no longer among the documents in the search?

Thank you!

1 Answers1

2

Since you're not sorting your documents, they are sorted by score. Your modification might have changed the document score after which the documents are sorted by default.

And since you're only taking the first 10 documents, you have no guarantee that your new document will come back in those 10 documents.

Val
  • 207,596
  • 13
  • 358
  • 360