The id query will trigger refresh, but I still can't search with query qsl?

official documentation : the get API will issue a refresh call in-place to make the document visible.
id query doc

First I call the id query, then call query QSL, the official documentation says it will call refresh, but I still can't search with query qsl?

(I set the refresh_interval is 60s for test)

It will only call a refresh if the document has been updated.

As shown in the figure,I first add a document, and then call the id query to find this data, but I still can't query with the query QSL, so querying a new document will not refresh?

Is this field a keyword or not analyzed?


Wǒ chángshì qù gēngxīn yītiáo wéndàng, gēngxīn level cóng DEBUG8 biàn chéng DEBUG9, ránhòu shǐyòng id cháxún kěyǐ zhǎodào zhǎodào zhè tiáo wéndàng, dànshì wǒ shǐyòng query DSL yòng DEBUG9 qù cháxún zhe réngrán zhǎo bù dào zhè tiáo wéndàng.

87/5000

I tried to update a document, update the level from DEBUG8 to DEBUG9, and then use the id query to find this document, but I still can't find this document using the query DSL.
So does the id query not trigger refresh?

Yes, this field is a keyword type

I'll try to reproduce later today.

The workaround is to call the refresh API.

Thanks for your reply. I set the refresh_interval is 60s for test.
I have a guess whether the id query is query the translog to get real-time data?

So I was able to reproduce it with:

DELETE test
PUT test 
{
  "settings": {
    "refresh_interval": "-1"
  }
}
PUT test/_doc/1
{
  "foo": "bar"
}
GET test/_search
GET test/_doc/1
GET test/_search
POST test/_refresh
GET test/_search

I opened a documentation issue at:

Thanks for reporting.

If the id query real-time is not implemented by refresh, then it is implemented by what?
Whether to obtain real-time data by querying translog?

If the refresh did not happen, yes it's read from the translog.

Thank you very much for your answer. :smile:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.