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.
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 matchwww.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.