Class AnalysisRequestHandlerBase

    • Field Detail

      • EMPTY_BYTES_SET

        public static final Set<org.apache.lucene.util.BytesRef> EMPTY_BYTES_SET
    • Constructor Detail

      • AnalysisRequestHandlerBase

        public AnalysisRequestHandlerBase()
    • Method Detail

      • doAnalysis

        protected abstract org.apache.solr.common.util.NamedList doAnalysis​(SolrQueryRequest req)
                                                                     throws Exception
        Performs the analysis based on the given solr request and returns the analysis result as a named list.
        Parameters:
        req - The solr request.
        Returns:
        The analysis result as a named list.
        Throws:
        Exception - When analysis fails.
      • analyzeValue

        protected org.apache.solr.common.util.NamedList<? extends Object> analyzeValue​(String value,
                                                                                       AnalysisRequestHandlerBase.AnalysisContext context)
        Analyzes the given value using the given Analyzer.
        Parameters:
        value - Value to analyze
        context - The analysis context.
        Returns:
        NamedList containing the tokens produced by analyzing the given value
      • getQueryTokenSet

        protected Set<org.apache.lucene.util.BytesRef> getQueryTokenSet​(String query,
                                                                        org.apache.lucene.analysis.Analyzer analyzer)
        Analyzes the given text using the given analyzer and returns the produced tokens.
        Parameters:
        query - The query to analyze.
        analyzer - The analyzer to use.