You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2012/06/26 02:25:19 UTC

[Solr Wiki] Update of "SchemaXml" by HossMan

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "SchemaXml" page has been changed by HossMan:
http://wiki.apache.org/solr/SchemaXml?action=diff&rev1=58&rev2=59

Comment:
SOLR-2600

   <copyField source="*" dest="text"/>
  }}}
  === Similarity ===
- A `<similarity>` declaration can be used to specify the subclass of Similarity that you want Solr to use when dealing with your index.  If no Similarity class is specified, the Lucene !DefaultSimilarity is used.  Please see SolrPlugins for information on how to ensure that your own custom Similarity can be loaded into Solr.
+ 
+ A (global) `<similarity>` declaration can be used to specify a custom Similarity implementation that you want Solr to use when dealing with your index.  A Similarity can be specified either by referring directly to the name of a class with a no-arg constructor...
+ 
+ {{{
+ <similarity class="org.apache.lucene.search.similarities.DefaultSimilarity"/>
+ }}}
+ 
+ ...or by referencing a `SimilarityFactory` implementation, which may take optional init params....
+ 
+ {{{
+ <similarity class="solr.DFRSimilarityFactory">
+   <str name="basicModel">P</str>
+   <str name="afterEffect">L</str>
+   <str name="normalization">H2</str>
+   <float name="c">7</float>
+ </similarity>
+ }}}
+ 
+ Begining with [[Solr4.0]], Similarity factories such as `SchemaSimilarityFactory` can also support specifying specific Similarity implementations on individual field types...
+ 
+ {{{
+ <types>
+   <fieldType name="text_dfr" class="solr.TextField">
+     <analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
+     <similarity class="solr.DFRSimilarityFactory">
+       <str name="basicModel">I(F)</str>
+       <str name="afterEffect">B</str>
+       <str name="normalization">H2</str>
+     </similarity>
+   </fieldType>
+   <fieldType name="text_ib" class="solr.TextField">
+     <analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
+     <similarity class="solr.IBSimilarityFactory">
+       <str name="distribution">SPL</str>
+       <str name="lambda">DF</str>
+       <str name="normalization">H2</str>
+     </similarity>
+   </fieldType>
+   ...
+ </types>	
+ <similarity class="solr.SchemaSimilarityFactory"/>
+ }}}
+ 
+ If no (global) `<similarity>` is configured in the schema.xml file, an implicit instance of `DefaultSimilarityFactory` is used.
  
  === Poly Field Types ===
  Some !FieldTypes can be "poly" field types.  A Poly !FieldType is one that can potentially create multiple Fields per "declared" field. Some examples include the !LatLonType and !PointType, both which use multiple indexed fields internally to represent what the user sees as a single value (e.g. "35.9,-79.0"). Another example is CurrencyField which indexes the value and currency symbol separately (e.g. "10,USD").