An ad-free and cookie-free website.
The following information is provided for those evaluating Apache Solr for website search or enterprise search applications. Solr uses Lucene libraries for custom search much as Elasticsearch does.
Solr schema refers to a configuration file that instructs Solr how to index documents. Documents may contain structured data like you might find in a database like an online store, or unstructured data as used in full text search applications like search engines.
The Solr schema is formatted in the file called
managed-schema when the user elects to
make modifications using the Solr Schema API, or
schema.xml for more advanced users
who modify the schema by hand.
Fields in Solr are custom to the documents themselves and the information being searched for. Each Field is assigned a Field Type which provides rules for how Fields of that type should be processed.
An example for both Field Types and Fields might look like this (including the XML and schema tags).
The schema file is typically hundreds of lines long, and above is a snippet first of a simple Field Type that processes Fields that are given the type="text_general" name. In this case, the title Field pulled from the indexed document is assigned this Field Type.
Where you see class="solr.TextField", this is where Solr points to a class of code that processes Fields of that type, in this case text. There are 21 such classes provided by Solr version 7 listed below.
Below is a list of 21 Field Type classes provided by Solr 7 that are not
soon to be deprecated. The full path to point to the class is
but this can be abbreviated simply with
||For binary data.|
||For true or false data.|
||For multiple language processing with Unicode symbols.|
||For currencies and exchange rate data.|
||For date range calculations.|
||For date Fields at a point in time.|
||For 64-bit floating point data.|
||For data located in an external file.|
||For ordering data using a scheme other than alphabetic or numeric sorting.|
||For 32-bit floating point data.|
||For Unicode Field specifications.|
||For 32-bit signed integers.|
||For geospatial data, this holds latitudes and longitudes.|
||For 64-bit signed integers.|
||For sorting geospatial data.|
||For passing tokens that have already been analyzed.|
||For returning search results in random order.|
||For geospatial data coordinates. The long form is SpatialRecursivePrefixTreeFieldType.|
||For short strings encoded with UTF-8 Unicode and are not analyzed or tokenized.|
||For text that includes multiple words to be broken into tokens.|
||For a Universally Unique Identifier (UUID) Field.|
The following is an example of a Field Type definition for binary Fields.
The following is an example of a Field Type definition for boolean Fields.
The following is an example of a Field Type definition for text Fields with a one-line analyzer class. It is more common to have multi-line analyzer classes for text Fields.
The following is an example of a Field Type definition for string Fields.
FactorPad offers Apache Solr Search content in both tutorials and reference.
See what other free learning is available at our YouTube Channel. Follow @factorpad on Twitter for updates, or good old fashioned email below.
A newly-updated free resource. Connect and refer a friend today.