lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trejkaz <>
Subject Re: Performance of Prefix, Wildcard and Regex queries?
Date Mon, 17 Oct 2016 00:54:20 GMT
On Sat, Oct 15, 2016 at 1:21 AM, Rajnish Kamboj <> wrote:
> Hi
> Performance of Prefix, Wildcard and Regex queries?
> Does Lucene internally optimizes this (using rewrite or something else) or
> I have to manually create specific queries depending on input pattern.
> Example
> if input is 78* create Prefix query
> if input is 87?98* create Wildcard query
> if input is 87[7-5]* create Regex query.

I think QueryParser already takes care of converting to PrefixQuery
when possible.

Regexes aren't really possible, though. Consider this:

    abc*     (wildcard query, matching abc followed by anything)

Versus this:

    abc*      (regex query, matching ab followed by 0 or more c)

I think for that, you're going to want additional syntax in your query parser.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message