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 ClassesNested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoBean
SolrInfoBean.Category, SolrInfoBean.Group -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringquery parser plugin: default interleaving algorithmstatic final intquery parser plugin: default number of documents to rerankstatic final Stringquery parser plugin:the param that selects the interleaving algorithm to usestatic final Stringquery parser plugin: the name of the attribute for setting the modelstatic final Stringstatic final Stringquery parser plugin:the param that will select how the number of document to rerankFields inherited from class org.apache.solr.search.QParserPlugin
DEFAULT_QTYPE, standardPlugins -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateParser(String qstr, org.apache.solr.common.params.SolrParams localParams, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req) extractEFIParams(org.apache.solr.common.params.SolrParams localParams) Given a set of local SolrParams, extract all of the efi.key=value params into a mapvoidinform(org.apache.lucene.util.ResourceLoader loader) voidinit(org.apache.solr.common.util.NamedList<?> args) voidonManagedResourceInitialized(org.apache.solr.common.util.NamedList<?> args, ManagedResource res) Methods inherited from class org.apache.solr.search.QParserPlugin
getCategory, getDescription, getName, getSolrMetricsContext, initializeMetricsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.metrics.SolrMetricProducer
close
-
Field Details
-
NAME
- See Also:
-
MODEL
query parser plugin: the name of the attribute for setting the model- See Also:
-
DEFAULT_RERANK_DOCS
public static final int DEFAULT_RERANK_DOCSquery parser plugin: default number of documents to rerank- See Also:
-
RERANK_DOCS
query parser plugin:the param that will select how the number of document to rerank- See Also:
-
DEFAULT_INTERLEAVING_ALGORITHM
query parser plugin: default interleaving algorithm- See Also:
-
INTERLEAVING_ALGORITHM
query parser plugin:the param that selects the interleaving algorithm to use- See Also:
-
-
Constructor Details
-
LTRQParserPlugin
public LTRQParserPlugin()
-
-
Method Details
-
init
public void init(org.apache.solr.common.util.NamedList<?> args) - Specified by:
initin 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:
createParserin 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
- Specified by:
informin 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:
onManagedResourceInitializedin interfaceManagedResourceObserver- Throws:
org.apache.solr.common.SolrException
-