From 514c363f1d82b801234b16ef16804f08da86dc7a Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Mon, 9 Nov 2020 19:37:03 +0100 Subject: [PATCH] LUCENE-9322: Move Solr to Lucene90Codec. And drop configurability of Lucene87Codec since it shouldn't be used for writing anymore. --- .../backward_codecs/lucene87/Lucene87Codec.java | 14 +------------- .../org/apache/solr/core/SchemaCodecFactory.java | 4 ++-- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87Codec.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87Codec.java index 13bd32fa36e..857f4e43604 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87Codec.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87Codec.java @@ -17,8 +17,6 @@ package org.apache.lucene.backward_codecs.lucene87; -import java.util.Objects; - import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.CompoundFormat; import org.apache.lucene.codecs.DocValuesFormat; @@ -84,18 +82,8 @@ public class Lucene87Codec extends Codec { * Instantiates a new codec. */ public Lucene87Codec() { - this(Lucene87StoredFieldsFormat.Mode.BEST_SPEED); - } - - /** - * Instantiates a new codec, specifying the stored fields compression - * mode to use. - * @param mode stored fields compression mode to use for newly - * flushed/merged segments. - */ - public Lucene87Codec(Lucene87StoredFieldsFormat.Mode mode) { super("Lucene87"); - this.storedFieldsFormat = new Lucene87StoredFieldsFormat(Objects.requireNonNull(mode)); + this.storedFieldsFormat = new Lucene87StoredFieldsFormat(); this.defaultFormat = new Lucene84PostingsFormat(); } diff --git a/solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java b/solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java index ce0df02385e..dedbf8f44b6 100644 --- a/solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java +++ b/solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java @@ -20,11 +20,11 @@ import java.lang.invoke.MethodHandles; import java.util.Arrays; import java.util.Locale; -import org.apache.lucene.backward_codecs.lucene87.Lucene87Codec; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.PostingsFormat; import org.apache.lucene.codecs.lucene87.Lucene87StoredFieldsFormat.Mode; +import org.apache.lucene.codecs.lucene90.Lucene90Codec; import org.apache.solr.common.SolrException; import org.apache.solr.common.SolrException.ErrorCode; import org.apache.solr.common.util.NamedList; @@ -92,7 +92,7 @@ public class SchemaCodecFactory extends CodecFactory implements SolrCoreAware { compressionMode = SOLR_DEFAULT_COMPRESSION_MODE; log.debug("Using default compressionMode: {}", compressionMode); } - codec = new Lucene87Codec(compressionMode) { + codec = new Lucene90Codec(compressionMode) { @Override public PostingsFormat getPostingsFormatForField(String field) { final SchemaField schemaField = core.getLatestSchema().getFieldOrNull(field);