Module io.ebean.api

Class TextQueryString

java.lang.Object
io.ebean.search.TextQueryString

public class TextQueryString extends Object
Text query string options.

This maps to an ElasticSearch "query string query".



  TextQueryString options = new TextQueryString()
       .analyzeWildcard(true)
       .fields("name")
       .lenient(true)
       .opAnd();

   List<Customer> customers = database.find(Customer.class)
       .text()
       .textSimple("quick brown", options)
       .findList();

 


  // just use default options
  TextQueryString options = new TextQueryString();

   List<Customer> customers = database.find(Customer.class)
       .text()
       .textSimple("quick brown", options)
       .findList();

 
  • Field Details

    • DEFAULT_FUZZY_MAX_EXPANSIONS

      public static final int DEFAULT_FUZZY_MAX_EXPANSIONS
      See Also:
    • fields

      protected final String[] fields
    • useDisMax

      protected boolean useDisMax
      Only used when multiple fields set.
    • tieBreaker

      protected double tieBreaker
      Only used when multiple fields set.
    • defaultField

      protected String defaultField
    • operatorAnd

      protected boolean operatorAnd
    • analyzer

      protected String analyzer
    • allowLeadingWildcard

      protected boolean allowLeadingWildcard
    • lowercaseExpandedTerms

      protected boolean lowercaseExpandedTerms
    • fuzzyMaxExpansions

      protected int fuzzyMaxExpansions
    • fuzziness

      protected String fuzziness
    • fuzzyPrefixLength

      protected int fuzzyPrefixLength
    • phraseSlop

      protected double phraseSlop
    • boost

      protected double boost
    • analyzeWildcard

      protected boolean analyzeWildcard
    • autoGeneratePhraseQueries

      protected boolean autoGeneratePhraseQueries
    • minShouldMatch

      protected String minShouldMatch
    • lenient

      protected boolean lenient
    • locale

      protected String locale
    • timeZone

      protected String timeZone
    • rewrite

      protected String rewrite
  • Constructor Details

    • TextQueryString

      public TextQueryString(String... fields)
      Construct with the fields to use.
  • Method Details

    • fields

      public static TextQueryString fields(String... fields)
      Create with given fields.
    • opAnd

      public TextQueryString opAnd()
      Use the AND operator (rather than OR).
    • opOr

      public TextQueryString opOr()
      Use the OR operator (rather than AND).
    • locale

      public TextQueryString locale(String locale)
      Set the locale.
    • lenient

      public TextQueryString lenient(boolean lenient)
      Set lenient mode.
    • minShouldMatch

      public TextQueryString minShouldMatch(String minShouldMatch)
      Set the minimum should match.
    • analyzer

      public TextQueryString analyzer(String analyzer)
      Set the analyzer.
    • useDisMax

      public TextQueryString useDisMax(boolean useDisMax)
      Set useDisMax option (when multiple fields only).
    • tieBreaker

      public TextQueryString tieBreaker(double tieBreaker)
      Set tieBreaker option (when multiple fields only).
    • defaultField

      public TextQueryString defaultField(String defaultField)
      Set the default field.
    • allowLeadingWildcard

      public TextQueryString allowLeadingWildcard(boolean allowLeadingWildcard)
      Set allow leading wildcard mode.
    • lowercaseExpandedTerms

      public TextQueryString lowercaseExpandedTerms(boolean lowercaseExpandedTerms)
      Set lowercase expanded terms mode.
    • fuzzyMaxExpansions

      public TextQueryString fuzzyMaxExpansions(int fuzzyMaxExpansions)
      Set fuzzy max expansions.
    • fuzziness

      public TextQueryString fuzziness(String fuzziness)
      Set fuzziness.
    • fuzzyPrefixLength

      public TextQueryString fuzzyPrefixLength(int fuzzyPrefixLength)
      Set the fuzzy prefix length.
    • phraseSlop

      public TextQueryString phraseSlop(double phraseSlop)
      Set the phrase slop.
    • boost

      public TextQueryString boost(double boost)
      Set the boost.
    • analyzeWildcard

      public TextQueryString analyzeWildcard(boolean analyzeWildcard)
      Set the analyze wildcard mode.
    • autoGeneratePhraseQueries

      public TextQueryString autoGeneratePhraseQueries(boolean autoGeneratePhraseQueries)
      Set the auto generate phrase queries mode.
    • timeZone

      public TextQueryString timeZone(String timeZone)
      Set the time zone.
    • rewrite

      public TextQueryString rewrite(String rewrite)
      Set the rewrite option.
    • getRewrite

      public String getRewrite()
      Return the rewrite option.
    • getFields

      public String[] getFields()
      Return the fields.
    • isOperatorAnd

      public boolean isOperatorAnd()
      Return true if AND is the default operator.
    • getAnalyzer

      public String getAnalyzer()
      Return the analyzer.
    • getLocale

      public String getLocale()
      Return the locale.
    • isLenient

      public boolean isLenient()
      Return lenient mode.
    • getMinShouldMatch

      public String getMinShouldMatch()
      Return the minimum should match.
    • isUseDisMax

      public boolean isUseDisMax()
      Return the useDixMax mode.
    • getTieBreaker

      public double getTieBreaker()
      Return the tie breaker.
    • getDefaultField

      public String getDefaultField()
      Return the default field.
    • isAllowLeadingWildcard

      public boolean isAllowLeadingWildcard()
      Return the allow leading wildcard mode.
    • isLowercaseExpandedTerms

      public boolean isLowercaseExpandedTerms()
      Return the lowercase expanded terms mode.
    • getFuzzyMaxExpansions

      public int getFuzzyMaxExpansions()
      Return the fuzzy max expansions.
    • getFuzziness

      public String getFuzziness()
      Return the fuzziness.
    • getFuzzyPrefixLength

      public int getFuzzyPrefixLength()
      Return the fuzzy prefix length.
    • getPhraseSlop

      public double getPhraseSlop()
      Return the phrase slop.
    • isAnalyzeWildcard

      public boolean isAnalyzeWildcard()
      Return the analyze wildcard mode.
    • getBoost

      public double getBoost()
      Return the boost.
    • isAutoGeneratePhraseQueries

      public boolean isAutoGeneratePhraseQueries()
      Return the auto generate phase queries mode.
    • getTimeZone

      public String getTimeZone()
      Return the time zone.