Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to Lucene99 #11421

Merged
merged 29 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
35f7b80
Bump version to 9.9.0-snapshot
mch2 Nov 30, 2023
08a9ae7
Support change https://github.com/apache/lucene/pull/12405
mch2 Nov 30, 2023
455f999
Codec bump
mch2 Nov 30, 2023
0e355fc
Update to honor enableSkipping in XFieldComparatorSource
mch2 Dec 4, 2023
13f5b3b
Use released 9.9 version
mch2 Dec 4, 2023
4cc1ce6
spotless
mch2 Dec 4, 2023
ed62ad1
Fix javadoc in SortedWiderNumericSortField
mch2 Dec 4, 2023
771f40c
Fix tests mocking now final IndexSearcher#getSlices method
mch2 Dec 6, 2023
5a773ce
Bump CorrelationCodec to V_9_9_0
mch2 Dec 6, 2023
b2546b2
update javadoc linking to old codec
mch2 Dec 6, 2023
1e04b1b
update SHAs
mch2 Dec 6, 2023
7794507
rename shutdownExecutorService in tests that now conflict with Lucene…
mch2 Dec 6, 2023
410cb69
more toString test fixes
mch2 Dec 6, 2023
7da8b76
Fix import path of CSVUtil
mch2 Dec 6, 2023
bbbea8c
bump CompletionFieldMapper to use Completion99PostingsFormat
mch2 Dec 6, 2023
ca9f827
Fix broken test testExplainDateRangeInQueryString
mch2 Dec 7, 2023
df4a0d7
Fix test CorruptFileIT#testPrimaryCorruptionDuringReplicationDoesNotF…
mch2 Dec 12, 2023
f11ad85
Add changelog entry
mch2 Dec 12, 2023
da0ae31
Merge branch 'main' into Lucene99
mch2 Dec 12, 2023
e1367bb
Fix changelog
mch2 Dec 12, 2023
c330e5e
bump to 9.9.1
mch2 Dec 28, 2023
ec0961b
Update SHAs for 9.9.1
mch2 Jan 2, 2024
5976dc7
Set BestBucketsDeferringCollector as finished by default when there a…
mch2 Jan 3, 2024
7ac0dd8
PR feedback.
mch2 Jan 3, 2024
e50ffc1
Merge branch 'main' into Lucene99
mch2 Jan 3, 2024
1ddece1
Fix changelog
mch2 Jan 3, 2024
0688dfa
rename correlation950 package to correlation990
mch2 Jan 9, 2024
0185041
add comment to BestBucketsDeferringCollector
mch2 Jan 9, 2024
9024bdb
Merge branch 'main' into Lucene99
mch2 Jan 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Bump `org.wiremock:wiremock-standalone` from 3.1.0 to 3.3.1 ([#11555](https://github.com/opensearch-project/OpenSearch/pull/11555))
- Bump `org.apache.commons:commons-compress` from 1.24.0 to 1.25.0 ([#11556](https://github.com/opensearch-project/OpenSearch/pull/11556))
- Bump `actions/stale` from 8 to 9 ([#11557](https://github.com/opensearch-project/OpenSearch/pull/11557))
- Bump `Lucene` from 9.8.0 to 9.9.0 ([#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.0

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.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2f0876192ee21f2b6f85b9435c99b9f0e04f3fcc
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_0);
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 @@
a36fc5b5087b704852a5f228c38cb3a47fea8c36
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.search.IndexOrDocValuesQuery;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.store.Directory;
Expand Down Expand Up @@ -122,35 +123,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 @@
fa8ddcddd8ad086d123dbcf1b2804683a14f252f

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
70903a94800e3f09898f279987a591e1443e7f11
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 @@
521d3e833ffb371dd4712b8241239cae031507e5

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ac5225e8a5fa4e1d9784b46f64942b75b2716b26
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
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;
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;
msfroh marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -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 @@ -8,7 +8,7 @@

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

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 @@ -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.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
445448c09a0c8ba40f81df7d86ac97303ce0b19e
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.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fd7a9d02972955bb85896ded80e9bf5ffa173b2b
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.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2f0876192ee21f2b6f85b9435c99b9f0e04f3fcc
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.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
becfa739de2d3e29c129ed0347890a2dcab24b9b
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.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fc7392800a3baff95efa592b1dca0df047e862e5
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.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
58e2ff4e9dbb7bad804f08a1f482f08b72676421
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.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
266c6dc593217f606e06903d15d20aaa502d3ad2
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.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
873e4beb02f028a41c981a86e04c6d86a4e4cd68
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.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
298606babedbd3a67b7539fd1f84ccca7140c4de
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.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1968cd1b3ccaff22d30ffa5e5e54ec51b4a4e66e
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.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
25472d0b679ba12ce34dfe925b7541c8b7d74025
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.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
37b89d9250edf4f2b1940395c053c66869b4449d
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.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e51e7d3ca30c1789b7779b54afce4ab140830718
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.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
400c160b7fef8a4d142aa7cfc18f98469a5aec24
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ public void testPrimaryCorruptionDuringReplicationDoesNotFailReplicaShard() thro

final NodeStats primaryNode = dataNodeStats.get(0);
final NodeStats replicaNode = dataNodeStats.get(1);

assertAcked(
prepareCreate("test").setSettings(
Settings.builder()
Expand Down Expand Up @@ -795,6 +796,17 @@ public void testPrimaryCorruptionDuringReplicationDoesNotFailReplicaShard() thro

// Assert the cluster returns to green status because the replica will be promoted to primary
ensureGreen();

// After Lucene 9.9 check index will flag corruption with old (not the latest) commit points.
// For this test our previous corrupt commit "segments_2" will remain on the primary.
// This asserts this is the case, and then resets check index status.
assertEquals("Check index has a single failure", 1, checkIndexFailures.size());
assertTrue(
checkIndexFailures.get(0)
.getMessage()
.contains("could not read old (not latest) commit point segments file \"segments_2\" in directory")
);
resetCheckIndexStatus();
}

private int numShards(String... index) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,10 @@ public void testExplainDateRangeInQueryString() {

long twoMonthsAgo = now.minus(2, ChronoUnit.MONTHS).truncatedTo(ChronoUnit.DAYS).toEpochSecond() * 1000;
long rangeEnd = (now.plus(1, ChronoUnit.DAYS).truncatedTo(ChronoUnit.DAYS).toEpochSecond() * 1000) - 1;
assertThat(response.getQueryExplanation().get(0).getExplanation(), equalTo("past:[" + twoMonthsAgo + " TO " + rangeEnd + "]"));
assertThat(
response.getQueryExplanation().get(0).getExplanation(),
containsString("past:[" + twoMonthsAgo + " TO " + rangeEnd + "]")
);
assertThat(response.isValid(), equalTo(true));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,10 @@ public Query rewrite(IndexSearcher searcher) throws IOException {
return rewritten;
}
IndexReader reader = searcher.getIndexReader();
IndexReaderContext context = reader.getContext();
TermStates[] ctx = new TermStates[terms.length];
int[] docFreqs = new int[ctx.length];
for (int i = 0; i < terms.length; i++) {
ctx[i] = TermStates.build(context, terms[i], true);
ctx[i] = TermStates.build(searcher, terms[i], true);
docFreqs[i] = ctx[i].docFreq();
}

Expand Down
Loading
Loading