-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify realtime get API documentation #45717
Comments
I encounter the exactly same situation.
the result will be:
and if you enable realtime, which is default, you can get the doc:
Changing HTTP method from GET to HEAD in above examples also illustrate this problem, but might see this more clearly. I am curious about why GET work without refreshing data into Lucene index, and how is the performance. |
Pinging @elastic/es-distributed |
Pinging @elastic/es-docs |
[docs issue triage] Leaving open as this is still relevant. |
The documentation was imprecise here. ES distinguishes between internal and external refreshes. Internal refreshes are used to build segments, whereas external refreshes are used to expose these newly built segments. In case where a document is accessed using a realtime get, and the document is still in the Lucene buffer (i.e. not internally refreshed yet), Elasticsearch triggers an internal refresh. This is why you can't observed the "internally refreshed" document. Note that all of this is changing in ES 7.6+ (see #48843). From that version on, realtime get will not trigger a refresh anymore, making all these explanations moot. The docs in newer versions have been updated to that effect. |
Reported at: https://discuss.elastic.co/t/the-id-query-will-trigger-refresh-but-i-still-cant-search-with-query-qsl/195829
The documentation states:
But the following script does not seem to prove it:
This gives empty results:
This gives empty results although we called the GET API:
This works when we manually refresh the index:
So the documentation is not entirely exact about what is happening behind the scene. May be it's because I have only one document and some threshold are involved here?
The text was updated successfully, but these errors were encountered: