java.lang.Object
io.ebean.search.TextQueryString
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 Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Stringprotected booleanprotected booleanprotected doublestatic final intprotected Stringprotected final String[]protected Stringprotected intprotected intprotected booleanprotected Stringprotected booleanprotected Stringprotected booleanprotected doubleprotected Stringprotected doubleOnly used when multiple fields set.protected Stringprotected booleanOnly used when multiple fields set. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowLeadingWildcard(boolean allowLeadingWildcard) Set allow leading wildcard mode.Set the analyzer.analyzeWildcard(boolean analyzeWildcard) Set the analyze wildcard mode.autoGeneratePhraseQueries(boolean autoGeneratePhraseQueries) Set the auto generate phrase queries mode.boost(double boost) Set the boost.defaultField(String defaultField) Set the default field.static TextQueryStringCreate with given fields.Set fuzziness.fuzzyMaxExpansions(int fuzzyMaxExpansions) Set fuzzy max expansions.fuzzyPrefixLength(int fuzzyPrefixLength) Set the fuzzy prefix length.Return the analyzer.doublegetBoost()Return the boost.Return the default field.String[]Return the fields.Return the fuzziness.intReturn the fuzzy max expansions.intReturn the fuzzy prefix length.Return the locale.Return the minimum should match.doubleReturn the phrase slop.Return the rewrite option.doubleReturn the tie breaker.Return the time zone.booleanReturn the allow leading wildcard mode.booleanReturn the analyze wildcard mode.booleanReturn the auto generate phase queries mode.booleanReturn lenient mode.booleanReturn the lowercase expanded terms mode.booleanReturn true if AND is the default operator.booleanReturn the useDixMax mode.lenient(boolean lenient) Set lenient mode.Set the locale.lowercaseExpandedTerms(boolean lowercaseExpandedTerms) Set lowercase expanded terms mode.minShouldMatch(String minShouldMatch) Set the minimum should match.opAnd()Use the AND operator (rather than OR).opOr()Use the OR operator (rather than AND).phraseSlop(double phraseSlop) Set the phrase slop.Set the rewrite option.tieBreaker(double tieBreaker) Set tieBreaker option (when multiple fields only).Set the time zone.useDisMax(boolean useDisMax) Set useDisMax option (when multiple fields only).
-
Field Details
-
DEFAULT_FUZZY_MAX_EXPANSIONS
public static final int DEFAULT_FUZZY_MAX_EXPANSIONS- See Also:
-
fields
-
useDisMax
protected boolean useDisMaxOnly used when multiple fields set. -
tieBreaker
protected double tieBreakerOnly used when multiple fields set. -
defaultField
-
operatorAnd
protected boolean operatorAnd -
analyzer
-
allowLeadingWildcard
protected boolean allowLeadingWildcard -
lowercaseExpandedTerms
protected boolean lowercaseExpandedTerms -
fuzzyMaxExpansions
protected int fuzzyMaxExpansions -
fuzziness
-
fuzzyPrefixLength
protected int fuzzyPrefixLength -
phraseSlop
protected double phraseSlop -
boost
protected double boost -
analyzeWildcard
protected boolean analyzeWildcard -
autoGeneratePhraseQueries
protected boolean autoGeneratePhraseQueries -
minShouldMatch
-
lenient
protected boolean lenient -
locale
-
timeZone
-
rewrite
-
-
Constructor Details
-
TextQueryString
Construct with the fields to use.
-
-
Method Details
-
fields
Create with given fields. -
opAnd
Use the AND operator (rather than OR). -
opOr
Use the OR operator (rather than AND). -
locale
Set the locale. -
lenient
Set lenient mode. -
minShouldMatch
Set the minimum should match. -
analyzer
Set the analyzer. -
useDisMax
Set useDisMax option (when multiple fields only). -
tieBreaker
Set tieBreaker option (when multiple fields only). -
defaultField
Set the default field. -
allowLeadingWildcard
Set allow leading wildcard mode. -
lowercaseExpandedTerms
Set lowercase expanded terms mode. -
fuzzyMaxExpansions
Set fuzzy max expansions. -
fuzziness
Set fuzziness. -
fuzzyPrefixLength
Set the fuzzy prefix length. -
phraseSlop
Set the phrase slop. -
boost
Set the boost. -
analyzeWildcard
Set the analyze wildcard mode. -
autoGeneratePhraseQueries
Set the auto generate phrase queries mode. -
timeZone
Set the time zone. -
rewrite
Set the rewrite option. -
getRewrite
Return the rewrite option. -
getFields
Return the fields. -
isOperatorAnd
public boolean isOperatorAnd()Return true if AND is the default operator. -
getAnalyzer
Return the analyzer. -
getLocale
Return the locale. -
isLenient
public boolean isLenient()Return lenient mode. -
getMinShouldMatch
Return the minimum should match. -
isUseDisMax
public boolean isUseDisMax()Return the useDixMax mode. -
getTieBreaker
public double getTieBreaker()Return the tie breaker. -
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
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
Return the time zone.
-