Class SolrPluginUtils.DisjunctionMaxQueryParser

java.lang.Object
org.apache.lucene.util.QueryBuilder
All Implemented Interfaces:
QueryParserConstants
Enclosing class:
SolrPluginUtils

public static class SolrPluginUtils.DisjunctionMaxQueryParser extends SolrQueryParser
A subclass of SolrQueryParser that supports aliasing fields for constructing DisjunctionMaxQueries.
  • Field Details

  • Constructor Details

    • DisjunctionMaxQueryParser

      public DisjunctionMaxQueryParser(QParser qp, String defaultField)
  • Method Details

    • addAlias

      public void addAlias(String field, float tiebreaker, Map<String,Float> fieldBoosts)
      Add an alias to this query parser.
      Parameters:
      field - the field name that should trigger alias mapping
      tiebreaker - to the tiebreaker to be used in the DisjunctionMaxQuery
      fieldBoosts - the mapping from fieldname to boost value that should be used to build up the clauses of the DisjunctionMaxQuery.
      See Also:
    • getFieldQuery

      protected org.apache.lucene.search.Query getFieldQuery(String field, String queryText, boolean quoted, boolean raw) throws SyntaxError
      Delegates to the super class unless the field has been specified as an alias -- in which case we recurse on each of the aliased fields, and the results are composed into a DisjunctionMaxQuery. (so yes: aliases which point at other aliases should work)
      Overrides:
      getFieldQuery in class SolrQueryParserBase
      Throws:
      SyntaxError