How does elasticsearch know the document id?

Hi!

I would like to ask question related to document routing.

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

https://www.elastic.co/guide/en/elasticsearch/guide/2.x/routing-value.html

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?

Thanks,
Yu Watanabe

Hi,
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.

https://www.elastic.co/guide/en/elasticsearch/guide/2.x/distributed-search.html

I will look into it . Thank you.