17

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.

1 Answer 1

9

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.

1
  • link no longer works, 8 years gone by!
    – Andrew
    Sep 27, 2022 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.