Fielded searches with Solr ExtendedDisMax Query Parser

938 views Asked by At

I'm having a problem using the Solr ExtendedDisMax Query Parser with query that contains fielded searches inside not-plain queries.

The case is the following.

If I send to SOLR an edismax request (defType=edismax) with parameters

  1. qf=field1^10
  2. q=field2:ciao
  3. debugQuery=on (for debug purposes)

solr parses the query as I expect, in fact the debug part of the response tells me that

 [parsedquery_toString] => +field2:ciao

But if I make the expression only a bit more complex, like putting the condition into brackets: 1. qf=field1^10 2. q=(field2:ciao) I get

[parsedquery_toString] => +(((field1:field2:^2.0) (field1:ciao^2.0))~2)

where Solr seems not recognize the field syntax.

I've not found any mention to this behavior in the documentation, where instead they say that

This parser supports full Lucene QueryParser syntax including boolean operators 'AND', 'OR', 'NOT', '+' and '-', fielded search, term boosting, fuzzy...

This problem is really annoying me because I would like to do compelx boolean and fielded queries even with the edismax parser.

Do you know a way to workaround this?

EDIT: The Solr version is 3.6

1

There are 1 answers

0
Paige Cook On BEST ANSWER

If you are using Solr 3.6, there is a current issue with eDisMax and Fielded searches that was introduced with Solr 3.6. The workaround is to precede the field name with a space.

So change your query to the following:

  1. qf=field1^10
  2. q=( field2:ciao)

Please see eDismax: A fielded query wrapped by parens is not recognized for the more details.