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

Upgrade to Lucene 8.1.0 #42214

Merged
merged 5 commits into from
May 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion buildSrc/version.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
elasticsearch = 8.0.0
lucene = 8.1.0-snapshot-e460356abe
lucene = 8.1.0

bundled_jdk = 12.0.1+12@69cfe15208a647278a19ef0990eea691

Expand Down

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-analyzers-common-8.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
262f20cb2786cdf7015a4ba1a64ce90ff2d746f5

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-backward-codecs-8.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c5610306f8eff182b399b9aed7a60b82668a8395

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-core-8.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
46d614acdeb42f4661e91347100217bc72aae11e

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-grouping-8.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
443f63d9038eea0601b493fa37fc599d74b035eb

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-highlighter-8.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e3e52591f8d44a4e1006ced4dd4a67f7a572990a

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-join-8.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2e885b1e3e55f94ccc2744f85738563a577a4e21

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-memory-8.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e58d0092da1c4744627d57d022f4e07d8b80d11b

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-misc-8.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
07833aee2c5feb6fa1a16a21d27c8f15c01d0b4c

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-queries-8.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
63096d40298b8b8245a602d344b57bfa14b929fd

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-queryparser-8.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9bb4fb3c7035a877e4a87ed86870894509d26d65

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-sandbox-8.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1033737c97703516134ba4c99d41724729854df4

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-spatial-8.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
968d2fb35b0c2e68ac07c1ec187ab38a74b6602a

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-spatial-extras-8.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
551b7fa327645d3fd59ae1321320153b2f858766

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-spatial3d-8.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
45e63df708be458e95d9da3e6054189c50c30dff

This file was deleted.

1 change: 1 addition & 0 deletions server/licenses/lucene-suggest-8.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d5cd0e619b473e132f03e3577d1b422f050f99c0
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import org.apache.logging.log4j.Logger;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.lucene50.Lucene50PostingsFormat.FSTLoadMode;
import org.apache.lucene.codecs.lucene50.Lucene50StoredFieldsFormat.Mode;
import org.apache.lucene.codecs.lucene80.Lucene80Codec;
import org.elasticsearch.common.Nullable;
Expand Down Expand Up @@ -49,7 +48,7 @@ public CodecService(@Nullable MapperService mapperService, Logger logger) {
final var codecs = new HashMap<String, Codec>();
if (mapperService == null) {
codecs.put(DEFAULT_CODEC, new Lucene80Codec());
codecs.put(BEST_COMPRESSION_CODEC, new Lucene80Codec(Mode.BEST_COMPRESSION, FSTLoadMode.AUTO));
codecs.put(BEST_COMPRESSION_CODEC, new Lucene80Codec(Mode.BEST_COMPRESSION));
} else {
codecs.put(DEFAULT_CODEC,
new PerFieldMappingPostingFormatCodec(Mode.BEST_SPEED, mapperService, logger));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.apache.logging.log4j.Logger;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.PostingsFormat;
import org.apache.lucene.codecs.lucene50.Lucene50PostingsFormat.FSTLoadMode;
import org.apache.lucene.codecs.lucene50.Lucene50StoredFieldsFormat;
import org.apache.lucene.codecs.lucene80.Lucene80Codec;
import org.elasticsearch.common.lucene.Lucene;
Expand All @@ -48,7 +47,7 @@ public class PerFieldMappingPostingFormatCodec extends Lucene80Codec {
}

public PerFieldMappingPostingFormatCodec(Lucene50StoredFieldsFormat.Mode compressionMode, MapperService mapperService, Logger logger) {
super(compressionMode, FSTLoadMode.AUTO);
super(compressionMode);
this.mapperService = mapperService;
this.logger = logger;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.apache.logging.log4j.core.filter.RegexFilter;
import org.apache.lucene.codecs.lucene50.Lucene50PostingsFormat;
import org.apache.lucene.codecs.lucene50.Lucene50StoredFieldsFormat;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.LongPoint;
import org.apache.lucene.document.NumericDocValuesField;
Expand Down Expand Up @@ -133,7 +131,6 @@
import org.elasticsearch.test.IndexSettingsModule;
import org.elasticsearch.test.VersionUtils;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;

import java.io.Closeable;
import java.io.IOException;
Expand Down Expand Up @@ -302,14 +299,6 @@ public void testSegments() throws Exception {
assertThat(segments.get(0).getDeletedDocs(), equalTo(0));
assertThat(segments.get(0).isCompound(), equalTo(true));
assertThat(segments.get(0).ramTree, nullValue());
assertThat(segments.get(0).getAttributes().keySet(),
Matchers.contains(
// TODO: Lucene50PostingsFormat#MODE_KEY should be public ?
Lucene50PostingsFormat.class.getSimpleName() + ".fstMode",
Lucene50StoredFieldsFormat.MODE_KEY
)
);

engine.flush();

segments = engine.segments(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,13 @@ public void testExplainWithRewriteValidateQuery() throws Exception {

// common terms queries
assertExplanation(QueryBuilders.commonTermsQuery("field", "huge brown pidgin").cutoffFrequency(1),
containsString("+field:pidgin (field:huge field:brown)"), true);
containsString("+field:pidgin field:huge field:brown"), true);
assertExplanation(QueryBuilders.commonTermsQuery("field", "the brown").analyzer("stop"),
containsString("field:brown"), true);

// match queries with cutoff frequency
assertExplanation(QueryBuilders.matchQuery("field", "huge brown pidgin").cutoffFrequency(1),
containsString("+field:pidgin (field:huge field:brown)"), true);
containsString("+field:pidgin field:huge field:brown"), true);
assertExplanation(QueryBuilders.matchQuery("field", "the brown").analyzer("stop"),
containsString("field:brown"), true);

Expand Down

This file was deleted.

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