lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <>
Subject Re: Escaping special character -
Date Wed, 19 Oct 2011 19:48:36 GMT
Not really. The time it takes to parse a query is
usually such a small fraction of the time it takes to
execute the search that it's almost completely

But using the API to build your query is less prone to
silly programming errors (i.e. typos in the string etc), and
it gives you far greater flexibility to use some of the
more esoteric Lucene features. Consider the entire
Span family of queries for instance....

This rather assumes you're NOT taking Lucene-syntax
style input from the users. There're few good reasons (and
lots of bad reasons) to parse user's input in order to use
the API, starting with the fact that you'd be re-implementing
the parser! Unless your UI doesn't allow complexity..


On Wed, Oct 19, 2011 at 8:51 PM, anne <> wrote:
> Thanks for your response Erik. Next time I will use the user mailing list.
> I have used the WhitespaceTokenizer and now it works.
> As a follow up question: i read in many places that it is better to use the
> APi to build your query instead of providing the queryString and having it
> being parsed. Does the better means "better for performance"?
> Thanks a lot,
> Anne
> --
> View this message in context:
> Sent from the Lucene - Java Developer mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message