Skip to content

Commit

Permalink
wrap up for 2.17
Browse files Browse the repository at this point in the history
Signed-off-by: bowenlan-amzn <[email protected]>
  • Loading branch information
bowenlan-amzn committed Aug 2, 2024
1 parent b18b44e commit 51e8b08
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 24 deletions.
1 change: 1 addition & 0 deletions .ci/bwcVersions
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ BWC_VERSION:
- "2.15.0"
- "2.15.1"
- "2.16.0"
- "2.17.0"
1 change: 1 addition & 0 deletions libs/core/src/main/java/org/opensearch/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public class Version implements Comparable<Version>, ToXContentFragment {
public static final Version V_2_15_0 = new Version(2150099, org.apache.lucene.util.Version.LUCENE_9_10_0);
public static final Version V_2_15_1 = new Version(2150199, org.apache.lucene.util.Version.LUCENE_9_10_0);
public static final Version V_2_16_0 = new Version(2160099, org.apache.lucene.util.Version.LUCENE_9_11_1);
public static final Version V_2_17_0 = new Version(2170099, org.apache.lucene.util.Version.LUCENE_9_11_1);
public static final Version V_3_0_0 = new Version(3000099, org.apache.lucene.util.Version.LUCENE_9_12_0);
public static final Version CURRENT = V_3_0_0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,7 @@ public TermsQueryBuilder(StreamInput in) throws IOException {
termsLookup = in.readOptionalWriteable(TermsLookup::new);
values = (List<?>) in.readGenericValue();
this.supplier = null;
// TODO change all V_2_16_0 to V_2_17_0
if (in.getVersion().onOrAfter(Version.V_2_16_0)) {
if (in.getVersion().onOrAfter(Version.V_2_17_0)) {
valueType = in.readEnum(ValueType.class);
}
}
Expand All @@ -260,7 +259,7 @@ protected void doWriteTo(StreamOutput out) throws IOException {
out.writeString(fieldName);
out.writeOptionalWriteable(termsLookup);
out.writeGenericValue(values);
if (out.getVersion().onOrAfter(Version.V_2_16_0)) {
if (out.getVersion().onOrAfter(Version.V_2_17_0)) {
out.writeEnum(valueType);
}
}
Expand Down
4 changes: 2 additions & 2 deletions server/src/main/java/org/opensearch/indices/TermsLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public TermsLookup(StreamInput in) throws IOException {
path = in.readString();
index = in.readString();
routing = in.readOptionalString();
if (in.getVersion().onOrAfter(Version.V_2_16_0)) {
if (in.getVersion().onOrAfter(Version.V_2_17_0)) {
store = in.readBoolean();
}
}
Expand All @@ -101,7 +101,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeString(path);
out.writeString(index);
out.writeOptionalString(routing);
if (out.getVersion().onOrAfter(Version.V_2_16_0)) {
if (out.getVersion().onOrAfter(Version.V_2_17_0)) {
out.writeBoolean(store);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,23 +449,4 @@ public void testTermsLookupBitmap() throws IOException {
Query luceneQuery = rewritten.toQuery(context);
assertTrue(luceneQuery instanceof IndexOrDocValuesQuery);
}

// public void testTermsLookupBitmapFail() throws IOException {
// RoaringBitmap bitmap = new RoaringBitmap();
// bitmap.add(111);
// bitmap.add(333);
// byte[] array = new byte[bitmap.serializedSizeInBytes()];
// bitmap.serialize(ByteBuffer.wrap(array));
// randomTerms = List.of(new BytesArray(array), new BytesArray(array)); // this will be fetched back by terms lookup
//
// TermsQueryBuilder query = new TermsQueryBuilder(INT_FIELD_NAME, randomTermsLookup().store(true)).valueType(
// TermsQueryBuilder.ValueType.BITMAP
// );
// QueryShardContext context = createShardContext();
// IllegalArgumentException e = expectThrows(
// IllegalArgumentException.class,
// () -> rewriteQuery(query, new QueryShardContext(context))
// );
// assertEquals("Invalid value for bitmap type: Expected a single base64 encoded serialized bitmap.", e.getMessage());
// }
}

0 comments on commit 51e8b08

Please sign in to comment.