schema.xml
Broadly, schema.xml
contains the following information:
- Different types of field names of schema, and data types (
<fields>…<field>
) - Definition of user/seeded defined data types (
<types>…<fieldTypes>
) - Dynamic fields (
<fields>….<dynamicField>
) - Information about unique key to define each document uniquely (
<uniqueKey>
) - Information regarding query parser for Solr (
<solrQueryParser>
) - Default search field to be used when the user does not pass the field name (
<defaultSearchField>
) - Information about copying the field from one field to another (
<copyField>
)
In the Configuring the Apache Solr for enterprise section of Chapter 2, Getting Started with Apache Solr, we have already explained the important attributes of schema.xml
. The following is a sample of the schema.xml
file; the fields will look like the ones shown in the following screenshot:
You can remove all copy fields, if not needed. The unique key is used...