Java api: add missing rewrite parameter to FuzzyQueryBuilder
We parse the rewrite field in FuzzyQueryParser but we don't allow to set it via FuzzyQueryBuilder for our java api users. Added missing field and setter. Closes #11130 Closes #11139
This commit is contained in:
parent
491b00c4ec
commit
d2765a2e26
|
@ -46,6 +46,8 @@ public class FuzzyQueryBuilder extends BaseQueryBuilder implements MultiTermQuer
|
|||
//LUCENE 4 UPGRADE we need a testcase for this + documentation
|
||||
private Boolean transpositions;
|
||||
|
||||
private String rewrite;
|
||||
|
||||
private String queryName;
|
||||
|
||||
/**
|
||||
|
@ -89,6 +91,11 @@ public class FuzzyQueryBuilder extends BaseQueryBuilder implements MultiTermQuer
|
|||
return this;
|
||||
}
|
||||
|
||||
public FuzzyQueryBuilder rewrite(String rewrite) {
|
||||
this.rewrite = rewrite;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the query name for the filter that can be used when searching for matched_filters per hit.
|
||||
*/
|
||||
|
@ -120,6 +127,9 @@ public class FuzzyQueryBuilder extends BaseQueryBuilder implements MultiTermQuer
|
|||
if (maxExpansions != null) {
|
||||
builder.field("max_expansions", maxExpansions);
|
||||
}
|
||||
if (rewrite != null) {
|
||||
builder.field("rewrite", rewrite);
|
||||
}
|
||||
if (queryName != null) {
|
||||
builder.field("_name", queryName);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue