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 unimportant.
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.. Best Erick On Wed, Oct 19, 2011 at 8:51 PM, anne <[email protected]> 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: > http://lucene.472066.n3.nabble.com/Escaping-special-character-tp3432118p3435311.html > Sent from the Lucene - Java Developer mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
