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 Details

    • rawInput

      public final String rawInput
    • maxIndexedPositionLength

      public final int maxIndexedPositionLength
    • maxQueryPositionLength

      public final int maxQueryPositionLength
    • fieldWeights

      public final Map<String,Double> fieldWeights
    • analysisField

      public final SchemaField analysisField
    • allPhrases

      public final List<PhrasesIdentificationComponent.Phrase> allPhrases
    • summaryPre

      public final String summaryPre
    • summaryPost

      public final String summaryPost
  • Method Details

    • 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 a PhrasesContextData suitable 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, using summaryPre and summaryPost
      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