elasticsearch/elasticsearch — Issue #1450: Blank routing should be ignored
Author: clintongormley
Created: 2011-11-10 11:50:23+00:00
State: open

A blank `routing` parameter should be treated in the same way as no `routing` parameter. Currently it still has an effect:

# [Thu Nov 10 12:48:16 2011] Protocol: http, Server: 127.0.0.2:9200
curl -XPUT 'http://127.0.0.1:9200/test/?pretty=1'

# [Thu Nov 10 12:48:16 2011] Response:
# {
# "ok" : true,
# "acknowledged" : true
# }

# [Thu Nov 10 12:48:18 2011] Protocol: http, Server: 127.0.0.2:9200
curl -XPUT 'http://127.0.0.1:9200/test/bar/1?pretty=1' -d '
{
"foo" : 1
}
'

# [Thu Nov 10 12:48:18 2011] Response:
# {
# "ok" : true,
# "_index" : "test",
# "_id" : "1",
# "_type" : "bar",
# "_version" : 1
# }

# [Thu Nov 10 12:48:21 2011] Protocol: http, Server: 127.0.0.2:9200
curl -XPUT 'http://127.0.0.1:9200/test/bar/1?pretty=1&routing=' -d '
{
"foo" : 1
}
'

# [Thu Nov 10 12:48:21 2011] Response:
# {
# "ok" : true,
# "_index" : "test",
# "_id" : "1",
# "_type" : "bar",
# "_version" : 1
# }

# [Thu Nov 10 12:48:31 2011] Protocol: http, Server: 127.0.0.2:9200
curl -XPOST 'http://127.0.0.1:9200/test/_refresh?pretty=1'

# [Thu Nov 10 12:48:31 2011] Response:
# {
# "ok" : true,
# "_shards" : {
# "failed" : 0,
# "successful" : 5,
# "total" : 10
# }
# }

# [Thu Nov 10 12:48:35 2011] Protocol: http, Server: 127.0.0.2:9200
curl -XGET 'http://127.0.0.1:9200/test/_search?pretty=1'

# [Thu Nov 10 12:48:35 2011] Response:
# {
# "hits" : {
# "hits" : [
# {
# "_source" : {
# "foo" : 1
# },
# "_score" : 1,
# "_index" : "test",
# "_id" : "1",
# "_type" : "bar"
# },
# {
# "_source" : {
# "foo" : 1
# },
# "_score" : 1,
# "_index" : "test",
# "_id" : "1",
# "_type" : "bar"
# }
# ],
# "max_score" : 1,
# "total" : 2
# },
# "timed_out" : false,
# "_shards" : {
# "failed" : 0,
# "successful" : 5,
# "total" : 5
# },
# "took" : 1
# }