Let's assuming I use my user_id for routing. If I understand it correctly,
then all documents for that user id
will be in it's own shard.
I'm not sure how this co-exists with the need to specific the # of shards
when creating an index.
Does routing automatically increase the # of shards when it sees a new
routing id or does it map
routes into the existing set of shards.
Routing doesn't increase the amount of shards and will route you documents to available shards. That means that you can have documents with different user_id in a single shard, so in addition to routing you should also add filtering for the same user_id if you wan to get documents for a particular user only.
So routing is just a way to ensure that the data is always stored in the
same shard?
But that shard could contain other users as well?
On Monday, October 1, 2012 3:09:10 PM UTC-5, Douglas Ferguson wrote:
I'm curious about using routing.
Let's assuming I use my user_id for routing. If I understand it correctly,
then all documents for that user id
will be in it's own shard.
I'm not sure how this co-exists with the need to specific the # of shards
when creating an index.
Does routing automatically increase the # of shards when it sees a new
routing id or does it map
routes into the existing set of shards.
Yes, sharding means consistent indexing of documents with certain field
value(s) to a particular shard and, yes, this does not mean that that
multiple different field values cannot map and be routed to the same shard.
On Monday, October 1, 2012 7:00:13 PM UTC-4, Douglas Ferguson wrote:
So routing is just a way to ensure that the data is always stored in the
same shard?
But that shard could contain other users as well?
On Monday, October 1, 2012 3:09:10 PM UTC-5, Douglas Ferguson wrote:
I'm curious about using routing.
Let's assuming I use my user_id for routing. If I understand it
correctly, then all documents for that user id
will be in it's own shard.
I'm not sure how this co-exists with the need to specific the # of shards
when creating an index.
Does routing automatically increase the # of shards when it sees a new
routing id or does it map
routes into the existing set of shards.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.