Configuration Nested Entity using DIH in SOLR
<p>I wanna create nested entity with DIH using SOLR 6.x </p>

<p>i read 
<a href="https://stackoverflow.com/questions/24920305/defining-nested-entities-in-solr-data-import-handler">Defining nested entities in Solr Data Import Handler</a></p>

<p>and jira <a href="https://issues.apache.org/jira/browse/SOLR-5147" rel="nofollow noreferrer">https://issues.apache.org/jira/browse/SOLR-5147</a> </p>

<p>what i did </p>

<blockquote>
  <p>Schema.xml
   
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    </p>
</blockquote>

<pre><code>&lt;fields&gt;
&lt;field name="variantList" type="string" indexed="true" stored="true"    /&gt;
&lt;field name="variantList.variants" type="string" multiValued="false" required="false"/&gt;
&lt;field name="variantList.stockMinimum" type="int" multiValued="false" required="false"/&gt;
&lt;field name="variantList.stockOnHand" type="int" multiValued="false" required="false"/&gt;
&lt;field name="variantList.stockVariantId" type="long" multiValued="false" required="false"/&gt;
&lt;/fields&gt;
</code></pre>

<blockquote>
  <p>data-config.xml</p>
</blockquote>

<pre><code>&lt;dataConfig&gt;
  &lt;dataSource /&gt; 
  &lt;document&gt;
    &lt;entity name="PARENT" rootEntity='true' query="*" &gt;
     &lt;field column="ID" name="id" /&gt;
     &lt;field column="BRAND_ID" name="brandId" /&gt;
     &lt;field column="PRODUCT_ID" name="productId" /&gt;
     &lt;field column="MERCHANT_PRODUCT_ID" name="merchantProductId" /&gt;
     &lt;field column="MERCHANT_ID" name="merchantId" /&gt;
     &lt;field column="SALES_REGION" name="salesRegion" /&gt;
     &lt;field column="LOCAL_DIRECT_DELIVERY" name="localDirectDelivery" /&gt;
     &lt;field column="NORMAL_SELLINGPRICE" name="normalSellingPrice" /&gt;
     &lt;field column="NEW_PRODUCT" name="newProduct" /&gt;
     &lt;field column="BEST_SELLER" name="bestSeller" /&gt;
     &lt;field column="CATEGORY1_ID" name="category1Id" /&gt;
     &lt;field column="CATEGORY2_ID" name="category2Id" /&gt;
     &lt;field column="CATEGORY3_ID" name="category3Id" /&gt;
     &lt;field column="CATEGORY4_ID" name="category4Id" /&gt;
     &lt;field column="DISPLAY_IMAGE_PATH" name="displayImagePath" /&gt;
     &lt;field column="MERCHANT_NAME" name="merchantName" /&gt;
     &lt;field column="PRODUCT_NAME" name="productName" /&gt;
     &lt;field column="CATEGORY1_NAME" name="category1Name" /&gt;
     &lt;field column="CATEGORY2_NAME" name="category2Name" /&gt;
     &lt;field column="CATEGORY3_NAME" name="category3Name" /&gt;
     &lt;field column="CATEGORY4_NAME" name="category4Name" /&gt;





        &lt;entity name="variantList" child="true" query="select VARIANT , STOCK_MINIMUM , STOCK_ONHAND , ID from SIF_MERCHANT_CATALOG_VARIANT 
                                                    where MERCHANT_CATALOG_ID = '${PARENT.ID}'"&gt;
                &lt;field column="VARIANT" name="variantList.variants_s" /&gt;
                &lt;field column="STOCK_MINIMUM" name="variantList.stockMinimum" /&gt;
                &lt;field column="STOCK_ONHAND" name="variantList.stockOnHand" /&gt;
                &lt;field column="ID" name="variantList.stockVariantId" /&gt;
            &lt;/entity&gt;
    &lt;/entity&gt;
  &lt;/document&gt;
&lt;/dataConfig&gt;
</code></pre>

<p>result that i want </p>

<pre><code>&lt;doc parent_1/&gt;
  &lt;doc child_1/&gt;
  &lt;doc child_1/&gt;
&lt;doc parent_2/&gt;
  &lt;doc child_1/&gt;
</code></pre>

<p>and what i get </p>

<pre><code>&lt;doc child_1/&gt;
&lt;doc child_1/&gt;
&lt;doc parent_1/&gt;
&lt;doc child_2/&gt;
&lt;doc parent_2/&gt;
</code></pre>

<p>and i see aheryan's anwers , it should be right , i can use <strong>child=true</strong></p>

<p>am i miss something ? </p>

<p>thanks </p>