3

Is it possible to create deeper nested indexes via DIH? If yes, how it is working?

parent -> child -> child's child -> ...

I found examples to parse deeper nested indexes via Block Join, but no examples to create this via DIH.

https://medium.com/@alisazhila/solr-s-nesting-on-solr-s-capabilities-to-handle-deeply-nested-document-structures-50eeaaa4347a#.k0ykgq1b6

Example how I imagine this:

<dataConfig>
  <dataSource type="JdbcDataSource" />
  <document>
    <entity name="PARENT" query="select * from PARENT">
      <field column="id" />
      <field column="desc" />
      <field column="type_s" />
      <entity child="true" name="CHILD" query="select * from CHILD where parent_id='${PARENT.id}'">
        <field column="id" />
        <field column="child_id" />
        <field column="desc" />
        <field column="type_s" />
         <entity childschild="true" name="CHILDSCHILD" query="select * from CHILDSCHILD where child_id='${CHILD.child_id}'">
            <field column="child_id" />
            <field column="desc" />
            <field column="type_s" />
         </entity>
    </entity>
  </document>
</dataConfig>

Thanks!

David
  • 51
  • 4
  • have you read this article https://wiki.apache.org/solr/DataImportHandler ? You have imagined in a right way. – Oyeme Oct 19 '16 at 14:59
  • @Oyeme In this article isn't described how I can create a nested index. I know it is possible to create nested index with child="true" tag. I've created one and it works. But is it possible to create a deeper index (more than one level) with the DIH? In my example I take the placeholder tag "childschild". I know it is not working just like this. :-) – David Oct 20 '16 at 14:20
  • You're doing right.Try to find "Full Import Example" there is an example of 3 nested levels – Oyeme Oct 20 '16 at 14:39
  • @Oyeme No sry, that is not a example for a nested index. This is the data-config.xml with 3 level sub queries, yes, but after this import I have no nested documents. The documents will be level 1 documents. The child="true" tag is the key for it. Nested documents looks like this: https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+Index+Handlers#UploadingDatawithIndexHandlers-NestedChildDocuments – David Oct 20 '16 at 15:02

0 Answers0