RE: Is it generally a good idea to avoid using QueryParser if you know how to make the Query yourself?

2009年10月30日 16:46:20 -0700

You can combine queries . (such as your custom "TermQuery" + the result of a
"QueryParser.Parse")
DIGY
-----Original Message-----
From: Ron Grabowski [mailto:[email protected]] 
Sent: Saturday, October 31, 2009 1:12 AM
To: [email protected]
Subject: Is it generally a good idea to avoid using QueryParser if you know
how to make the Query yourself?
I can convert this text into a Query using just TermQuery and BooleanQuery:
 name:"ACME Produce" AND city:Anytown AND zip:90210
If I create the Query object on my own will I loose all the benefits from
things like StandardAnalyzer? Is there a way I can submit an object graph
to QueryParser so I can get the benefits of its analyzer without making it
parse the raw string? My input is coming from well defined areas; its not
free form where the user can enter anything they want.
Can I use a StandardAnalyzer myself then take its output and create the
appropriate Query objects then join all of them into a BooleanQuery?
I'm using /tags/Lucene.Net_2_4_0.

Reply via email to