On Sat, Oct 15, 2016 at 1:21 AM, Rajnish Kamboj <rajnis...@gmail.com> 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.

TX

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to