java.lang.Object
io.ebean.search.TextCommonTerms
Text common terms query.
This maps to an ElasticSearch "common terms query".
TextCommonTerms options = new TextCommonTerms()
.cutoffFrequency(0.001)
.minShouldMatch("50%")
.lowFreqOperatorAnd(true)
.highFreqOperatorAnd(true);
List<Customer> customers = database.find(Customer.class)
.text()
.textCommonTerms("the brown", options)
.findList();
// ElasticSearch expression
"common": {
"body": {
"query": "the brown",
"cutoff_frequency": 0.001,
"low_freq_operator": "and",
"high_freq_operator": "and",
"minimum_should_match": "50%"
}
}
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncutoffFrequency
(double cutoffFrequency) Set the cutoff frequency.double
Return the cutoff frequency.Return the minimum to match.Return the minimum to match for high frequency.Return the minimum to match for low frequency.highFreqOperatorAnd
(boolean opAnd) Set to true if high frequency terms should use AND operator.boolean
Return true if high freq should use the AND operator.boolean
Return true if low freq should use the AND operator.lowFreqOperatorAnd
(boolean opAnd) Set to true if low frequency terms should use AND operator.minShouldMatch
(String minShouldMatch) Set the minimum should match.minShouldMatchHighFreq
(String minShouldMatchHighFreq) Set the minimum should match for high frequency terms.minShouldMatchLowFreq
(String minShouldMatchLowFreq) Set the minimum should match for low frequency terms.
-
Field Details
-
cutoffFrequency
protected double cutoffFrequency -
lowFreqOperatorAnd
protected boolean lowFreqOperatorAnd -
highFreqOperatorAnd
protected boolean highFreqOperatorAnd -
minShouldMatch
-
minShouldMatchLowFreq
-
minShouldMatchHighFreq
-
-
Constructor Details
-
TextCommonTerms
public TextCommonTerms()
-
-
Method Details
-
cutoffFrequency
Set the cutoff frequency. -
lowFreqOperatorAnd
Set to true if low frequency terms should use AND operator. -
highFreqOperatorAnd
Set to true if high frequency terms should use AND operator. -
minShouldMatch
Set the minimum should match. -
minShouldMatchLowFreq
Set the minimum should match for low frequency terms. -
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
Return the minimum to match. -
getMinShouldMatchHighFreq
Return the minimum to match for high frequency. -
getMinShouldMatchLowFreq
Return the minimum to match for low frequency.
-