Class BasicStats

java.lang.Object
org.apache.lucene.search.similarities.BasicStats
Direct Known Subclasses:
LMSimilarity.LMStats

public class BasicStats extends Object
Stores all statistics commonly used ranking methods.
WARNING: This API is experimental and might change in incompatible ways in the next release.
  • Field Details

    • numberOfDocuments

      protected long numberOfDocuments
      The number of documents.
    • numberOfFieldTokens

      protected long numberOfFieldTokens
      The total number of tokens in the field.
    • avgFieldLength

      protected double avgFieldLength
      The average field length.
    • docFreq

      protected long docFreq
      The document frequency.
    • totalTermFreq

      protected long totalTermFreq
      The total number of occurrences of this term across all documents.
    • boost

      protected final double boost
      A query boost. Should be applied as a multiplicative factor to the score.
  • Constructor Details

    • BasicStats

      public BasicStats(String field, double boost)
      Constructor.
  • Method Details

    • getNumberOfDocuments

      public long getNumberOfDocuments()
      Returns the number of documents.
    • setNumberOfDocuments

      public void setNumberOfDocuments(long numberOfDocuments)
      Sets the number of documents.
    • getNumberOfFieldTokens

      public long getNumberOfFieldTokens()
      Returns the total number of tokens in the field.
      See Also:
    • setNumberOfFieldTokens

      public void setNumberOfFieldTokens(long numberOfFieldTokens)
      Sets the total number of tokens in the field.
      See Also:
    • getAvgFieldLength

      public double getAvgFieldLength()
      Returns the average field length.
    • setAvgFieldLength

      public void setAvgFieldLength(double avgFieldLength)
      Sets the average field length.
    • getDocFreq

      public long getDocFreq()
      Returns the document frequency.
    • setDocFreq

      public void setDocFreq(long docFreq)
      Sets the document frequency.
    • getTotalTermFreq

      public long getTotalTermFreq()
      Returns the total number of occurrences of this term across all documents.
    • setTotalTermFreq

      public void setTotalTermFreq(long totalTermFreq)
      Sets the total number of occurrences of this term across all documents.
    • getBoost

      public double getBoost()
      Returns the total boost.