Reputation: 2448
Is there a way to configure an analyzer that will only lower case the input before indexing?
So for example if I get:
"name": "Foo Bar"
The output term should be "foo bar", so I can use a term query to query that exact term.
My use case is to index an entity that I am going to query later with a term query, so I want every thing to be index after lowercased.
Thanks!
Upvotes: 6
Views: 3738
Reputation: 2448
Ok, found it!
Looks like the keyword tokenizer is the right tokenizer to use.
"analysis": {
"analyzer": {
"lowercase": {
"type": "custom",
"tokenizer": "keyword",
"filter": [
"lowercase"
]
}
}
}
Upvotes: 7