I'm running an Elasticsearch production environment with a custom routing field. This has helped search performance significantly, but we just noticed that some routing fields are unsearchable as they were indexed with strings contain commas. An example would be an indexed document with
"routing": "hi, hello", where this routing is impossible to search.
I understand that commas are used when using multiple routing keys, however we have tried both escaping the comma with backslash ("," & "\,") and URL-encoding it to
%2C (as has worked for "&") without any success. Furthermore, we are sending the routing as an array of strings via the node API, where different strings are clearly separated already (and commas aren't needed to separate), as when using the REST API.
I have looked at the documentation for _routing field and Search shard routing, but none of them mention that commas are forbidden or not recommended in routing (they were allowed on index time), and the docs does not suggest any way of escaping them.
Have I missed something, or are they not allowed? In that case it would have been very useful to add this to the docs or add some way of escaping these.