Apache Solr open-source search software
SOLR-10929: Removed unused 'valType' option from ExternalFileField
Chris Hostetter1737fce5df10
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 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.javaindex 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;* <li>It's OK to have some documents without a keyField in the file (defVal is used as the default)</li>* <li>It's OK for a keyField value to point to multiple documents (no uniqueness requirement)</li>* </ul>- * <code>valType</code> 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.* <br>Example:@@ -65,16 +61,6 @@ public class ExternalFileField extends FieldType implements SchemaAware {@Overrideprotected void init(IndexSchema schema, Map<String, String> 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.xmldeleted file mode 100644index 75d6a300cfd..00000000000--- a/solr/core/src/test-files/solr/collection1/conf/bad-schema-external-filefield.xml+++ /dev/null@@ -1,25 +0,0 @@-<!--- Licensed to the Apache Software Foundation (ASF) under one or more- contributor license agreements. See the NOTICE file distributed with- this work for additional information regarding copyright ownership.- The ASF licenses this file to You under the Apache License, Version 2.0- (the "License"); you may not use this file except in compliance with- the License. You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and- limitations under the License.- -->--<schema name="bad-schema-external-filefield" version="1.0">- <fieldType name="tint" class="solr.TrieIntField" omitNorms="true" positionIncrementGap="0"/>-- <fieldType name="eff_none" keyField="id" defVal="0"- stored="false" indexed="true"- class="solr.ExternalFileField" valType="tint"/>--</schema>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.xmlindex 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 @@--><fieldType name="ignored" stored="false" indexed="false" class="solr.StrField"/>- <fieldType name="file" keyField="id" defVal="1" stored="false" indexed="false" class="solr.ExternalFileField"- valType="float"/>-+ <fieldType name="file" keyField="id" defVal="1" stored="false" indexed="false" class="solr.ExternalFileField" /><!-- Valid attributes for fields:name: mandatory - the name for the fielddiff --git a/solr/core/src/test-files/solr/collection1/conf/schema11.xml b/solr/core/src/test-files/solr/collection1/conf/schema11.xmlindex 5c124c797f1..487a65cce8e 100644--- a/solr/core/src/test-files/solr/collection1/conf/schema11.xml+++ b/solr/core/src/test-files/solr/collection1/conf/schema11.xml@@ -245,9 +245,9 @@--><fieldType name="ignored" stored="false" indexed="false" class="solr.StrField" />- <fieldType name="file" keyField="id" defVal="1" stored="false" indexed="false" class="solr.ExternalFileField" valType="float"/>+ <fieldType name="file" keyField="id" defVal="1" stored="false" indexed="false" class="solr.ExternalFileField" />- <fieldType name="sfile" keyField="sfile_s" defVal="1" stored="false" indexed="false" class="solr.ExternalFileField" valType="float"/>+ <fieldType name="sfile" keyField="sfile_s" defVal="1" stored="false" indexed="false" class="solr.ExternalFileField" /><fieldType name="tint" class="solr.TrieIntField" omitNorms="true" positionIncrementGap="0"/>@@ -275,19 +275,9 @@valued. --><fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>- <!-- These should pass right through and insure that we can declare external field types -->- <fieldType name="eff_float" keyField="id" defVal="0"- stored="false" indexed="true"- class="solr.ExternalFileField" valType="float"/>-<fieldType name="eff_tfloat" keyField="eff_ti" defVal="0"stored="false" indexed="true"- class="solr.ExternalFileField" valType="tfloat"/>-- <!-- Be sure that the valType can be optional Since valType has done nothing up until now, this is preferred -->- <fieldType name="eff_none" keyField="id" defVal="0"- stored="false" indexed="true"- class="solr.ExternalFileField"/>+ class="solr.ExternalFileField" /><fieldType name="text_no_analyzer" stored="false" indexed="true" class="solr.TextField" />diff --git a/solr/core/src/test/org/apache/solr/schema/BadIndexSchemaTest.java b/solr/core/src/test/org/apache/solr/schema/BadIndexSchemaTest.javaindex 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");