The dismax query parser only accepts limited special syntax. From the wiki:

<http://wiki.apache.org/solr/DisMaxRequestHandler?highlight=%28CategorySolrRequestHandler%29%7C%28%28CategorySolrRequestHandler%29%29 >

"...is designed to process simple user entered phrases (without heavy syntax) "

It does not support AND, OR, or parens. But it does support a negation (minus sign in front of a term).

One option is to separate the id's from the search terms, and build up a filter query (fq parameter) that OR's them all together. The default query parser for fq parameters is the standard query parser, not dismax.

In terms of troubleshooting query parsing woes, don't forget that Solr supports &debugQuery=true parameter. The response will show the parsed query, which will often shed light on what is going on.

        Erik


On Jun 19, 2008, at 4:01 AM, Brian Carmalt wrote:

Hello all,

I have defined a DisMax handler. It should search in the following
fields: content1, content2 and id(doc uid). I would like to beable to
specify a query like the following:
        (search terms) AND ( id1 OR id2 .. idn)
My intent is to retrieve only the docs in which hits for the search
terms occur and that the docs have one of the specified ids.

Unfortunately, I get not document matches.

Can any one shed some light on the What I am doing wrong?

Thanks,
Brian

Reply via email to