Skip to content

Clarify realtime get API documentation #45717

Closed
@dadoonet

Description

@dadoonet

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:

If a document has been updated but is not yet refreshed, the get API will issue a refresh call in-place to make the document visible. This will also make other documents changed since the last refresh visible.

But the following script does not seem to prove it:

DELETE test
PUT test 
{
  "settings": {
    "refresh_interval": "-1"
  }
}
PUT test/_doc/1
{
  "foo": "bar"
}

This gives empty results:

GET test/_search

This gives empty results although we called the GET API:

GET test/_doc/1
GET test/_search

This works when we manually refresh the index:

POST test/_refresh
GET test/_search

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Distributed Indexing/CRUDA catch all label for issues around indexing, updating and getting a doc by id. Not search.>docsGeneral docs changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions