lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <j...@basetechnology.com>
Subject Minor bug/annoyance: Extra parentheses for DisjunctionMaxQuery in Solr parsedquery
Date Mon, 27 Aug 2012 15:26:28 GMT
The output for the Solr “parsedquery” response element for 
DisjunctionMaxQuery has an extra set of parentheses which are at a minimum 
annoying, but also misleading since technically they should indicate a 
nested BooleanQuery, which is not the case.

For example:

<str name="parsedquery">
    (+DisjunctionMaxQuery((id:test | features:test | name:test)))/no_coord
</str>

I think that should be:
    (+DisjunctionMaxQuery(id:test | features:test | name:test))/no_coord

The fix would be in QueryParsing.toString to add a special case for DMQ. 
Before:

} else {
  out.append(query.getClass().getSimpleName()
          + '(' + query.toString() + ')');
  writeBoost = false;
}

Insert:

} else if (query instanceof DisjunctionMaxQuery ) {
  out.append(query.getClass().getSimpleName() + query.toString());
  writeBoost = false;

-- Jack Krupansky 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message