Ignorecase in exclude pattern

Hi, i have a filter like (.*.png) that match only .png lowercase. how can i add case-insensitive? i've tried to add to query (?i) but nothing go.
Thanks for attention.

Hi @erion,

I assume you are talking about a "phrase" filter in the filter bar? Whether the phrase is case-sensitive depends on the analyzer that is applied to the field you are searching in and the analyzer for the query. These are configured in the mapping and the query.

If you could provide more details about your setup, I might be able to give more specific advice.


Hi @weltenwort this is my search, i want to see only page link. The filter in exclude pattern match only lower case and not upper case. i want that my filter be insensitive case.
thank you for replay

one option would be to reindex your data ... its not possible to choose a diff analyzer for exclude/include pattern ...

1 Like

Hi @ppisljar, so i have to create an index case-insensitive with my data i want makes ignorecase. For this i have to use logstash mapping. is it all ok? thank you for replay

I did not understand that you wanted to use the regexp on an exclude clause for a keyword field. In that case you can try to match all cases using normal character classes:

.*\([pP][nN][gG]|[jJ][pP][gG]|[gG][iI][fF]|[jJ][sS]|[cC][sS][sS])(\?.*)?

Hi @weltenwort i use this because in url.keyword i need to exclude the object. so the url that end wit png or PNG. For this i use exclude pattern or i use "-url.keyword: (.*.png)". what's better?

That depends on your goal. If you just want to prevent a terms aggregation bucket from being created that excludes those extensions, then the exclude filter is correct. Then the documents might still be included in other aggregations within that visualization.

If you want the documents with those extensions to be completely excluded from all aggregations, the -url.keyword:(.*.[pP][nN][gG]) query would be preferable.

Perfect it's the first case. steps: create new index case-insensitive --> insert filter query in visualize and all is ok. thank you very much.

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