From 1737fce5df106847fb5d93eb46ba7b062072c589 Mon Sep 17 00:00:00 2001 From: Chris Hostetter Date: Wed, 21 Jun 2017 09:13:22 -0700 Subject: [PATCH] SOLR-10929: Removed unused 'valType' option from ExternalFileField --- solr/CHANGES.txt | 6 +++++ .../apache/solr/schema/ExternalFileField.java | 14 ----------- .../conf/bad-schema-external-filefield.xml | 25 ------------------- .../solr/collection1/conf/schema-trie.xml | 4 +-- .../solr/collection1/conf/schema11.xml | 16 +++--------- .../solr/schema/BadIndexSchemaTest.java | 5 ---- 6 files changed, 10 insertions(+), 60 deletions(-) delete mode 100644 solr/core/src/test-files/solr/collection1/conf/bad-schema-external-filefield.xml diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index d754590433f..64bd4b5810b 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -108,6 +108,9 @@ Upgrading from Solr 6.x * The default for eDismax parameter 'lowercaseOperators' now depends on the luceneMatchVersion setting in solrconfig. It remains 'true' for luceneMatchVersion < 7.0.0 and changes to 'false' from 7.0.0. See also SOLR-4646 +* The unused 'valType' option has been removed from ExternalFileField, if you have this in your schema you + can safely remove it. see SOLR-10929 for more details. + New Features ---------------------- * SOLR-9857, SOLR-9858: Collect aggregated metrics from nodes and shard leaders in overseer. (ab) @@ -300,6 +303,9 @@ Other Changes * SOLR-8256: Set legacyCloud=false as default (Cao Manh Dat) +* SOLR-10929: Removed unused 'valType' option from ExternalFileField (hossman) + + ================== 6.7.0 ================== Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release. diff --git a/solr/core/src/java/org/apache/solr/schema/ExternalFileField.java b/solr/core/src/java/org/apache/solr/schema/ExternalFileField.java index feba4e0fdff..da4b4db1225 100644 --- a/solr/core/src/java/org/apache/solr/schema/ExternalFileField.java +++ b/solr/core/src/java/org/apache/solr/schema/ExternalFileField.java @@ -22,7 +22,6 @@ import java.util.Map; import org.apache.lucene.index.IndexableField; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.search.SortField; -import org.apache.solr.common.SolrException; import org.apache.solr.response.TextResponseWriter; import org.apache.solr.search.QParser; import org.apache.solr.search.function.FileFloatSource; @@ -35,9 +34,6 @@ import org.apache.solr.uninverting.UninvertingReader.Type; *
  • It's OK to have some documents without a keyField in the file (defVal is used as the default)
  • *
  • It's OK for a keyField value to point to multiple documents (no uniqueness requirement)
  • * - * valType is a reference to another fieldType to define the value type of this field - * (must currently be TrieFloatField or LegacyFloatField (valType="pfloat|float|tfloat") if used). - * This parameter has never been implemented. As of Solr 3.6/4.0 it is optional and can be omitted. * * The format of the external file is simply newline separated keyFieldValue=floatValue. *
    Example: @@ -65,16 +61,6 @@ public class ExternalFileField extends FieldType implements SchemaAware { @Override protected void init(IndexSchema schema, Map args) { restrictProps(SORT_MISSING_FIRST | SORT_MISSING_LAST); - // valType has never been used for anything except to throw an error, so make it optional since the - // code (see getValueSource) gives you a FileFloatSource. - String ftypeS = args.remove("valType"); - if (ftypeS != null) { - ftype = schema.getFieldTypes().get(ftypeS); - if (ftype != null && !(ftype instanceof TrieFloatField)) { - throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, - "Only float (TrieFloatField) is currently supported as external field type. Got " + ftypeS); - } - } keyFieldName = args.remove("keyField"); String defValS = args.remove("defVal"); defVal = defValS == null ? 0 : Float.parseFloat(defValS); diff --git a/solr/core/src/test-files/solr/collection1/conf/bad-schema-external-filefield.xml b/solr/core/src/test-files/solr/collection1/conf/bad-schema-external-filefield.xml deleted file mode 100644 index 75d6a300cfd..00000000000 --- a/solr/core/src/test-files/solr/collection1/conf/bad-schema-external-filefield.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml b/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml index 775ec9d2980..525ea51a02e 100644 --- a/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml +++ b/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml @@ -253,9 +253,7 @@ --> - - + - + - + @@ -275,19 +275,9 @@ valued. --> - - - - - - + class="solr.ExternalFileField" /> diff --git a/solr/core/src/test/org/apache/solr/schema/BadIndexSchemaTest.java b/solr/core/src/test/org/apache/solr/schema/BadIndexSchemaTest.java index f635436fa83..b7d00a9c371 100644 --- a/solr/core/src/test/org/apache/solr/schema/BadIndexSchemaTest.java +++ b/solr/core/src/test/org/apache/solr/schema/BadIndexSchemaTest.java @@ -53,11 +53,6 @@ public class BadIndexSchemaTest extends AbstractBadConfigTestBase { doTest("bad-schema-analyzer-class-and-nested.xml", "bad_type"); } - public void testBadExternalFileField() throws Exception { - doTest("bad-schema-external-filefield.xml", - "Only float (TrieFloatField) is currently supported as external field type."); - } - public void testUniqueKeyRules() throws Exception { doTest("bad-schema-uniquekey-is-copyfield-dest.xml", "can not be the dest of a copyField");