mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
Upgrade to lucene snapshot lucene-9.3.0-snapshot-b8d1fcfd0ec (#88706)
This commit is contained in:
parent
09335c9fca
commit
3b7f393a82
57 changed files with 57 additions and 57 deletions
|
@ -1,5 +1,5 @@
|
|||
elasticsearch = 8.4.0
|
||||
lucene = 9.3.0-snapshot-2d05f5c623e
|
||||
lucene = 9.3.0-snapshot-b8d1fcfd0ec
|
||||
|
||||
bundled_jdk_vendor = openjdk
|
||||
bundled_jdk = 18.0.2+9@f6ad4b4450fd4d298113270ec84f30ee
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
a2b0a4e1d763c5575f289ef7b4d8f109e7ee895f
|
|
@ -0,0 +1 @@
|
|||
f9d91e4de3468b4c513a82a3d20d9d19137c4311
|
|
@ -1 +0,0 @@
|
|||
37603372705778c2c755d055ac72f835af0ebe51
|
|
@ -0,0 +1 @@
|
|||
b146dc1d898b3f638328a4d6a64f68cfede251ec
|
|
@ -1 +0,0 @@
|
|||
899069409ff5a448c641700a0371ce792a0635b1
|
|
@ -0,0 +1 @@
|
|||
f87c4435a856c612a5799fa89397364a7b2d6f7e
|
|
@ -1 +0,0 @@
|
|||
3416a5a2becfd987049453c939afa2624c3db6c7
|
|
@ -0,0 +1 @@
|
|||
110e8b2e5bced4b8f482ac58a2cf9cd64591b028
|
|
@ -1 +0,0 @@
|
|||
87772b1d9907c63287d7bc79cf8fa3e9a46c9c77
|
|
@ -0,0 +1 @@
|
|||
501aa4f0028424a994b06627f30ffb36150ffbe2
|
|
@ -1 +0,0 @@
|
|||
a58272a5eb0137dbcb030a7f2cd7925dd717c3e8
|
|
@ -0,0 +1 @@
|
|||
a4a84f37391ab5da0697ba6344555b633aa4bacd
|
|
@ -1 +0,0 @@
|
|||
e15673b088608c7b7e2b5ab491665f9ea92941b2
|
|
@ -0,0 +1 @@
|
|||
012f177949d83aa7bdf26c309f5569f67d1c65b5
|
|
@ -1 +0,0 @@
|
|||
f997bf7bdd07a5684e017294764b0a2ca398f948
|
|
@ -0,0 +1 @@
|
|||
792f50d6cd8b75c277c514f2f6e9914572942dfe
|
|
@ -1 +0,0 @@
|
|||
7cdabbc7114cb7f2925407dd7e18fe6e36fbfc02
|
|
@ -0,0 +1 @@
|
|||
b1488267195c87749dcc42de6b2f665d24ff8d9e
|
|
@ -1 +0,0 @@
|
|||
56cd7a7ae2f9db55fc4150f60745f900a1018e35
|
|
@ -0,0 +1 @@
|
|||
c78968b087eaf2a95ed3b67540efc32455bab84d
|
|
@ -1 +0,0 @@
|
|||
d8a80d858ca656735e3f3e0e3803f9130a504f58
|
|
@ -0,0 +1 @@
|
|||
978ee14dad7edab6384d04655ce1db219547b6d8
|
|
@ -1 +0,0 @@
|
|||
ef6b338e156eacb5ae63daa9638899b4b0c44c15
|
|
@ -0,0 +1 @@
|
|||
7a154a194ea505d27b538270ee2db2b5a4a38371
|
|
@ -1 +0,0 @@
|
|||
25886039976045fb8f9859e12f525eedbb64860a
|
|
@ -0,0 +1 @@
|
|||
3ad36d2a32c1dda37040cdfed9dcdf294b8f3b7c
|
|
@ -1 +0,0 @@
|
|||
98b0f69f9d285dcf822bcd90974e8aa4972187b9
|
|
@ -0,0 +1 @@
|
|||
e41aa9fe38033e61da13fe420aa6e9400f467dd8
|
|
@ -1 +0,0 @@
|
|||
6f6126445ac9b86ef93c6ab26907a69931ada790
|
|
@ -0,0 +1 @@
|
|||
71cd063e306af5acf1cef0492eebbbf000e6a6ce
|
|
@ -1 +0,0 @@
|
|||
dd6fafd8701b01a3f6279447f7d7c410b1230c13
|
|
@ -0,0 +1 @@
|
|||
adc913180fac1b221f57288661f069cb7a240127
|
|
@ -1 +0,0 @@
|
|||
2bc4615335ba485b2152cd10d21ca0cb768b651e
|
|
@ -0,0 +1 @@
|
|||
3618de63e62d734ab1892ff446ae4f5ef866bee6
|
|
@ -1 +0,0 @@
|
|||
3972925a8a1e304e803491881e67c12cbcda4617
|
|
@ -0,0 +1 @@
|
|||
07e0de548fc392428545db40192280b4f83daf4f
|
|
@ -1 +0,0 @@
|
|||
18c2adc5e45d08d65e64d31402219b67d7bc5c61
|
|
@ -0,0 +1 @@
|
|||
ab308291a7dd5ec9988a229dc8e7c27fc2bb5409
|
|
@ -1 +0,0 @@
|
|||
bc9e4af7d35799ba941993be0242101f79719cc6
|
|
@ -0,0 +1 @@
|
|||
8b5804be2c87d995c5255ff1ad739052fc243661
|
|
@ -1 +0,0 @@
|
|||
f62b8f566e37fd6cf150f13d866fcc646c210e35
|
|
@ -0,0 +1 @@
|
|||
a55d8a68cccaaf4af5a973c4332519d3eb477068
|
|
@ -1 +0,0 @@
|
|||
081ff7330c13bfcf0110e7140badfc8be3df910c
|
|
@ -0,0 +1 @@
|
|||
0a6005b6b9b09b1da1c3c74558693824f429e55d
|
|
@ -1 +0,0 @@
|
|||
e3240b6ab35e61a947d94978697816d102b1bd13
|
|
@ -0,0 +1 @@
|
|||
d4c5418c469be74cc5df3427ac07386598c18882
|
|
@ -86,7 +86,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
public class Lucene {
|
||||
public static final String LATEST_CODEC = "Lucene93";
|
||||
public static final String LATEST_CODEC = "Lucene92";
|
||||
|
||||
public static final String SOFT_DELETES_FIELD = "__soft_deletes";
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
package org.elasticsearch.index.codec;
|
||||
|
||||
import org.apache.lucene.codecs.Codec;
|
||||
import org.apache.lucene.codecs.lucene93.Lucene93Codec;
|
||||
import org.apache.lucene.codecs.lucene92.Lucene92Codec;
|
||||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.index.mapper.MapperService;
|
||||
|
||||
|
@ -34,11 +34,11 @@ public class CodecService {
|
|||
public CodecService(@Nullable MapperService mapperService) {
|
||||
final var codecs = new HashMap<String, Codec>();
|
||||
if (mapperService == null) {
|
||||
codecs.put(DEFAULT_CODEC, new Lucene93Codec());
|
||||
codecs.put(BEST_COMPRESSION_CODEC, new Lucene93Codec(Lucene93Codec.Mode.BEST_COMPRESSION));
|
||||
codecs.put(DEFAULT_CODEC, new Lucene92Codec());
|
||||
codecs.put(BEST_COMPRESSION_CODEC, new Lucene92Codec(Lucene92Codec.Mode.BEST_COMPRESSION));
|
||||
} else {
|
||||
codecs.put(DEFAULT_CODEC, new PerFieldMapperCodec(Lucene93Codec.Mode.BEST_SPEED, mapperService));
|
||||
codecs.put(BEST_COMPRESSION_CODEC, new PerFieldMapperCodec(Lucene93Codec.Mode.BEST_COMPRESSION, mapperService));
|
||||
codecs.put(DEFAULT_CODEC, new PerFieldMapperCodec(Lucene92Codec.Mode.BEST_SPEED, mapperService));
|
||||
codecs.put(BEST_COMPRESSION_CODEC, new PerFieldMapperCodec(Lucene92Codec.Mode.BEST_COMPRESSION, mapperService));
|
||||
}
|
||||
codecs.put(LUCENE_DEFAULT_CODEC, Codec.getDefault());
|
||||
for (String codec : Codec.availableCodecs()) {
|
||||
|
|
|
@ -13,7 +13,7 @@ import org.apache.lucene.codecs.DocValuesFormat;
|
|||
import org.apache.lucene.codecs.KnnVectorsFormat;
|
||||
import org.apache.lucene.codecs.PostingsFormat;
|
||||
import org.apache.lucene.codecs.lucene90.Lucene90DocValuesFormat;
|
||||
import org.apache.lucene.codecs.lucene93.Lucene93Codec;
|
||||
import org.apache.lucene.codecs.lucene92.Lucene92Codec;
|
||||
import org.elasticsearch.common.lucene.Lucene;
|
||||
import org.elasticsearch.index.mapper.Mapper;
|
||||
import org.elasticsearch.index.mapper.MapperService;
|
||||
|
@ -27,7 +27,7 @@ import org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapper;
|
|||
* per index in real time via the mapping API. If no specific postings format or vector format is
|
||||
* configured for a specific field the default postings or vector format is used.
|
||||
*/
|
||||
public class PerFieldMapperCodec extends Lucene93Codec {
|
||||
public class PerFieldMapperCodec extends Lucene92Codec {
|
||||
private final MapperService mapperService;
|
||||
|
||||
private final DocValuesFormat docValuesFormat = new Lucene90DocValuesFormat();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
package org.elasticsearch.index.mapper.vectors;
|
||||
|
||||
import org.apache.lucene.codecs.KnnVectorsFormat;
|
||||
import org.apache.lucene.codecs.lucene93.Lucene93HnswVectorsFormat;
|
||||
import org.apache.lucene.codecs.lucene92.Lucene92HnswVectorsFormat;
|
||||
import org.apache.lucene.document.BinaryDocValuesField;
|
||||
import org.apache.lucene.document.Field;
|
||||
import org.apache.lucene.document.KnnVectorField;
|
||||
|
@ -523,7 +523,7 @@ public class DenseVectorFieldMapper extends FieldMapper {
|
|||
return null; // use default format
|
||||
} else {
|
||||
HnswIndexOptions hnswIndexOptions = (HnswIndexOptions) indexOptions;
|
||||
return new Lucene93HnswVectorsFormat(hnswIndexOptions.m, hnswIndexOptions.efConstruction);
|
||||
return new Lucene92HnswVectorsFormat(hnswIndexOptions.m, hnswIndexOptions.efConstruction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.apache.lucene.codecs.DocValuesFormat;
|
|||
import org.apache.lucene.codecs.PostingsFormat;
|
||||
import org.apache.lucene.codecs.lucene90.Lucene90DocValuesFormat;
|
||||
import org.apache.lucene.codecs.lucene90.Lucene90PostingsFormat;
|
||||
import org.apache.lucene.codecs.lucene93.Lucene93Codec;
|
||||
import org.apache.lucene.codecs.lucene92.Lucene92Codec;
|
||||
import org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat;
|
||||
import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat;
|
||||
import org.apache.lucene.document.BinaryDocValuesField;
|
||||
|
@ -297,7 +297,7 @@ public class IndexDiskUsageAnalyzerTests extends ESTestCase {
|
|||
public void testCompletionField() throws Exception {
|
||||
IndexWriterConfig config = new IndexWriterConfig().setCommitOnClose(true)
|
||||
.setUseCompoundFile(false)
|
||||
.setCodec(new Lucene93Codec(Lucene93Codec.Mode.BEST_SPEED) {
|
||||
.setCodec(new Lucene92Codec(Lucene92Codec.Mode.BEST_SPEED) {
|
||||
@Override
|
||||
public PostingsFormat getPostingsFormatForField(String field) {
|
||||
if (field.startsWith("suggest_")) {
|
||||
|
@ -384,25 +384,25 @@ public class IndexDiskUsageAnalyzerTests extends ESTestCase {
|
|||
enum CodecMode {
|
||||
BEST_SPEED {
|
||||
@Override
|
||||
Lucene93Codec.Mode mode() {
|
||||
return Lucene93Codec.Mode.BEST_SPEED;
|
||||
Lucene92Codec.Mode mode() {
|
||||
return Lucene92Codec.Mode.BEST_SPEED;
|
||||
}
|
||||
},
|
||||
|
||||
BEST_COMPRESSION {
|
||||
@Override
|
||||
Lucene93Codec.Mode mode() {
|
||||
return Lucene93Codec.Mode.BEST_COMPRESSION;
|
||||
Lucene92Codec.Mode mode() {
|
||||
return Lucene92Codec.Mode.BEST_COMPRESSION;
|
||||
}
|
||||
};
|
||||
|
||||
abstract Lucene93Codec.Mode mode();
|
||||
abstract Lucene92Codec.Mode mode();
|
||||
}
|
||||
|
||||
static void indexRandomly(Directory directory, CodecMode codecMode, int numDocs, Consumer<Document> addFields) throws IOException {
|
||||
IndexWriterConfig config = new IndexWriterConfig().setCommitOnClose(true)
|
||||
.setUseCompoundFile(randomBoolean())
|
||||
.setCodec(new Lucene93Codec(codecMode.mode()));
|
||||
.setCodec(new Lucene92Codec(codecMode.mode()));
|
||||
try (IndexWriter writer = new IndexWriter(directory, config)) {
|
||||
for (int i = 0; i < numDocs; i++) {
|
||||
final Document doc = new Document();
|
||||
|
@ -580,7 +580,7 @@ public class IndexDiskUsageAnalyzerTests extends ESTestCase {
|
|||
try (DirectoryReader reader = DirectoryReader.open(source)) {
|
||||
IndexWriterConfig config = new IndexWriterConfig().setSoftDeletesField(Lucene.SOFT_DELETES_FIELD)
|
||||
.setUseCompoundFile(randomBoolean())
|
||||
.setCodec(new Lucene93Codec(mode.mode()) {
|
||||
.setCodec(new Lucene92Codec(mode.mode()) {
|
||||
@Override
|
||||
public PostingsFormat getPostingsFormatForField(String field) {
|
||||
return new Lucene90PostingsFormat();
|
||||
|
|
|
@ -10,7 +10,7 @@ package org.elasticsearch.index.codec;
|
|||
|
||||
import org.apache.lucene.codecs.Codec;
|
||||
import org.apache.lucene.codecs.lucene90.Lucene90StoredFieldsFormat;
|
||||
import org.apache.lucene.codecs.lucene93.Lucene93Codec;
|
||||
import org.apache.lucene.codecs.lucene92.Lucene92Codec;
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.index.DirectoryReader;
|
||||
import org.apache.lucene.index.IndexWriter;
|
||||
|
@ -41,21 +41,21 @@ public class CodecTests extends ESTestCase {
|
|||
public void testResolveDefaultCodecs() throws Exception {
|
||||
CodecService codecService = createCodecService();
|
||||
assertThat(codecService.codec("default"), instanceOf(PerFieldMapperCodec.class));
|
||||
assertThat(codecService.codec("default"), instanceOf(Lucene93Codec.class));
|
||||
assertThat(codecService.codec("default"), instanceOf(Lucene92Codec.class));
|
||||
}
|
||||
|
||||
public void testDefault() throws Exception {
|
||||
Codec codec = createCodecService().codec("default");
|
||||
assertStoredFieldsCompressionEquals(Lucene93Codec.Mode.BEST_SPEED, codec);
|
||||
assertStoredFieldsCompressionEquals(Lucene92Codec.Mode.BEST_SPEED, codec);
|
||||
}
|
||||
|
||||
public void testBestCompression() throws Exception {
|
||||
Codec codec = createCodecService().codec("best_compression");
|
||||
assertStoredFieldsCompressionEquals(Lucene93Codec.Mode.BEST_COMPRESSION, codec);
|
||||
assertStoredFieldsCompressionEquals(Lucene92Codec.Mode.BEST_COMPRESSION, codec);
|
||||
}
|
||||
|
||||
// write some docs with it, inspect .si to see this was the used compression
|
||||
private void assertStoredFieldsCompressionEquals(Lucene93Codec.Mode expected, Codec actual) throws Exception {
|
||||
private void assertStoredFieldsCompressionEquals(Lucene92Codec.Mode expected, Codec actual) throws Exception {
|
||||
Directory dir = newDirectory();
|
||||
IndexWriterConfig iwc = newIndexWriterConfig(null);
|
||||
iwc.setCodec(actual);
|
||||
|
@ -67,7 +67,7 @@ public class CodecTests extends ESTestCase {
|
|||
SegmentReader sr = (SegmentReader) ir.leaves().get(0).reader();
|
||||
String v = sr.getSegmentInfo().info.getAttribute(Lucene90StoredFieldsFormat.MODE_KEY);
|
||||
assertNotNull(v);
|
||||
assertEquals(expected, Lucene93Codec.Mode.valueOf(v));
|
||||
assertEquals(expected, Lucene92Codec.Mode.valueOf(v));
|
||||
ir.close();
|
||||
dir.close();
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
package org.elasticsearch.index.engine;
|
||||
|
||||
import org.apache.lucene.codecs.PostingsFormat;
|
||||
import org.apache.lucene.codecs.lucene93.Lucene93Codec;
|
||||
import org.apache.lucene.codecs.lucene92.Lucene92Codec;
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.index.DirectoryReader;
|
||||
import org.apache.lucene.index.IndexWriter;
|
||||
|
@ -45,7 +45,7 @@ public class CompletionStatsCacheTests extends ESTestCase {
|
|||
public void testCompletionStatsCache() throws IOException, InterruptedException {
|
||||
final IndexWriterConfig indexWriterConfig = newIndexWriterConfig();
|
||||
final PostingsFormat postingsFormat = new Completion90PostingsFormat();
|
||||
indexWriterConfig.setCodec(new Lucene93Codec() {
|
||||
indexWriterConfig.setCodec(new Lucene92Codec() {
|
||||
@Override
|
||||
public PostingsFormat getPostingsFormatForField(String field) {
|
||||
return postingsFormat; // all fields are suggest fields
|
||||
|
|
|
@ -12,7 +12,7 @@ import com.carrotsearch.randomizedtesting.generators.RandomPicks;
|
|||
|
||||
import org.apache.lucene.codecs.Codec;
|
||||
import org.apache.lucene.codecs.KnnVectorsFormat;
|
||||
import org.apache.lucene.codecs.lucene93.Lucene93HnswVectorsFormat;
|
||||
import org.apache.lucene.codecs.lucene92.Lucene92HnswVectorsFormat;
|
||||
import org.apache.lucene.document.BinaryDocValuesField;
|
||||
import org.apache.lucene.document.KnnVectorField;
|
||||
import org.apache.lucene.index.IndexableField;
|
||||
|
@ -39,8 +39,8 @@ import java.nio.ByteBuffer;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.apache.lucene.codecs.lucene93.Lucene93HnswVectorsFormat.DEFAULT_BEAM_WIDTH;
|
||||
import static org.apache.lucene.codecs.lucene93.Lucene93HnswVectorsFormat.DEFAULT_MAX_CONN;
|
||||
import static org.apache.lucene.codecs.lucene92.Lucene92HnswVectorsFormat.DEFAULT_BEAM_WIDTH;
|
||||
import static org.apache.lucene.codecs.lucene92.Lucene92HnswVectorsFormat.DEFAULT_MAX_CONN;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.instanceOf;
|
||||
|
@ -454,8 +454,8 @@ public class DenseVectorFieldMapperTests extends MapperTestCase {
|
|||
Codec codec = codecService.codec("default");
|
||||
assertThat(codec, instanceOf(PerFieldMapperCodec.class));
|
||||
KnnVectorsFormat knnVectorsFormat = ((PerFieldMapperCodec) codec).getKnnVectorsFormatForField("field");
|
||||
assertThat(knnVectorsFormat, instanceOf(Lucene93HnswVectorsFormat.class));
|
||||
String expectedString = "Lucene93HnswVectorsFormat(name=Lucene93HnswVectorsFormat, maxConn="
|
||||
assertThat(knnVectorsFormat, instanceOf(Lucene92HnswVectorsFormat.class));
|
||||
String expectedString = "lucene92HnswVectorsFormat(name = lucene92HnswVectorsFormat, maxConn = "
|
||||
+ m
|
||||
+ ", beamWidth="
|
||||
+ efConstruction
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
87772b1d9907c63287d7bc79cf8fa3e9a46c9c77
|
|
@ -0,0 +1 @@
|
|||
501aa4f0028424a994b06627f30ffb36150ffbe2
|
Loading…
Add table
Add a link
Reference in a new issue