Skip to content

Commit

Permalink
Update the minimum version check on SearchExtBuilder support in Searc…
Browse files Browse the repository at this point in the history
…hResponse (Issue # 9328) (opensearch-project#9641)

Signed-off-by: Austin Lee <austin@aryn.ai>
Signed-off-by: Ivan Brusic <ivan.brusic@flocksafety.com>
  • Loading branch information
austintlee authored and brusic committed Sep 25, 2023
1 parent 3571ccf commit 9042ac5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ public void writeTo(StreamOutput out) throws IOException {
}

private static List<SearchExtBuilder> readSearchExtBuildersOnOrAfter(StreamInput in) throws IOException {
return (in.getVersion().onOrAfter(Version.V_3_0_0)) ? in.readNamedWriteableList(SearchExtBuilder.class) : Collections.emptyList();
return (in.getVersion().onOrAfter(Version.V_2_10_0)) ? in.readNamedWriteableList(SearchExtBuilder.class) : Collections.emptyList();
}

private static void writeSearchExtBuildersOnOrAfter(StreamOutput out, List<SearchExtBuilder> searchExtBuilders) throws IOException {
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_10_0)) {
out.writeNamedWriteableList(searchExtBuilders);
}
}
Expand Down

0 comments on commit 9042ac5

Please sign in to comment.