You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Hodder, Rick" <RH...@navg.com> on 2018/07/16 21:41:00 UTC

SOLR 7.1 Top level element for similarity factory

I'm using SOLR 7.1 and I'm trying to set the similarity factory back to ClassicSimilarityFactory so that it will behave like SOLR 6 or before.

In the document

https://lucene.apache.org/solr/guide/7_1/other-schema-elements.html#similarity

It says

This default behavior can be overridden by declaring a top level <similarity/> element in your schema.xml, outside of any single field type. This similarity declaration can either refer directly to the name of a class with a no-argument constructor, such as in this example showing BM25Similarity:

<similarity class="solr.BM25SimilarityFactory"/>

So I have the following at the bottom of my schema.xml file


    <similarity class="org.apache.solr.search.similarities.ClassicSimilarityFactory"></similarity>
</schema>

The documentation says "top level element" - so should that actually be outside the schema tag?

Thanks,

Rick Hodder
Information Technology
Navigators Management Company, Inc.
83 Wooster Heights Road, 2nd Floor
Danbury, CT  06810
(475) 329-6251

[Forbes_Best Places Logo2016]


Re: SOLR 7.1 Top level element for similarity factory

Posted by Chris Hostetter <ho...@fucit.org>.
: So I have the following at the bottom of my schema.xml file
: 
: 
:     <similarity class="org.apache.solr.search.similarities.ClassicSimilarityFactory"></similarity>
: </schema>
: 
: The documentation says "top level element" - so should that actually be outside the schema tag?

No, the schema tag is the "root" level element, it's direct children are 
the "top level elements"  

(the wording may not be the best possible, but the goal was to emphasis 
that to have the behavior you're looking need to make sure you don't just 
add it to a single fieldType, or mistakenly put it inside one the of the 
legacy <fields> or <types> blocks)


-Hoss
http://www.lucidworks.com/