You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into problems trying to index a child document whose parent id contains commas. This only occurs using an index alias, with the index name it works. This is the resulting exception in 0.90.7:
ElasticSearchIllegalArgumentException: index/alias [parentid-testalias] provided with routing value [abc,2] that resolved to several routing values, rejecting operation
at org.elasticsearch.cluster.metadata.MetaData.resolveIndexRouting(MetaData.java:338)
at org.elasticsearch.action.index.IndexRequest.process(IndexRequest.java:557)
...
Here is some code to reproduce the problem:
Client client = new TransportClient().addTransportAddress(new InetSocketTransportAddress("localhost", 9300));
String indexName = "parentid-test";
String indexAlias = "parentid-testalias";
if (client.admin().indices().exists(new IndicesExistsRequest(indexName)).actionGet().isExists()) {
client.admin().indices().delete(new DeleteIndexRequest(indexName)).actionGet();
}
CreateIndexRequest createIndexRequest = new CreateIndexRequest(indexName);
createIndexRequest.mapping("chld", "{\"chld\":{\"_parent\":{\"type\":\"prnt\"}}}");
client.admin().indices().create(createIndexRequest).actionGet();
client.admin().indices().prepareAliases().addAlias(indexName, indexAlias).execute().actionGet();
client.prepareIndex(indexName, "prnt", "abc,1").setSource("{\"text\":\"parent abc,1\"}").execute().actionGet();
client.prepareIndex(indexName, "chld", "def,1").setParent("abc,1").setSource("{\"text\":\"child def,1\"}").execute().actionGet();
client.prepareIndex(indexAlias, "prnt", "abc,2").setSource("{\"text\":\"parent abc,2\"}").execute().actionGet();
// this causes the exception - indexAlias and comma in parent id
client.prepareIndex(indexAlias, "chld", "def,2").setParent("abc,2").setSource("{\"text\":\"child def,2\"}").execute().actionGet();
client.close();
So, if this is how it should be, then I would suggest to add some documentation on invalid characters in IDs, as I didn't find anything regarding this. Any suggestions?
The text was updated successfully, but these errors were encountered:
@hkorte I think this check that throws an error is only supposed to happen if you have a routing specified in the alias it self, not when someone is specifying it via routing or parent id. I think we can fix this, by only running this check if routing is resolved via the alias.
Hi,
I ran into problems trying to index a child document whose parent id contains commas. This only occurs using an index alias, with the index name it works. This is the resulting exception in 0.90.7:
Here is some code to reproduce the problem:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html tells me that this is intended behavior: "...search routing may contain several values separated by comma. Index routing can contain only a single value."
So, if this is how it should be, then I would suggest to add some documentation on invalid characters in IDs, as I didn't find anything regarding this. Any suggestions?
The text was updated successfully, but these errors were encountered: