You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Modassar Ather <mo...@gmail.com> on 2014/12/10 12:03:58 UTC

edismax and default boolean operator.

Hi,

The default boolean operator is hard-coded in ExtendedDismaxQParser. Solr
version is 4.10.1.

Below is the code snippet from ExtendedDismaxQParser.
public ExtendedSolrQueryParser(QParser parser, String defaultField) {
      super(parser, defaultField);
      // don't trust that our parent class won't ever change it's default
      setDefaultOperator(QueryParser.Operator.OR);
    }

Again DisMaxQParser.parseMinShouldMatch(...) method retrieves the default
operator and assigns mm a value.
So if q.op is set to AND in solrconfig then
DisMaxQParser.parseMinShouldMatch(...) will set mm as 100% if there is no
value set for mm in solrconfig and 0% for q.op=OR.

Please help me understand:
    How the q.op set in solrconfig will behave if it is set to AND as the
OR is hardcoded in ExtendedSolrQueryParser?
    How the setDefaultOperator(QueryParser.Operator.OR) and
DisMaxQParser.parseMinShouldMatch(...) effects search results with respect
to the details above?

field:(term1 term2) gets parsed to (field:term1 field:term2)~2 which is
minimum should match=2 whereas per my understanding if the default operator
is OR the default mm should be 0% if no value is set in solrconfig for mm.
And If I am not wrong field:(term1 term2) and field:(term1 OR term2) should
return same results as the default boolean operator is hard-coded as OR.

Please help me understand.

Thanks,
Modassar