public class TextCommonTerms extends Object
This maps to an ElasticSearch "common terms query".
TextCommonTerms options = new TextCommonTerms()
.cutoffFrequency(0.001)
.minShouldMatch("50%")
.lowFreqOperatorAnd(true)
.highFreqOperatorAnd(true);
List<Customer> customers = server.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%"
}
}
Constructor and Description |
---|
TextCommonTerms() |
Modifier and Type | Method and Description |
---|---|
TextCommonTerms |
cutoffFrequency(double cutoffFrequency)
Set the cutoff frequency.
|
double |
getCutoffFrequency()
Return the cutoff frequency.
|
String |
getMinShouldMatch()
Return the minimum to match.
|
String |
getMinShouldMatchHighFreq()
Return the minimum to match for high frequency.
|
String |
getMinShouldMatchLowFreq()
Return the minimum to match for low frequency.
|
TextCommonTerms |
highFreqOperatorAnd(boolean opAnd)
Set to true if high frequency terms should use AND operator.
|
boolean |
isHighFreqOperatorAnd()
Return true if high freq should use the AND operator.
|
boolean |
isLowFreqOperatorAnd()
Return true if low freq should use the AND operator.
|
TextCommonTerms |
lowFreqOperatorAnd(boolean opAnd)
Set to true if low frequency terms should use AND operator.
|
TextCommonTerms |
minShouldMatch(String minShouldMatch)
Set the minimum should match.
|
TextCommonTerms |
minShouldMatchHighFreq(String minShouldMatchHighFreq)
Set the minimum should match for high frequency terms.
|
TextCommonTerms |
minShouldMatchLowFreq(String minShouldMatchLowFreq)
Set the minimum should match for low frequency terms.
|
public TextCommonTerms()
public TextCommonTerms cutoffFrequency(double cutoffFrequency)
public TextCommonTerms lowFreqOperatorAnd(boolean opAnd)
public TextCommonTerms highFreqOperatorAnd(boolean opAnd)
public TextCommonTerms minShouldMatch(String minShouldMatch)
public TextCommonTerms minShouldMatchLowFreq(String minShouldMatchLowFreq)
public TextCommonTerms minShouldMatchHighFreq(String minShouldMatchHighFreq)
public boolean isLowFreqOperatorAnd()
public boolean isHighFreqOperatorAnd()
public double getCutoffFrequency()
public String getMinShouldMatch()
public String getMinShouldMatchHighFreq()
public String getMinShouldMatchLowFreq()
Copyright © 2019. All rights reserved.