On 1/20/2011 1:42 AM, kun xiong wrote:
Thar example string means our query is BooleanQuery containing
BooleanQuerys.
I am wondering how to write a complicated BooleanQuery for dismax, like (A
or B or C) and (D or E)
Or I have to use Lucene query parser.
You can't do it with dismax. You might be able to do it with edismax,
which is in Solr trunk/4.0 or as a patch to 1.4.
You can also do it, in 1.4, with "nested queries" with dismax queries
nested in a 'lucene' query.
But why would you want to? What do you actually want to do? The dismax
parser is great for taking user-entered queries and just sending them
straight to Solr. Is that why you're interested in it? It's also a
convenient way to search a query over multiple fields with different
boosts in different fields, or with other useful boosts like phrase
boosts and such. Is that why you're interested in it? Or something
else? Depending on what you want from it, the easiest solution may be
different. Or if you don't want _anything_ from it, and are happy with a
straight lucene-style query, then there's no reason to do use it, just
use the straight 'lucene' query parser, no problem.