(My previous post for the same topic seems to be rejected maybe because it
was too long. here's short version. apologies if this duplicates)
Hi,
I'm experimenting routing but having difficulties. Please help.
My observation is that documents that have the same routing value are
indexed in different shards.
Here's the outline.
in the default mapping, I set a routing field "rt".
indexed 3 docs in /test/type1 with routing value "rt1".
indexed 4 docs in /test/type2 with routing value "rt2".
indexed 1 doc in /test/type3 with routing value "rt3".
GET /test/_status returns all 8 docs, but shard0 has 2 docs, shard1 has 3
docs, shard2 has 3 docs.
the distribution does not match the intention.
GET /test/_search?q=* returns all 8 docs
GET /test/_search?q=*&routing=rt1 returns only 2 docs - supposed to be 3
docs
GET /test/_search?q=*&routing=rt2 returns only 3 docs - supposed to be 4
docs
GET /test/_search?q=*&routing=rt3 returns 3 docs - supposed to be 1 doc
Please let me know what I'm doing wrong.
Thanks for your help.
For now, you can overcome it by explicitly specifying the mappings in the
index.
Btw, it is recommended when setting path is to also set required to true,
in which case indexing will fail if no routing is detected. There is
another bug related to default (which is simpler to fix).
(My previous post for the same topic seems to be rejected maybe because it
was too long. here's short version. apologies if this duplicates)
Hi,
I'm experimenting routing but having difficulties. Please help.
My observation is that documents that have the same routing value are
indexed in different shards.
Here's the outline.
in the default mapping, I set a routing field "rt".
indexed 3 docs in /test/type1 with routing value "rt1".
indexed 4 docs in /test/type2 with routing value "rt2".
indexed 1 doc in /test/type3 with routing value "rt3".
GET /test/_status returns all 8 docs, but shard0 has 2 docs, shard1 has
3 docs, shard2 has 3 docs.
the distribution does not match the intention.
GET /test/_search?q=* returns all 8 docs
GET /test/_search?q=*&routing=rt1 returns only 2 docs - supposed to be 3
docs
GET /test/_search?q=*&routing=rt2 returns only 3 docs - supposed to be 4
docs
GET /test/_search?q=*&routing=rt3 returns 3 docs - supposed to be 1 doc
Please let me know what I'm doing wrong.
Thanks for your help.
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.