#26097: Adapt version check for the new query option: auto_generate_synonyms_phrase_query
This commit is contained in:
parent
b22147854b
commit
15598f2174
|
@ -137,7 +137,7 @@ public class MatchQueryBuilder extends AbstractQueryBuilder<MatchQueryBuilder> {
|
|||
fuzzyRewrite = in.readOptionalString();
|
||||
fuzziness = in.readOptionalWriteable(Fuzziness::new);
|
||||
cutoffFrequency = in.readOptionalFloat();
|
||||
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
||||
if (in.getVersion().onOrAfter(Version.V_6_1_0)) {
|
||||
autoGenerateSynonymsPhraseQuery = in.readBoolean();
|
||||
}
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ public class MatchQueryBuilder extends AbstractQueryBuilder<MatchQueryBuilder> {
|
|||
out.writeOptionalString(fuzzyRewrite);
|
||||
out.writeOptionalWriteable(fuzziness);
|
||||
out.writeOptionalFloat(cutoffFrequency);
|
||||
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
||||
if (out.getVersion().onOrAfter(Version.V_6_1_0)) {
|
||||
out.writeBoolean(autoGenerateSynonymsPhraseQuery);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@ public class MultiMatchQueryBuilder extends AbstractQueryBuilder<MultiMatchQuery
|
|||
lenient = in.readBoolean();
|
||||
cutoffFrequency = in.readOptionalFloat();
|
||||
zeroTermsQuery = MatchQuery.ZeroTermsQuery.readFromStream(in);
|
||||
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
||||
if (in.getVersion().onOrAfter(Version.V_6_1_0)) {
|
||||
autoGenerateSynonymsPhraseQuery = in.readBoolean();
|
||||
}
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ public class MultiMatchQueryBuilder extends AbstractQueryBuilder<MultiMatchQuery
|
|||
out.writeBoolean(lenient);
|
||||
out.writeOptionalFloat(cutoffFrequency);
|
||||
zeroTermsQuery.writeTo(out);
|
||||
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
||||
if (out.getVersion().onOrAfter(Version.V_6_1_0)) {
|
||||
out.writeBoolean(autoGenerateSynonymsPhraseQuery);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -222,7 +222,7 @@ public class QueryStringQueryBuilder extends AbstractQueryBuilder<QueryStringQue
|
|||
}
|
||||
}
|
||||
}
|
||||
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
||||
if (in.getVersion().onOrAfter(Version.V_6_1_0)) {
|
||||
autoGenerateSynonymsPhraseQuery = in.readBoolean();
|
||||
}
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ public class QueryStringQueryBuilder extends AbstractQueryBuilder<QueryStringQue
|
|||
out.writeOptionalBoolean(useAllFields);
|
||||
}
|
||||
}
|
||||
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
||||
if (out.getVersion().onOrAfter(Version.V_6_1_0)) {
|
||||
out.writeBoolean(autoGenerateSynonymsPhraseQuery);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ public class SimpleQueryStringBuilder extends AbstractQueryBuilder<SimpleQuerySt
|
|||
settings.quoteFieldSuffix(in.readOptionalString());
|
||||
useAllFields = in.readOptionalBoolean();
|
||||
}
|
||||
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
||||
if (in.getVersion().onOrAfter(Version.V_6_1_0)) {
|
||||
settings.autoGenerateSynonymsPhraseQuery(in.readBoolean());
|
||||
}
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ public class SimpleQueryStringBuilder extends AbstractQueryBuilder<SimpleQuerySt
|
|||
out.writeOptionalString(settings.quoteFieldSuffix());
|
||||
out.writeOptionalBoolean(useAllFields);
|
||||
}
|
||||
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
||||
if (out.getVersion().onOrAfter(Version.V_6_1_0)) {
|
||||
out.writeBoolean(settings.autoGenerateSynonymsPhraseQuery());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue