#26097: Adapt version check for the new query option: auto_generate_synonyms_phrase_query

This commit is contained in:
Jim Ferenczi 2017-08-09 13:19:08 +02:00
parent b22147854b
commit 15598f2174
4 changed files with 8 additions and 8 deletions

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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());
}
}