public class TextQueryString extends Object
This maps to an ElasticSearch "query string query".
TextQueryString options = new TextQueryString()
.analyzeWildcard(true)
.fields("name")
.lenient(true)
.opAnd();
List<Customer> customers = server.find(Customer.class)
.text()
.textSimple("quick brown", options)
.findList();
// just use default options
TextQueryString options = new TextQueryString();
List<Customer> customers = server.find(Customer.class)
.text()
.textSimple("quick brown", options)
.findList();
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowLeadingWildcard |
protected String |
analyzer |
protected boolean |
analyzeWildcard |
protected boolean |
autoGeneratePhraseQueries |
protected double |
boost |
static int |
DEFAULT_FUZZY_MAX_EXPANSIONS |
static int |
DEFAULT_MAX_DETERMINIZED_STATES |
protected String |
defaultField |
protected boolean |
enablePositionIncrements |
protected String[] |
fields |
protected String |
fuzziness |
protected int |
fuzzyMaxExpansions |
protected int |
fuzzyPrefixLength |
protected boolean |
lenient |
protected String |
locale |
protected boolean |
lowercaseExpandedTerms |
protected int |
maxDeterminizedStates |
protected String |
minShouldMatch |
protected boolean |
operatorAnd |
protected double |
phraseSlop |
protected String |
rewrite |
protected double |
tieBreaker
Only used when multiple fields set.
|
protected String |
timeZone |
protected boolean |
useDisMax
Only used when multiple fields set.
|
| Constructor and Description |
|---|
TextQueryString(String... fields)
Construct with the fields to use.
|
| Modifier and Type | Method and Description |
|---|---|
TextQueryString |
allowLeadingWildcard(boolean allowLeadingWildcard)
Set allow leading wildcard mode.
|
TextQueryString |
analyzer(String analyzer)
Set the analyzer.
|
TextQueryString |
analyzeWildcard(boolean analyzeWildcard)
Set the analyze wildcard mode.
|
TextQueryString |
autoGeneratePhraseQueries(boolean autoGeneratePhraseQueries)
Set the auto generate phrase queries mode.
|
TextQueryString |
boost(double boost)
Set the boost.
|
TextQueryString |
defaultField(String defaultField)
Set the default field.
|
TextQueryString |
enablePositionIncrements(boolean enablePositionIncrements)
Set enable position increments mode.
|
static TextQueryString |
fields(String... fields)
Create with given fields.
|
TextQueryString |
fuzziness(String fuzziness)
Set fuzziness.
|
TextQueryString |
fuzzyMaxExpansions(int fuzzyMaxExpansions)
Set fuzzy max expansions.
|
TextQueryString |
fuzzyPrefixLength(int fuzzyPrefixLength)
Set the fuzzy prefix length.
|
String |
getAnalyzer()
Return the analyzer.
|
double |
getBoost()
Return the boost.
|
String |
getDefaultField()
Return the default field.
|
String[] |
getFields()
Return the fields.
|
String |
getFuzziness()
Return the fuzziness.
|
int |
getFuzzyMaxExpansions()
Return the fuzzy max expansions.
|
int |
getFuzzyPrefixLength()
Return the fuzzy prefix length.
|
String |
getLocale()
Return the locale.
|
int |
getMaxDeterminizedStates()
Return the max determinized states.
|
String |
getMinShouldMatch()
Return the minimum should match.
|
double |
getPhraseSlop()
Return the phrase slop.
|
String |
getRewrite()
Return the rewrite option.
|
double |
getTieBreaker()
Return the tie breaker.
|
String |
getTimeZone()
Return the time zone.
|
boolean |
isAllowLeadingWildcard()
Return the allow leading wildcard mode.
|
boolean |
isAnalyzeWildcard()
Return the analyze wildcard mode.
|
boolean |
isAutoGeneratePhraseQueries()
Return the auto generate phase queries mode.
|
boolean |
isEnablePositionIncrements()
Return the enable position increments mode.
|
boolean |
isLenient()
Return lenient mode.
|
boolean |
isLowercaseExpandedTerms()
Return the lowercase expanded terms mode.
|
boolean |
isOperatorAnd()
Return true if AND is the default operator.
|
boolean |
isUseDisMax()
Return the useDixMax mode.
|
TextQueryString |
lenient(boolean lenient)
Set lenient mode.
|
TextQueryString |
locale(String locale)
Set the locale.
|
TextQueryString |
lowercaseExpandedTerms(boolean lowercaseExpandedTerms)
Set lowercase expanded terms mode.
|
TextQueryString |
maxDeterminizedStates(int maxDeterminizedStates)
Set the max determinized states.
|
TextQueryString |
minShouldMatch(String minShouldMatch)
Set the minimum should match.
|
TextQueryString |
opAnd()
Use the AND operator (rather than OR).
|
TextQueryString |
opOr()
Use the OR operator (rather than AND).
|
TextQueryString |
phraseSlop(double phraseSlop)
Set the phrase slop.
|
TextQueryString |
rewrite(String rewrite)
Set the rewrite option.
|
TextQueryString |
tieBreaker(double tieBreaker)
Set tieBreaker option (when multiple fields only).
|
TextQueryString |
timeZone(String timeZone)
Set the time zone.
|
TextQueryString |
useDisMax(boolean useDisMax)
Set useDisMax option (when multiple fields only).
|
public static final int DEFAULT_FUZZY_MAX_EXPANSIONS
public static final int DEFAULT_MAX_DETERMINIZED_STATES
protected boolean useDisMax
protected double tieBreaker
protected String defaultField
protected boolean operatorAnd
protected boolean allowLeadingWildcard
protected boolean lowercaseExpandedTerms
protected boolean enablePositionIncrements
protected int fuzzyMaxExpansions
protected int fuzzyPrefixLength
protected double phraseSlop
protected double boost
protected boolean analyzeWildcard
protected boolean autoGeneratePhraseQueries
protected int maxDeterminizedStates
protected String minShouldMatch
protected boolean lenient
public TextQueryString(String... fields)
public static TextQueryString fields(String... fields)
public TextQueryString opAnd()
public TextQueryString opOr()
public TextQueryString locale(String locale)
public TextQueryString lenient(boolean lenient)
public TextQueryString minShouldMatch(String minShouldMatch)
public TextQueryString analyzer(String analyzer)
public TextQueryString useDisMax(boolean useDisMax)
public TextQueryString tieBreaker(double tieBreaker)
public TextQueryString defaultField(String defaultField)
public TextQueryString allowLeadingWildcard(boolean allowLeadingWildcard)
public TextQueryString lowercaseExpandedTerms(boolean lowercaseExpandedTerms)
public TextQueryString enablePositionIncrements(boolean enablePositionIncrements)
public TextQueryString fuzzyMaxExpansions(int fuzzyMaxExpansions)
public TextQueryString fuzziness(String fuzziness)
public TextQueryString fuzzyPrefixLength(int fuzzyPrefixLength)
public TextQueryString phraseSlop(double phraseSlop)
public TextQueryString boost(double boost)
public TextQueryString analyzeWildcard(boolean analyzeWildcard)
public TextQueryString autoGeneratePhraseQueries(boolean autoGeneratePhraseQueries)
public TextQueryString maxDeterminizedStates(int maxDeterminizedStates)
public TextQueryString timeZone(String timeZone)
public TextQueryString rewrite(String rewrite)
public String getRewrite()
public boolean isOperatorAnd()
public String getAnalyzer()
public boolean isLenient()
public String getMinShouldMatch()
public boolean isUseDisMax()
public double getTieBreaker()
public String getDefaultField()
public boolean isAllowLeadingWildcard()
public boolean isLowercaseExpandedTerms()
public boolean isEnablePositionIncrements()
public int getFuzzyMaxExpansions()
public String getFuzziness()
public int getFuzzyPrefixLength()
public double getPhraseSlop()
public boolean isAnalyzeWildcard()
public double getBoost()
public boolean isAutoGeneratePhraseQueries()
public int getMaxDeterminizedStates()
public String getTimeZone()
Copyright © 2016. All rights reserved.