I am having some issues implementing routing in an index I am working on, and would really appreciate some help.
After implementing routing in the schema, I created a new index with that schema and populated it. When I check the mapping using "GET myindex/mytype/_mapping", I see the routing configuration and it appears (to me) to be properly set up.
The routing field is called identifiers.state_code and it a string and contains a state code value for each document.
Since I didn't define a specific analyser, ElasticSearch should automatically configure it as a full-text string field and analyze it with the standard analyzer, which includes lower-casing (this per the documentation)
However, routing does not appear to be working as the following two queries return different results:
GET myindex/_search?routing=ar
GET myindex/_search?routing=AR
The lowercase version of the command doesn't even return the routing value I am specified (found this when I added faceting of the state code values to the command to see the various values).
Can anyone tell me what I am doing wrong with the routing configuration? Any and all help appreciated.
Here is a snippet (to keep it short) from the results of running "GET myindex/mytype/_mapping":
{
"myindex": {
"mappings": {
"mytype": {
"_all": {
"enabled": false
},
"_id": {
"path": "id"
},
"_routing": {
"required": true,
"path": "identifiers.state_code"
},
"_timestamp": {
"enabled": true
},
"_index": {
"enabled": true
},
"properties": {
"identifiers": {
"properties": {
"primary_id": {
"type": "long"
},
"state_code": {
"type": "string",
"norms": {
"enabled": false
}
},
...
}
},
...