SOLR-8239: remove (deprecated) DefaultSimilarityFactory from trunk

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1713039 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris M. Hostetter 2015-11-06 21:03:52 +00:00
parent 47959bfe75
commit 088fc1c441
4 changed files with 4 additions and 72 deletions

View File

@ -51,6 +51,9 @@ Upgrading from Solr 5.x
to allow for multiple full query results (DocLists) per Solr request.
TransformContext was rendered redundant and was removed. (yonik)
* DefaultSimilarityFactory has been removed. If you currently have DefaultSimilarityFactory explicitly
refrenced in your schema.xml, edit your config to use the functionally identical ClassicSimilarityFactory.
See SOLR-8239 for more details.
Detailed Change List

View File

@ -1,44 +0,0 @@
package org.apache.solr.search.similarities;
/*
* 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.
*/
import org.apache.lucene.search.similarities.Similarity;
import org.apache.solr.common.params.SolrParams;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @deprecated This class has been renamed to <code>ClassicSimilarityFactory</code> to reflect the renaming of the underlying Similarity returned.
*
* @see ClassicSimilarityFactory
*/
@Deprecated
public class DefaultSimilarityFactory extends ClassicSimilarityFactory {
public static final Logger log = LoggerFactory.getLogger(DefaultSimilarityFactory.class);
@Override
public void init(SolrParams params) {
super.init(params);
log.warn("DefaultSimilarityFactory has been renamed and deprecated. " +
"Please update your configuration file to refer to ClassicSimilarityFactory instead");
}
}

View File

@ -38,22 +38,6 @@
</similarity>
</fieldType>
<!-- testDefaultWithDefaults -->
<field name="text__default" type="text__default" indexed="true" stored="false"/>
<fieldType name="text__default" class="solr.TextField">
<analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
<similarity class="solr.DefaultSimilarityFactory"/>
</fieldType>
<!-- testDefaultWithParams -->
<field name="text_overlap__default" type="text_overlap__default" indexed="true" stored="false"/>
<fieldType name="text_overlap__default" class="solr.TextField">
<analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
<similarity class="solr.DefaultSimilarityFactory">
<bool name="discountOverlaps">false</bool>
</similarity>
</fieldType>
<field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
<defaultSearchField>text</defaultSearchField>

View File

@ -22,7 +22,7 @@ import org.apache.lucene.search.similarities.Similarity;
import org.junit.BeforeClass;
/**
* Tests {@link DefaultSimilarityFactory} when specified on a per-fieldtype basis with various init options.
* Tests {@link ClassicSimilarityFactory} when specified on a per-fieldtype basis with various init options.
* @see SchemaSimilarityFactory
*/
public class TestClassicSimilarityFactory extends BaseSimilarityTestCase {
@ -42,15 +42,4 @@ public class TestClassicSimilarityFactory extends BaseSimilarityTestCase {
assertEquals(false, sim.getDiscountOverlaps());
}
/** Default w/ default parameters */
public void testDefaultWithDefaults() throws Exception {
ClassicSimilarity sim = getSimilarity("text__default", ClassicSimilarity.class);
assertEquals(true, sim.getDiscountOverlaps());
}
/** Default w/ explicit params */
public void testDefaultWithParams() throws Exception {
ClassicSimilarity sim = getSimilarity("text_overlap__default", ClassicSimilarity.class);
assertEquals(false, sim.getDiscountOverlaps());
}
}