lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pranaya Behera <pranaya.beh...@igp.com>
Subject Parent Child Schema Design
Date Thu, 07 Jan 2016 07:46:02 GMT
Hi,
      I have read yonik.com/solr-nested-objects/ which states that there 
is no need for additional schema changes other than having a _root_ 
which is already present in the schema.xml. But it never specified on 
for the child elements what would the schema look like. And the post 
actually uses curl with json to index data to solr. I am using python 
client to index data to solr.

I have products as the core. This is one document but it has more 
interlinked child documents. As of now it is a single flat structure 
schema. But if I would like to use the parent-child relationship how 
would I go about it. Sample current schema:

<field name="id" type="string" indexed="true" stored="true" 
required="true" multiValued="false" />
<field name="_version_" type="long" indexed="true" stored="true"/>
<field name="_root_" type="string" indexed="true" stored="false"/>
<field name="_text_" type="text_general" indexed="true" stored="false" 
multiValued="true"/>
<field name="name" type="text_general" indexed="true" stored="true" 
required="false" multiValued="false" />
<field name="url" type="string" indexed="false" stored="false" 
required="false" />

Now I would like to add child document to it. Lets say I would like to 
add another field named steps which will contain id, product_id, name, 
description. This steps would be a multivalued as per product we have 
multiple steps.

Can someone help me figure out how to go about this ?

-- 
Thanks & Regards
Pranaya Behera


Mime
View raw message