Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot search using routing keys that end in whitespace #27708

kakaner opened this issue Dec 7, 2017 · 2 comments


Copy link

commented Dec 7, 2017

Elasticsearch version (bin/elasticsearch --version):
Version: 5.6.3, Build: 1a2f265/2017-10-06T20:33:39.012Z, JVM: 1.8.0_45

Plugins installed: []

JVM version (java -version):
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

OS version (uname -a if on a Unix-like system):
Linux 3.10.0-514.16.1.el7.x86_64 #1 SMP Wed Apr 12 15:04:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:
Documents can't be retrieved if their routing key ends with a whitespace. Whitespace at other positions in the key, however, work correctly.

Steps to reproduce:

Please include a minimal but complete recreation of the problem, including
(e.g.) index creation, mappings, settings, query etc. The easier you make for
us to reproduce it, the more likely that somebody will take the time to look at it.

➜  ~ curl -XPOST "localhost:9200/test/test/1?routing=key" -d '{ "name" : "routing is key" }'

➜  ~ curl "localhost:9200/test/test/_search?routing=key"
{"took":69,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":1,"max_score":1.0,"hits":[{"_index":"test","_type":"test","_id":"1","_score":1.0,"_routing":"key","_source":{ "name" : "routing is key" }}]}}
➜  ~ curl -XPOST "localhost:9200/test/test/1?routing=ke%20" -d '{ "name" : "routing is ke " }'

➜  ~ curl "localhost:9200/test/test/_search?routing=ke%20"
➜  ~ curl -XPOST "localhost:9200/test/test/1?routing=k%20e" -d '{ "name" : "routing is k e" }'
➜  ~ curl "localhost:9200/test/test/_search?routing=k%20e"
{"took":2,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":1,"max_score":1.0,"hits":[{"_index":"test","_type":"test","_id":"1","_score":1.0,"_routing":"k e","_source":{ "name" : "routing is k e" }}]}}

Provide logs (if relevant):


This comment has been minimized.

Copy link

commented Dec 8, 2017

@taylorKonigsmark There is an open PR: #27712


This comment has been minimized.

Copy link

commented Dec 8, 2017

Closed by #27712

@jasontedor jasontedor closed this Dec 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.