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 2006/08/25 02:15:20 UTC

[Solr Wiki] Trivial Update of "SchemaXml" by StevenParkes

Dear Wiki user,

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

The following page has been changed by StevenParkes:
http://wiki.apache.org/solr/SchemaXml

------------------------------------------------------------------------------
  
  The `<types>` section allows you define a list of `<fieldtype>` declarations you wish to use in your schema, along with the underlying Solr class that should be used for that type, as well as the default options you want for fields that use that type.
  
- Any subclass of [http://incubator.apache.org/solr/docs/api/org/apache/solr/schema/FieldType.html FieldType] may be used as a field type class, using either its full package name, or the "solr" alias if it is in the default Solr pacakge.  For common numeric types (integer, float, etc...) there are multiple implementations provided depending on your needs.
+ Any subclass of [http://incubator.apache.org/solr/docs/api/org/apache/solr/schema/FieldType.html FieldType] may be used as a field type class, using either its full package name, or the "solr" alias if it is in the default Solr package.  For common numeric types (integer, float, etc...) there are multiple implementations provided depending on your needs.
  
    Common options that field types can have are...
  
@@ -30, +30 @@

  
  == Fields ==
  
- The `<fields>` section is where you list the individual `<field>` declarations you wish to use in your documents.  Each `<field>` has a name that you will use to refrence it when adding documents or executing searches, and an associated type which identifies the name of the fieldtype you wish to use for this field.  Individual fields can override the various options (indexed, stored, etc...) that it inherits from it's fieldtype.
+ The `<fields>` section is where you list the individual `<field>` declarations you wish to use in your documents.  Each `<field>` has a name that you will use to reference it when adding documents or executing searches, and an associated type which identifies the name of the fieldtype you wish to use for this field.  Individual fields can override the various options (indexed, stored, etc...) that it inherits from it's fieldtype.
  
- One of the powerful features of Lucene is that you don't have to pre-define every field when you first create your index.  Even though Solr provides strong datatyping for fields, it still prserves that flexability using "Dynamic Fields".  Using `<dynamicField>` declarations, you can create field rules that Solr will use to understand what datatype should be used whenever it is given a field name that is not explicitly defined, but matches a prefix or suffix used in a dynamicField.  
+ One of the powerful features of Lucene is that you don't have to pre-define every field when you first create your index.  Even though Solr provides strong datatyping for fields, it still preserves that flexibility using "Dynamic Fields".  Using `<dynamicField>` declarations, you can create field rules that Solr will use to understand what datatype should be used whenever it is given a field name that is not explicitly defined, but matches a prefix or suffix used in a dynamicField.  
  
  For example the following dynamic field declaration tells Solr that whenever it sees a field name ending in "_i" which is not an explicitly defined field, then it should dynamically create an integer field with that name...
  
@@ -61, +61 @@

  
  === Copy Fields ===
  
- Any number of `<copyField>` declarations can be included in your schema, to instruct Solr that you want it to duplicate any data it sees in the "source" field of documents that are added to the index, in the "dest" field of that document.  You are responsible for ensuring that the datatypes of the fields are compatable, but Solr will process the information in the "dest" field using the appropriate field type (and Analyzer if it's a !TextField).
+ Any number of `<copyField>` declarations can be included in your schema, to instruct Solr that you want it to duplicate any data it sees in the "source" field of documents that are added to the index, in the "dest" field of that document.  You are responsible for ensuring that the datatypes of the fields are compatible, but Solr will process the information in the "dest" field using the appropriate field type (and Analyzer if it's a !TextField).
  
  This is provided as a convenient way to ensure that data is put into several fields, without needing to include the data in the update command multiple times.