Module io.ebean.api

Class TextCommonTerms


public class TextCommonTerms extends Object
Text common terms query.

This maps to an ElasticSearch "common terms query".

  TextCommonTerms options = new TextCommonTerms()

  List<Customer> customers = database.find(Customer.class)
    .textCommonTerms("the brown", options)


   // ElasticSearch expression

   "common": {
     "body": {
       "query": "the brown",
       "cutoff_frequency": 0.001,
       "low_freq_operator": "and",
       "high_freq_operator": "and",
       "minimum_should_match": "50%"

  • Field Details

    • cutoffFrequency

      protected double cutoffFrequency
    • lowFreqOperatorAnd

      protected boolean lowFreqOperatorAnd
    • highFreqOperatorAnd

      protected boolean highFreqOperatorAnd
    • minShouldMatch

      protected String minShouldMatch
    • minShouldMatchLowFreq

      protected String minShouldMatchLowFreq
    • minShouldMatchHighFreq

      protected String minShouldMatchHighFreq
  • Constructor Details

    • TextCommonTerms

      public TextCommonTerms()
  • Method Details

    • cutoffFrequency

      public TextCommonTerms cutoffFrequency(double cutoffFrequency)
      Set the cutoff frequency.
    • lowFreqOperatorAnd

      public TextCommonTerms lowFreqOperatorAnd(boolean opAnd)
      Set to true if low frequency terms should use AND operator.
    • highFreqOperatorAnd

      public TextCommonTerms highFreqOperatorAnd(boolean opAnd)
      Set to true if high frequency terms should use AND operator.
    • minShouldMatch

      public TextCommonTerms minShouldMatch(String minShouldMatch)
      Set the minimum should match.
    • minShouldMatchLowFreq

      public TextCommonTerms minShouldMatchLowFreq(String minShouldMatchLowFreq)
      Set the minimum should match for low frequency terms.
    • minShouldMatchHighFreq

      public TextCommonTerms minShouldMatchHighFreq(String minShouldMatchHighFreq)
      Set the minimum should match for high frequency terms.
    • isLowFreqOperatorAnd

      public boolean isLowFreqOperatorAnd()
      Return true if low freq should use the AND operator.
    • isHighFreqOperatorAnd

      public boolean isHighFreqOperatorAnd()
      Return true if high freq should use the AND operator.
    • getCutoffFrequency

      public double getCutoffFrequency()
      Return the cutoff frequency.
    • getMinShouldMatch

      public String getMinShouldMatch()
      Return the minimum to match.
    • getMinShouldMatchHighFreq

      public String getMinShouldMatchHighFreq()
      Return the minimum to match for high frequency.
    • getMinShouldMatchLowFreq

      public String getMinShouldMatchLowFreq()
      Return the minimum to match for low frequency.