I am reading solr example schema.xml. And I found a field named _root_
. I have never seen it before. I don't know what it does.
<!-- points to the root document of a block of nested documents. Required for nested document support, may be removed otherwise -->
<field name="_root_" type="string" indexed="true" stored="false"/>
Is it a new feature of solr? What are the nested documents
? And for what situation I should use this field?
My solr version is 4.6.
Thanks in advance.
A field type defines the analysis that will occur on a field when documents are indexed or queries are sent to the index. A field type definition can include four types of information: The name of the field type (mandatory). An implementation class name (mandatory).
The field type defines how Solr should interpret data in a field and how the field can be queried. There are many field types included with Solr by default, and they can also be defined locally.
positionIncrementGap. For multivalued fields, specifies a distance between multiple values, which prevents spurious phrase matches. autoGeneratePhraseQueries. For text fields. If true , Solr automatically generates phrase queries for adjacent terms.
omitNorms. If true, omits the norms associated with this field (this disables length normalization for the field, and saves some memory). Defaults to true for all primitive (non-analyzed) field types, such as int, float, data, bool, and string. Only full-text fields or fields need norms.
The _root_
field is needed for block-join support. See here for more detailed explanation.
You can use this when you have relationships between entities and you don't want to flatten your docs, for example, one Class doc, contains many Student docs, and you want to be able to query in a more similar way as you would do it in a traditional relational DB.
Be warned though, that you cannot get all features and flexibility of a Relational DB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With