Customizable optional operators for the regexp query

Description

See https://www.elastic.co/guide/en/elasticsearch/reference/current/regexp-syntax.html#regexp-optional-operators. This is a Lucene feature, so it actually works for the Lucene backend too.

It turns out those operators are enabled by default, so for example searching for .*@gmail.com will match www.gmail.com, because @ is a meta-character and means "any string".

This is definitely surprising, but more importantly it stands in the way of users simply wanting to use "standard" meta-characters.

We should offer a way to customize enabled operators, with flags, similar to what we did for simpleQueryString. See org.hibernate.search.engine.search.predicate.dsl.SimpleQueryStringPredicateOptionsStep#flags(org.hibernate.search.engine.search.predicate.dsl.SimpleQueryFlag...)

Also, let’s disable Lucene-specific, optional operators by default.

Activity

Show:
Fixed

Details

Assignee

Reporter

Components

Sprint

Fix versions

Priority

Created November 2, 2021 at 11:50 AM
Updated January 18, 2022 at 8:41 AM
Resolved January 7, 2022 at 2:08 PM