: It looks like Dismax query parser can somehow handle parens, used for
: applying, for instance, + or - to a group, distributing it. But I'm not
: sure what effect they have on the overall query.

parens are treated like any regular character -- they have no semantic 
meaning.

what may be confusing you is what the *analyzer* you have configured for 
your query field then does with the paren.

For instance, using the example schema on trunk, try the same query...

        q = book (dog +(cat -frog))

..but using a "qf" param containing a string field (no analysis) ...

/select?defType=dismax&q=book+(dog+%2B(cat+-frog))&tie=0.01&qf=text_s&debugQuery=true

It produces the following output (i've added some whitespace)...

<str name="parsedquery">
 +(  DisjunctionMaxQuery((  text_s:book    )~0.01) 
     DisjunctionMaxQuery((  text_s:(dog    )~0.01) 
    +DisjunctionMaxQuery((  text_s:(cat    )~0.01) 
    -DisjunctionMaxQuery((  text_s:frog))  )~0.01)
  ) 
  ()
</str>

...the parens from your query are being treated literally as characters in 
your terms.  you just don't see them in the parsed query because it shows 
you what those terms look like after the anlsysis.

Incidently...

: debugQuery shows:
: 
: +((DisjunctionMaxQuery((text:book)~0.01)
: +DisjunctionMaxQuery((text:dog)~0.01)
: DisjunctionMaxQuery((text:cat)~0.01)
: -DisjunctionMaxQuery((text:frog)~0.01))~2) ()

...double check that, it doesn't seem to match the query string you posted 
(it shows "dog" being mandatory.  i'm guessing you cut/paste the wrong 
example)


-Hoss

Reply via email to