I'm trying to understand how a search query works. Based on the docs, whenever I query an elasticsearch node,
- Search request hits a node
- The node broadcasts this request to every shard in the index (either a primary or replica shard)
- Each shard performs the search query and responds with results
- Results are merged on the gateway node, sorted and returned to the user
(src: http://www.elasticsearch.org/blog/customizing-your-document-routing/ )
When I query a node, how does it know which shards are stored on machines? (I'm trying to understand point number 2)
Where does the cluster metadata live? On everynode?