Class PhrasesIdentificationComponent.PhrasesContextData
- java.lang.Object
-
- org.apache.solr.handler.component.PhrasesIdentificationComponent.PhrasesContextData
-
- Enclosing class:
- PhrasesIdentificationComponent
public static final class PhrasesIdentificationComponent.PhrasesContextData extends Object
Simple container for all request options and data this component needs to store in the Request Context- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-
Field Summary
Fields Modifier and Type Field Description List<PhrasesIdentificationComponent.Phrase>allPhrasesSchemaFieldanalysisFieldMap<String,Double>fieldWeightsintmaxIndexedPositionLengthintmaxQueryPositionLengthStringrawInputStringsummaryPostStringsummaryPre
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PhrasesIdentificationComponent.PhrasesContextDataparseAndValidateRequest(SolrQueryRequest req)Parses the params included in this request, throwing appropriate user level Exceptions for invalid input, and returning aPhrasesContextDatasuitable for use in this request.Stringsummarize(List<PhrasesIdentificationComponent.Phrase> results)Given a list of phrases to be returned to the user, summarizes those phrases by decorating the original input string to indicate where the identified phrases exist, usingsummaryPreandsummaryPost
-
-
-
Field Detail
-
rawInput
public final String rawInput
-
maxIndexedPositionLength
public final int maxIndexedPositionLength
-
maxQueryPositionLength
public final int maxQueryPositionLength
-
analysisField
public final SchemaField analysisField
-
allPhrases
public final List<PhrasesIdentificationComponent.Phrase> allPhrases
-
summaryPre
public final String summaryPre
-
summaryPost
public final String summaryPost
-
-
Method Detail
-
parseAndValidateRequest
public static PhrasesIdentificationComponent.PhrasesContextData parseAndValidateRequest(SolrQueryRequest req) throws org.apache.solr.common.SolrException
Parses the params included in this request, throwing appropriate user level Exceptions for invalid input, and returning aPhrasesContextDatasuitable for use in this request.- Throws:
org.apache.solr.common.SolrException
-
summarize
public String summarize(List<PhrasesIdentificationComponent.Phrase> results)
Given a list of phrases to be returned to the user, summarizes those phrases by decorating the original input string to indicate where the identified phrases exist, usingsummaryPreandsummaryPost- Parameters:
results- a list of (non overlapping) Phrases that have been identified, sorted from highest scoring to lowest- Returns:
- the original user input, decorated to indicate the identified phrases
-
-