Package org.apache.solr.search
Class DisMaxQParser
java.lang.Object
org.apache.solr.search.QParser
org.apache.solr.search.DisMaxQParser
Query parser for dismax queries
Note: This API is experimental and may change in non backward-compatible ways in the future
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.lucene.search.Queryprotected String[]protected List<org.apache.lucene.search.Query> protected org.apache.lucene.search.QueryFields inherited from class org.apache.solr.search.QParser
FLAG_FILTER, flags, localParams, localParamsEnd, params, qstr, query, recurseCount, req, stringIncludingLocalParams, valFollowedParams -
Constructor Summary
ConstructorsConstructorDescriptionDisMaxQParser(String qstr, org.apache.solr.common.params.SolrParams localParams, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddBoostFunctions(org.apache.lucene.search.BooleanQuery.Builder query, org.apache.solr.common.params.SolrParams solrParams) protected voidaddBoostQuery(org.apache.lucene.search.BooleanQuery.Builder query, org.apache.solr.common.params.SolrParams solrParams) voidaddDebugInfo(org.apache.solr.common.util.NamedList<Object> debugInfo) protected booleanaddMainQuery(org.apache.lucene.search.BooleanQuery.Builder query, org.apache.solr.common.params.SolrParams solrParams) Adds the main query to the query argument.protected org.apache.lucene.search.QuerygetAlternateUserQuery(org.apache.solr.common.params.SolrParams solrParams) String[]org.apache.lucene.search.QuerygetParser(Map<String, Float> fields, String paramName, org.apache.solr.common.params.SolrParams solrParams, float tiebreaker) protected org.apache.lucene.search.QuerygetPhraseQuery(String userQuery, SolrPluginUtils.DisjunctionMaxQueryParser pp) protected org.apache.lucene.search.QuerygetUserQuery(String userQuery, SolrPluginUtils.DisjunctionMaxQueryParser up, org.apache.solr.common.params.SolrParams solrParams) org.apache.lucene.search.Queryparse()Create and return theQueryobject represented byqstr.static StringparseMinShouldMatch(IndexSchema schema, org.apache.solr.common.params.SolrParams params) Applies the appropriate default rules for the "mm" param based on the effective value of the "q.op" paramparseQueryFields(IndexSchema indexSchema, org.apache.solr.common.params.SolrParams solrParams) UsesSolrPluginUtils.parseFieldBoosts(String)with the 'qf' parameter.Methods inherited from class org.apache.solr.search.QParser
getFlags, getLocalParams, getParam, getParams, getParser, getParser, getParser, getPrefixQueryMinPrefixLength, getQuery, getReq, getSortSpec, getString, isFilter, parseAsValueSource, setFlags, setIsFilter, setLocalParams, setParams, setReq, setString, subQuery
-
Field Details
-
queryFields
-
parsedUserQuery
protected org.apache.lucene.search.Query parsedUserQuery -
boostParams
-
boostQueries
-
altUserQuery
protected org.apache.lucene.search.Query altUserQuery
-
-
Constructor Details
-
DisMaxQParser
public DisMaxQParser(String qstr, org.apache.solr.common.params.SolrParams localParams, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req)
-
-
Method Details
-
parseMinShouldMatch
public static String parseMinShouldMatch(IndexSchema schema, org.apache.solr.common.params.SolrParams params) Applies the appropriate default rules for the "mm" param based on the effective value of the "q.op" param- See Also:
-
parseQueryFields
public static Map<String,Float> parseQueryFields(IndexSchema indexSchema, org.apache.solr.common.params.SolrParams solrParams) throws SyntaxError UsesSolrPluginUtils.parseFieldBoosts(String)with the 'qf' parameter. Falls back to the 'df' parameter- Throws:
SyntaxError
-
parse
Description copied from class:QParserCreate and return theQueryobject represented byqstr. Null MAY be returned to signify there was no input (e.g. no query string) to parse.- Specified by:
parsein classQParser- Throws:
SyntaxError- See Also:
-
addBoostFunctions
protected void addBoostFunctions(org.apache.lucene.search.BooleanQuery.Builder query, org.apache.solr.common.params.SolrParams solrParams) throws SyntaxError - Throws:
SyntaxError
-
addBoostQuery
protected void addBoostQuery(org.apache.lucene.search.BooleanQuery.Builder query, org.apache.solr.common.params.SolrParams solrParams) throws SyntaxError - Throws:
SyntaxError
-
addMainQuery
protected boolean addMainQuery(org.apache.lucene.search.BooleanQuery.Builder query, org.apache.solr.common.params.SolrParams solrParams) throws SyntaxError Adds the main query to the query argument. If it's blank then false is returned.- Throws:
SyntaxError
-
getAlternateUserQuery
protected org.apache.lucene.search.Query getAlternateUserQuery(org.apache.solr.common.params.SolrParams solrParams) throws SyntaxError - Throws:
SyntaxError
-
getPhraseQuery
protected org.apache.lucene.search.Query getPhraseQuery(String userQuery, SolrPluginUtils.DisjunctionMaxQueryParser pp) throws SyntaxError - Throws:
SyntaxError
-
getUserQuery
protected org.apache.lucene.search.Query getUserQuery(String userQuery, SolrPluginUtils.DisjunctionMaxQueryParser up, org.apache.solr.common.params.SolrParams solrParams) throws SyntaxError - Throws:
SyntaxError
-
getParser
protected SolrPluginUtils.DisjunctionMaxQueryParser getParser(Map<String, Float> fields, String paramName, org.apache.solr.common.params.SolrParams solrParams, float tiebreaker) -
getDefaultHighlightFields
- Overrides:
getDefaultHighlightFieldsin classQParser
-
getHighlightQuery
- Overrides:
getHighlightQueryin classQParser- Throws:
SyntaxError
-
addDebugInfo
- Overrides:
addDebugInfoin classQParser
-