Class ScriptTermStats

java.lang.Object
org.elasticsearch.script.ScriptTermStats

public class ScriptTermStats extends Object
Access the term statistics of the children query of a script_score query.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final NodeFeature
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ScriptTermStats(org.apache.lucene.search.IndexSearcher searcher, org.apache.lucene.index.LeafReaderContext leafReaderContext, IntSupplier docIdSupplier, Set<org.apache.lucene.index.Term> terms)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Collect docFreq (number of documents a term occurs in) for the terms of the query and returns statistics for them.
    int
    Number of terms that are matched im the query.
    Collect totalFreq (number of occurrence of a term in the current doc for the terms of the query and returns statistics for them.
    Collect termPositions (positions of a term in the current document) for the terms of the query and returns statistics for them.
    Collect totalTermFreq (total number of occurrence of a term in the index) for the terms of the query and returns statistics for them.
    int
    Number of unique terms in the query.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TERM_STAT_FEATURE

      public static final NodeFeature TERM_STAT_FEATURE
  • Constructor Details

    • ScriptTermStats

      public ScriptTermStats(org.apache.lucene.search.IndexSearcher searcher, org.apache.lucene.index.LeafReaderContext leafReaderContext, IntSupplier docIdSupplier, Set<org.apache.lucene.index.Term> terms)
  • Method Details

    • uniqueTermsCount

      public int uniqueTermsCount()
      Number of unique terms in the query.
      Returns:
      the number of unique terms
    • matchedTermsCount

      public int matchedTermsCount()
      Number of terms that are matched im the query.
      Returns:
      the number of matched terms
    • docFreq

      public StatsSummary docFreq()
      Collect docFreq (number of documents a term occurs in) for the terms of the query and returns statistics for them.
      Returns:
      statistics on docFreq for the terms of the query.
    • totalTermFreq

      public StatsSummary totalTermFreq()
      Collect totalTermFreq (total number of occurrence of a term in the index) for the terms of the query and returns statistics for them.
      Returns:
      statistics on totalTermFreq for the terms of the query.
    • termFreq

      public StatsSummary termFreq()
      Collect totalFreq (number of occurrence of a term in the current doc for the terms of the query and returns statistics for them.
      Returns:
      statistics on totalTermFreq for the terms of the query in the current dac
    • termPositions

      public StatsSummary termPositions()
      Collect termPositions (positions of a term in the current document) for the terms of the query and returns statistics for them.
      Returns:
      statistics on termPositions for the terms of the query in the current dac