Blank routing should be ignored, closes #1450.

This commit is contained in:
Shay Banon 2011-11-13 12:04:02 +02:00
parent da98aab13f
commit f4adff652c
2 changed files with 10 additions and 2 deletions

View File

@ -185,7 +185,11 @@ public class DeleteRequest extends ShardReplicationOperationRequest {
* and not the id.
*/
public DeleteRequest routing(String routing) {
this.routing = routing;
if (routing != null && routing.length() == 0) {
this.routing = null;
} else {
this.routing = routing;
}
return this;
}

View File

@ -248,7 +248,11 @@ public class IndexRequest extends ShardReplicationOperationRequest {
* and not the id.
*/
public IndexRequest routing(String routing) {
this.routing = routing;
if (routing != null && routing.length() == 0) {
this.routing = null;
} else {
this.routing = routing;
}
return this;
}