Skip to content

Commit

Permalink
Bump to Lucene99 (#11421)
Browse files Browse the repository at this point in the history
Upgraded Lucene dependency to 9.9.1.

---------

Signed-off-by: Marc Handalian <[email protected]>
Signed-off-by: Marc Handalian <[email protected]>
  • Loading branch information
mch2 authored Jan 10, 2024
1 parent a9ce180 commit 4a42150
Show file tree
Hide file tree
Showing 96 changed files with 219 additions and 136 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Bump `com.maxmind.db:maxmind-db` from 3.0.0 to 3.1.0 ([#11693](https://github.com/opensearch-project/OpenSearch/pull/11693))
- Bump `net.java.dev.jna:jna` from 5.13.0 to 5.14.0 ([#11798](https://github.com/opensearch-project/OpenSearch/pull/11798))
- Bump `lycheeverse/lychee-action` from 1.8.0 to 1.9.0 ([#11795](https://github.com/opensearch-project/OpenSearch/pull/11795))
- Bump `Lucene` from 9.8.0 to 9.9.1 ([#11421](https://github.com/opensearch-project/OpenSearch/pull/11421))

### Changed
- Mute the query profile IT with concurrent execution ([#9840](https://github.com/opensearch-project/OpenSearch/pull/9840))
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/version.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opensearch = 3.0.0
lucene = 9.8.0
lucene = 9.9.1

bundled_jdk_vendor = adoptium
bundled_jdk = 21.0.1+12
Expand Down
1 change: 0 additions & 1 deletion libs/core/licenses/lucene-core-9.8.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions libs/core/licenses/lucene-core-9.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
55249fa9a0ed321adcf8283c6f3b649a6812b0a9
2 changes: 1 addition & 1 deletion libs/core/src/main/java/org/opensearch/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public class Version implements Comparable<Version>, ToXContentFragment {
public static final Version V_2_11_1 = new Version(2110199, org.apache.lucene.util.Version.LUCENE_9_7_0);
public static final Version V_2_11_2 = new Version(2110299, org.apache.lucene.util.Version.LUCENE_9_7_0);
public static final Version V_2_12_0 = new Version(2120099, org.apache.lucene.util.Version.LUCENE_9_8_0);
public static final Version V_3_0_0 = new Version(3000099, org.apache.lucene.util.Version.LUCENE_9_8_0);
public static final Version V_3_0_0 = new Version(3000099, org.apache.lucene.util.Version.LUCENE_9_9_1);
public static final Version CURRENT = V_3_0_0;

public static Version fromId(int id) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1782a69d0e83af9cc3c65db0dcd2e7e7c1e5f90e
Original file line number Diff line number Diff line change
Expand Up @@ -135,35 +135,40 @@ public void testRangeQuery() throws IOException {
public void testRoundsUpperBoundCorrectly() {
ScaledFloatFieldMapper.ScaledFloatFieldType ft = new ScaledFloatFieldMapper.ScaledFloatFieldType("scaled_float", 100);
Query scaledFloatQ = ft.rangeQuery(null, 0.1, true, false, MOCK_QSC);
assertEquals("scaled_float:[-9223372036854775808 TO 9]", scaledFloatQ.toString());
assertEquals("scaled_float:[-9223372036854775808 TO 9]", getQueryString(scaledFloatQ));
scaledFloatQ = ft.rangeQuery(null, 0.1, true, true, MOCK_QSC);
assertEquals("scaled_float:[-9223372036854775808 TO 10]", scaledFloatQ.toString());
assertEquals("scaled_float:[-9223372036854775808 TO 10]", getQueryString(scaledFloatQ));
scaledFloatQ = ft.rangeQuery(null, 0.095, true, false, MOCK_QSC);
assertEquals("scaled_float:[-9223372036854775808 TO 9]", scaledFloatQ.toString());
assertEquals("scaled_float:[-9223372036854775808 TO 9]", getQueryString(scaledFloatQ));
scaledFloatQ = ft.rangeQuery(null, 0.095, true, true, MOCK_QSC);
assertEquals("scaled_float:[-9223372036854775808 TO 9]", scaledFloatQ.toString());
assertEquals("scaled_float:[-9223372036854775808 TO 9]", getQueryString(scaledFloatQ));
scaledFloatQ = ft.rangeQuery(null, 0.105, true, false, MOCK_QSC);
assertEquals("scaled_float:[-9223372036854775808 TO 10]", scaledFloatQ.toString());
assertEquals("scaled_float:[-9223372036854775808 TO 10]", getQueryString(scaledFloatQ));
scaledFloatQ = ft.rangeQuery(null, 0.105, true, true, MOCK_QSC);
assertEquals("scaled_float:[-9223372036854775808 TO 10]", scaledFloatQ.toString());
assertEquals("scaled_float:[-9223372036854775808 TO 10]", getQueryString(scaledFloatQ));
scaledFloatQ = ft.rangeQuery(null, 79.99, true, true, MOCK_QSC);
assertEquals("scaled_float:[-9223372036854775808 TO 7999]", scaledFloatQ.toString());
assertEquals("scaled_float:[-9223372036854775808 TO 7999]", getQueryString(scaledFloatQ));
}

public void testRoundsLowerBoundCorrectly() {
ScaledFloatFieldMapper.ScaledFloatFieldType ft = new ScaledFloatFieldMapper.ScaledFloatFieldType("scaled_float", 100);
Query scaledFloatQ = ft.rangeQuery(-0.1, null, false, true, MOCK_QSC);
assertEquals("scaled_float:[-9 TO 9223372036854775807]", scaledFloatQ.toString());
assertEquals("scaled_float:[-9 TO 9223372036854775807]", getQueryString(scaledFloatQ));
scaledFloatQ = ft.rangeQuery(-0.1, null, true, true, MOCK_QSC);
assertEquals("scaled_float:[-10 TO 9223372036854775807]", scaledFloatQ.toString());
assertEquals("scaled_float:[-10 TO 9223372036854775807]", getQueryString(scaledFloatQ));
scaledFloatQ = ft.rangeQuery(-0.095, null, false, true, MOCK_QSC);
assertEquals("scaled_float:[-9 TO 9223372036854775807]", scaledFloatQ.toString());
assertEquals("scaled_float:[-9 TO 9223372036854775807]", getQueryString(scaledFloatQ));
scaledFloatQ = ft.rangeQuery(-0.095, null, true, true, MOCK_QSC);
assertEquals("scaled_float:[-9 TO 9223372036854775807]", scaledFloatQ.toString());
assertEquals("scaled_float:[-9 TO 9223372036854775807]", getQueryString(scaledFloatQ));
scaledFloatQ = ft.rangeQuery(-0.105, null, false, true, MOCK_QSC);
assertEquals("scaled_float:[-10 TO 9223372036854775807]", scaledFloatQ.toString());
assertEquals("scaled_float:[-10 TO 9223372036854775807]", getQueryString(scaledFloatQ));
scaledFloatQ = ft.rangeQuery(-0.105, null, true, true, MOCK_QSC);
assertEquals("scaled_float:[-10 TO 9223372036854775807]", scaledFloatQ.toString());
assertEquals("scaled_float:[-10 TO 9223372036854775807]", getQueryString(scaledFloatQ));
}

private String getQueryString(Query query) {
assertTrue(query instanceof IndexOrDocValuesQuery);
return ((IndexOrDocValuesQuery) query).getIndexQuery().toString();
}

public void testValueForSearch() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class Netty4HttpPipeliningHandlerTests extends OpenSearchTestCase {
@After
public void tearDown() throws Exception {
waitingRequests.keySet().forEach(this::finishRequest);
shutdownExecutorService();
shutdownExecutorServices();
super.tearDown();
}

Expand All @@ -88,7 +88,7 @@ private CountDownLatch finishRequest(String url) {
return finishingRequests.get(url);
}

private void shutdownExecutorService() throws InterruptedException {
private void shutdownExecutorServices() throws InterruptedException {
if (!handlerService.isShutdown()) {
handlerService.shutdown();
handlerService.awaitTermination(10, TimeUnit.SECONDS);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
147cb42a90a29501d9ca6094ea0db1d213f3076a

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b034dd3a975763e083c7e11b5d0f7d516ab72590
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.apache.lucene.analysis.ja.JapaneseTokenizer;
import org.apache.lucene.analysis.ja.JapaneseTokenizer.Mode;
import org.apache.lucene.analysis.ja.dict.UserDictionary;
import org.apache.lucene.analysis.ja.util.CSVUtil;
import org.apache.lucene.analysis.util.CSVUtil;
import org.opensearch.OpenSearchException;
import org.opensearch.common.settings.Settings;
import org.opensearch.env.Environment;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c405f2f7d0fc127d88dfbadd753469b2028fdf52

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
970e5775876c2d7e1b9af7421a4b17d96f63faf4

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2421e5238e9b8484929291744d709dd743c01da1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a23e7de4cd9ae7af285c89dc1c55e0ac3f157fd3

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8d9bce1ea51db279878c51091dd9aefc7b335da4
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
package org.opensearch.plugin.correlation.core.index.codec;

import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.lucene95.Lucene95Codec;
import org.apache.lucene.codecs.lucene99.Lucene99Codec;
import org.opensearch.index.mapper.MapperService;
import org.opensearch.plugin.correlation.core.index.codec.correlation950.CorrelationCodec;
import org.opensearch.plugin.correlation.core.index.codec.correlation950.PerFieldCorrelationVectorsFormat;
import org.opensearch.plugin.correlation.core.index.codec.correlation990.CorrelationCodec;
import org.opensearch.plugin.correlation.core.index.codec.correlation990.PerFieldCorrelationVectorsFormat;

import java.util.Optional;
import java.util.function.BiFunction;
Expand All @@ -24,15 +24,15 @@
* @opensearch.internal
*/
public enum CorrelationCodecVersion {
V_9_5_0(
V_9_9_0(
"CorrelationCodec",
new Lucene95Codec(),
new Lucene99Codec(),
new PerFieldCorrelationVectorsFormat(Optional.empty()),
(userCodec, mapperService) -> new CorrelationCodec(userCodec, new PerFieldCorrelationVectorsFormat(Optional.of(mapperService))),
CorrelationCodec::new
);

private static final CorrelationCodecVersion CURRENT = V_9_5_0;
private static final CorrelationCodecVersion CURRENT = V_9_9_0;
private final String codecName;
private final Codec defaultCodecDelegate;
private final PerFieldCorrelationVectorsFormat perFieldCorrelationVectorsFormat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.correlation.core.index.codec.correlation950;
package org.opensearch.plugin.correlation.core.index.codec.correlation990;

import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.FilterCodec;
Expand All @@ -19,7 +19,7 @@
* @opensearch.internal
*/
public class CorrelationCodec extends FilterCodec {
private static final CorrelationCodecVersion VERSION = CorrelationCodecVersion.V_9_5_0;
private static final CorrelationCodecVersion VERSION = CorrelationCodecVersion.V_9_9_0;
private final PerFieldCorrelationVectorsFormat perFieldCorrelationVectorsFormat;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* compatible open source license.
*/

package org.opensearch.plugin.correlation.core.index.codec.correlation950;
package org.opensearch.plugin.correlation.core.index.codec.correlation990;

import org.apache.lucene.codecs.lucene95.Lucene95HnswVectorsFormat;
import org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsFormat;
import org.opensearch.index.mapper.MapperService;
import org.opensearch.plugin.correlation.core.index.codec.BasePerFieldCorrelationVectorsFormat;

Expand All @@ -26,10 +26,10 @@ public class PerFieldCorrelationVectorsFormat extends BasePerFieldCorrelationVec
public PerFieldCorrelationVectorsFormat(final Optional<MapperService> mapperService) {
super(
mapperService,
Lucene95HnswVectorsFormat.DEFAULT_MAX_CONN,
Lucene95HnswVectorsFormat.DEFAULT_BEAM_WIDTH,
Lucene95HnswVectorsFormat::new,
Lucene95HnswVectorsFormat::new
Lucene99HnswVectorsFormat.DEFAULT_MAX_CONN,
Lucene99HnswVectorsFormat.DEFAULT_BEAM_WIDTH,
Lucene99HnswVectorsFormat::new,
Lucene99HnswVectorsFormat::new
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
/**
* custom Lucene9.5 codec package for events-correlation-engine
*/
package org.opensearch.plugin.correlation.core.index.codec.correlation950;
package org.opensearch.plugin.correlation.core.index.codec.correlation990;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
org.opensearch.plugin.correlation.core.index.codec.correlation950.CorrelationCodec
org.opensearch.plugin.correlation.core.index.codec.correlation990.CorrelationCodec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.correlation.core.index.codec.correlation950;
package org.opensearch.plugin.correlation.core.index.codec.correlation990;

import org.apache.lucene.codecs.Codec;
import org.apache.lucene.document.Document;
Expand All @@ -32,7 +32,7 @@

import static org.opensearch.plugin.correlation.core.index.codec.BasePerFieldCorrelationVectorsFormat.METHOD_PARAMETER_EF_CONSTRUCTION;
import static org.opensearch.plugin.correlation.core.index.codec.BasePerFieldCorrelationVectorsFormat.METHOD_PARAMETER_M;
import static org.opensearch.plugin.correlation.core.index.codec.CorrelationCodecVersion.V_9_5_0;
import static org.opensearch.plugin.correlation.core.index.codec.CorrelationCodecVersion.V_9_9_0;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
Expand All @@ -56,7 +56,7 @@ public void testCorrelationVectorIndex() throws Exception {
Function<MapperService, PerFieldCorrelationVectorsFormat> perFieldCorrelationVectorsProvider =
mapperService -> new PerFieldCorrelationVectorsFormat(Optional.of(mapperService));
Function<PerFieldCorrelationVectorsFormat, Codec> correlationCodecProvider = (correlationVectorsFormat -> new CorrelationCodec(
V_9_5_0.getDefaultCodecDelegate(),
V_9_9_0.getDefaultCodecDelegate(),
correlationVectorsFormat
));
testCorrelationVectorIndex(correlationCodecProvider, perFieldCorrelationVectorsProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ public class NioHttpPipeliningHandlerTests extends OpenSearchTestCase {
@After
public void cleanup() throws Exception {
waitingRequests.keySet().forEach(this::finishRequest);
shutdownExecutorService();
shutdownExecutorServices();
}

private CountDownLatch finishRequest(String url) {
waitingRequests.get(url).countDown();
return finishingRequests.get(url);
}

private void shutdownExecutorService() throws InterruptedException {
private void shutdownExecutorServices() throws InterruptedException {
if (!handlerService.isShutdown()) {
handlerService.shutdown();
handlerService.awaitTermination(10, TimeUnit.SECONDS);
Expand Down
1 change: 0 additions & 1 deletion server/licenses/lucene-analysis-common-9.8.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-analysis-common-9.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24c8401b530308f9568eb7b408c2029c63f564c6
1 change: 0 additions & 1 deletion server/licenses/lucene-backward-codecs-9.8.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-backward-codecs-9.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11c46007366bb037be7d271ab0a5849b1d544662
1 change: 0 additions & 1 deletion server/licenses/lucene-core-9.8.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-core-9.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
55249fa9a0ed321adcf8283c6f3b649a6812b0a9
1 change: 0 additions & 1 deletion server/licenses/lucene-grouping-9.8.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-grouping-9.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2f2785e17c5c823cc8f41a7ddb4647aaca8ee773
1 change: 0 additions & 1 deletion server/licenses/lucene-highlighter-9.8.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-highlighter-9.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
30928513461bf79a5cb057e84da7d34a1e53227d
1 change: 0 additions & 1 deletion server/licenses/lucene-join-9.8.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-join-9.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b9c8cc99632280148f92b4c0a64111c482d5d0ac
1 change: 0 additions & 1 deletion server/licenses/lucene-memory-9.8.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-memory-9.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
49f820b1b321860fa42a4f7583e8ed8f77b9c1c2
1 change: 0 additions & 1 deletion server/licenses/lucene-misc-9.8.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-misc-9.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
db7c30217602dfcda394a4d0f0a9e68140d385a6
1 change: 0 additions & 1 deletion server/licenses/lucene-queries-9.8.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-queries-9.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d157547bd24edc8e9d9d59c273107dc3ac5fde5e
1 change: 0 additions & 1 deletion server/licenses/lucene-queryparser-9.8.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-queryparser-9.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12d844fe224f6f97c510ac20d68903ed7f626f6c
1 change: 0 additions & 1 deletion server/licenses/lucene-sandbox-9.8.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-sandbox-9.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
272e588fd3d8c0a401b28a1ac715f27044bf62ec
1 change: 0 additions & 1 deletion server/licenses/lucene-spatial-extras-9.8.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-spatial-extras-9.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e066432e7ab02b2a4914f989bcd8c44adbf340ad
1 change: 0 additions & 1 deletion server/licenses/lucene-spatial3d-9.8.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-spatial3d-9.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fa54c9b962778e28ebc0efb9f75297781350361a
1 change: 0 additions & 1 deletion server/licenses/lucene-suggest-9.8.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-suggest-9.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9554de5b22ae7483b344b94a9a956960b7a5d49c
Loading

0 comments on commit 4a42150

Please sign in to comment.