Add missing TextQueryBuilder and FuzzyQueryBuilder properties
This commit is contained in:
parent
783649adc7
commit
22b2aa69d1
|
@ -40,6 +40,8 @@ public class FuzzyQueryBuilder extends BaseQueryBuilder {
|
||||||
|
|
||||||
private Integer prefixLength;
|
private Integer prefixLength;
|
||||||
|
|
||||||
|
private Integer maxExpansions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new term query.
|
* Constructs a new term query.
|
||||||
*
|
*
|
||||||
|
@ -75,6 +77,11 @@ public class FuzzyQueryBuilder extends BaseQueryBuilder {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FuzzyQueryBuilder maxExpansions(int maxExpansions) {
|
||||||
|
this.maxExpansions = maxExpansions;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doXContent(XContentBuilder builder, Params params) throws IOException {
|
public void doXContent(XContentBuilder builder, Params params) throws IOException {
|
||||||
builder.startObject(FuzzyQueryParser.NAME);
|
builder.startObject(FuzzyQueryParser.NAME);
|
||||||
|
@ -92,6 +99,9 @@ public class FuzzyQueryBuilder extends BaseQueryBuilder {
|
||||||
if (prefixLength != null) {
|
if (prefixLength != null) {
|
||||||
builder.field("prefix_length", prefixLength);
|
builder.field("prefix_length", prefixLength);
|
||||||
}
|
}
|
||||||
|
if (maxExpansions != null) {
|
||||||
|
builder.field("max_expansions", maxExpansions);
|
||||||
|
}
|
||||||
builder.endObject();
|
builder.endObject();
|
||||||
}
|
}
|
||||||
builder.endObject();
|
builder.endObject();
|
||||||
|
|
|
@ -126,6 +126,11 @@ public class TextQueryBuilder extends BaseQueryBuilder {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TextQueryBuilder prefixLength(int prefixLength) {
|
||||||
|
this.prefixLength = prefixLength;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When using fuzzy or prefix type query, the number of term expansions to use. Defaults to unbounded
|
* When using fuzzy or prefix type query, the number of term expansions to use. Defaults to unbounded
|
||||||
* so its recommended to set it to a reasonable value for faster execution.
|
* so its recommended to set it to a reasonable value for faster execution.
|
||||||
|
|
Loading…
Reference in New Issue