Solr represents data
- In Apache Solr, a Document is the part of search as well as index.
- Index consists of one or more Documents and then Document consists of one or more Fields.
- In database terminology,a Document corresponds to a row of the table, and a Field corresponds to a column of the table.
![apache solr with hadoop](https://cdn.wikitechy.com/interview-questions/apache-solr/apache-solr-with-hadoop (1).gif)
Schema
- Before adding documents to Solr, you need to specify the schema, represented in a file called
schema.xml
. - It is not suitable to modify the schema after documents has added to the index.
The schema declares:
- what kinds of fields there are
- which field should be used as the unique/primary key
- which fields are required
- how to index and search each field
Field Types
- In Solr, every field has a type.
- Apache Solr expands the variety of field types offered in Lucene.
Examples of basic field types available in Solr include:
- float
- long
- double
- date
- text