Package org.apache.solr.ltr.search
Class LTRQParserPlugin
- java.lang.Object
-
- org.apache.solr.search.QParserPlugin
-
- org.apache.solr.ltr.search.LTRQParserPlugin
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.lucene.util.ResourceLoaderAware
,SolrInfoBean
,SolrMetricProducer
,ManagedResourceObserver
,NamedListInitializedPlugin
public class LTRQParserPlugin extends QParserPlugin implements org.apache.lucene.util.ResourceLoaderAware, ManagedResourceObserver
Plug into solr a rerank model.Learning to Rank Query Parser Syntax: rq={!ltr model=6029760550880411648 reRankDocs=300 efi.myCompanyQueryIntent=0.98}
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
LTRQParserPlugin.LTRQParser
-
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoBean
SolrInfoBean.Category, SolrInfoBean.Group
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_INTERLEAVING_ALGORITHM
query parser plugin: default interleaving algorithmstatic int
DEFAULT_RERANK_DOCS
query parser plugin: default number of documents to rerankstatic String
INTERLEAVING_ALGORITHM
query parser plugin:the param that selects the interleaving algorithm to usestatic String
MODEL
query parser plugin: the name of the attribute for setting the modelstatic String
NAME
static String
RERANK_DOCS
query parser plugin:the param that will select how the number of document to rerank-
Fields inherited from class org.apache.solr.search.QParserPlugin
DEFAULT_QTYPE, standardPlugins
-
-
Constructor Summary
Constructors Constructor Description LTRQParserPlugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description QParser
createParser(String qstr, org.apache.solr.common.params.SolrParams localParams, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req)
static Map<String,String[]>
extractEFIParams(org.apache.solr.common.params.SolrParams localParams)
Given a set of local SolrParams, extract all of the efi.key=value params into a mapvoid
inform(org.apache.lucene.util.ResourceLoader loader)
void
init(org.apache.solr.common.util.NamedList<?> args)
void
onManagedResourceInitialized(org.apache.solr.common.util.NamedList<?> args, ManagedResource res)
-
Methods inherited from class org.apache.solr.search.QParserPlugin
getCategory, getDescription, getName, getSolrMetricsContext, initializeMetrics
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.metrics.SolrMetricProducer
close
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
MODEL
public static final String MODEL
query parser plugin: the name of the attribute for setting the model- See Also:
- Constant Field Values
-
DEFAULT_RERANK_DOCS
public static final int DEFAULT_RERANK_DOCS
query parser plugin: default number of documents to rerank- See Also:
- Constant Field Values
-
RERANK_DOCS
public static final String RERANK_DOCS
query parser plugin:the param that will select how the number of document to rerank- See Also:
- Constant Field Values
-
DEFAULT_INTERLEAVING_ALGORITHM
public static final String DEFAULT_INTERLEAVING_ALGORITHM
query parser plugin: default interleaving algorithm- See Also:
- Constant Field Values
-
INTERLEAVING_ALGORITHM
public static final String INTERLEAVING_ALGORITHM
query parser plugin:the param that selects the interleaving algorithm to use- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(org.apache.solr.common.util.NamedList<?> args)
- Specified by:
init
in interfaceNamedListInitializedPlugin
-
createParser
public QParser createParser(String qstr, org.apache.solr.common.params.SolrParams localParams, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req)
- Specified by:
createParser
in classQParserPlugin
-
extractEFIParams
public static Map<String,String[]> extractEFIParams(org.apache.solr.common.params.SolrParams localParams)
Given a set of local SolrParams, extract all of the efi.key=value params into a map- Parameters:
localParams
- Local request parameters that might conatin efi params- Returns:
- Map of efi params, where the key is the name of the efi param, and the value is the value of the efi param
-
inform
public void inform(org.apache.lucene.util.ResourceLoader loader) throws IOException
- Specified by:
inform
in interfaceorg.apache.lucene.util.ResourceLoaderAware
- Throws:
IOException
-
onManagedResourceInitialized
public void onManagedResourceInitialized(org.apache.solr.common.util.NamedList<?> args, ManagedResource res) throws org.apache.solr.common.SolrException
- Specified by:
onManagedResourceInitialized
in interfaceManagedResourceObserver
- Throws:
org.apache.solr.common.SolrException
-
-