Elasticsearch: Parameter "include" isn't case insensitive

Hello,

How can I configure the index in elasticsearch in order to make the parameter "include" from the aggregation to be case insensitive?

I have this index:

PUT index
{
"settings": {
"analysis": {
"analyzer": {
"my_normalizer": {
"type": "custom",
"tokenizer": "keyword",
"char_filter": ,
"filter": [ "lowercase"]
}
}
}
},
"mappings": {
"_doc": {
"properties": {
"foo": {
"type": "text",
"analyzer": "my_normalizer",
"fielddata": true
}
}
}
}
}
With data:
PUT index/_doc/1
{
"foo": "BAR"
}

PUT index/_doc/2
{
"foo": "bar"
}

And the query:
GET index/_search
{
"size": 0,
"aggs": {
"ad":{
"terms": {"field": "foo",
"include": "ba.*"
}
}}
}
But if i change "ba" in "BA" the aggregation has no result.
Can you help me?

Don't use a lowercase normalizer may be.

Hi,
If i don't use a lowercase normalizer the aggregation returns one result with (""include": "ba."" -bar ) and one result with ("include": "BA." -BAR). But i want both of the results no matter what i type (ba/BA)

The result you are getting is then ba and not BA. That's why you can't include the later.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.