How does elasticsearch know the document id?


I would like to ask question related to document routing.

According to definitive guide, elasticsearch uses document id to retrieve a document.

However, when queries such as term and match queries are used, document id are not specified in the query.
In this case, how does elasticsearch find out the document id and route to correct shard?

Yu Watanabe

thats easy, queries go to all shards. The whole point of searching is to find the ids of documents that are matching the query, possibly also scoring and ranking them.

Hi @cbuescher

Ah . Your talking about this.

I will look into it . Thank you.