org.apache.solr.search

## Class MaxScoreQParser

- java.lang.Object
- - org.apache.solr.search.QParser
  - - org.apache.solr.search.LuceneQParser
    - - org.apache.solr.search.MaxScoreQParser

-     public class MaxScoreQParser
      extends LuceneQParser

  See Also:
    `MaxScoreQParserPlugin`

- - ### Field Summary

    - ### Fields inherited from class org.apache.solr.search.QParser

      `localParams, localParamsEnd, params, qstr, query, recurseCount, req, stringIncludingLocalParams, valFollowedParams`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MaxScoreQParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Query` | `parse()` Parses the query exactly like the Lucene parser does, but delegates all SHOULD clauses to DisjunctionMaxQuery with meaning only the clause with the max score will contribute to the overall score, unless the tie parameter is specified.

    - ### Methods inherited from class org.apache.solr.search.LuceneQParser

      `getDefaultHighlightFields`

    - ### Methods inherited from class org.apache.solr.search.QParser

      `addDebugInfo, getHighlightQuery, getLocalParams, getParam, getParams, getParser, getParser, getQuery, getReq, getSort, getSortSpec, getString, setLocalParams, setParams, setReq, setString, subQuery`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MaxScoreQParser

          public MaxScoreQParser(String qstr,
                                 SolrParams localParams,
                                 SolrParams params,
                                 SolrQueryRequest req)

  - ### Method Detail

    - #### parse

          public Query parse()
                      throws SyntaxError

      Parses the query exactly like the Lucene parser does, but delegates all SHOULD clauses to DisjunctionMaxQuery with meaning only the clause with the max score will contribute to the overall score, unless the tie parameter is specified.
      The max() is only calculated from the SHOULD clauses. Any MUST clauses will be passed through as separate BooleanClauses and thus always contribute to the score.
      Overrides:
        `parse` in class `LuceneQParser`
      Returns:
        the resulting Query
      Throws:
        `SyntaxError` - if parsing fails
      See Also:
        `QParser.getQuery()`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.