Regex based query in elasticsearch 5.6

In elasticsearch 5.6, for getting the data, I am using values as regex in the query.
The query is working for only lowercase regex values, even a single uppercase letter disqualifies the query.

For Example
_search?q=rv11:/.reader./ --> working fine, but
_search?q=rv11:/.Reader./ or
_search?q=rv11:/.READER./ --> are not working

Please suggest me something.

Wildcard queries are not analyzed.
And you should not be using those are they can be very slow.

Hi David

I acknowledge that one should not be using such queries. But having said that, Is there any way to perform case-insensitive wildcard queries ?

I think you can define an analyzer in the query string query. https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html

Elasticsearch 7.0 does analyze the wildcard queries and performs the regex-based, case-insensitive search operations.

What's your take on that ?

In the documentation I linked to there is an analyze_wildcard option. It says:

By default, wildcards terms in a query string are not analyzed. By setting this value to true , a best effort will be made to analyze those as well.

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