I have an analyzer:
"analyzer" : {
"lowercase_keyword" : {
"type" : "custom",
"tokenizer" : "keyword",
"filter" : ["lowercase", "trim"]
}
}
that is referenced in a mapping:
"location_countries" : {
"properties" : {
"country" : {
"type" : "string",
"analyzer" : "lowercase_keyword"
}
}
}
And when I use the 'country' field in a filter or a facet, the field is
(correctly) treated as a keyword.
curl -XGET 'localhost:9200/clinical_trials/_search?pretty=true' -d '
{
"query" : {
"term" : { "brief_title" : "dermatitis" }
},
"filter" : {
"term" : { "country" : "united states" }
},
"facets" : {
"tag" : {
"terms" : { "field" : "country" }
}
}
}
'
facet results:
"facets" : {
"tag" : {
"_type" : "terms",
"missing" : 0,
"total" : 1,
"other" : 0,
"terms" : [ {
"term" : "united states",
"count" : 1
} ]
}
Everything works fine until the machine gets rebooted or the Elastic
Search service gets restarted. After a restart, all my filters stop working
as if the analyzer does not exist.
The same query against the same data results in:
"facets" : {
"tag" : {
"_type" : "terms",
"missing" : 0,
"total" : 2,
"other" : 0,
"terms" : [ {
"term" : "united",
"count" : 1
}, {
"term" : "states",
"count" : 1
} ]
}
If I query the _settings/_mappings of my index, the analyzer and mappings
are still defined correctly but the analyzer seems to have no effect.
What am I doing wrong?
Thanks in advance,
Kevin
git://gist.github.com/3442562.git
--