Hi,
I have two table to be indexed.
Table-1: Person [id,name,addr]
Table-2: Docs [id,doc_name,person_id]

Relationship is: One person can have many documents.

I would like to get json as follows
[ { "id" : "name", "address",["doc_id1", "doc_id2", "doc_id3,etc...."] }]

How would I configure this in Solr.
How would I write configure the queries in data-config.xml

I tried this way. Main query and there is sub-query that returns many rows
to main query.
<document name="example">
         <entity name="person" dataSource="ds-person" query="SELECT
id,name,address,'documents' FROM Person">
                <entity name="docs" dataSource="ds-person" query="SELECT id as
doc_id FROM docs WHERE person_id='${person.id}'">
                </entity>
         </entity>
        </document>

This is how my schema.xml data filed configuration

 <field name="id" type="int" indexed="true" stored="true" required="true"
multiValued="false" /> 
   <field name="name" type="string" indexed="true" stored="true"
omitNorms="true"/>
   <field name="address" type="string" indexed="true" stored="true"/>
<field name="documents" type="int" indexed="true" stored="true"
omitNorms="true" multiValued="true"/>
   <field name="doc_id" type="int" indexed="true" stored="true"
omitNorms="true"/>


I couldn't succeed. 
What is the way to achieve the above scenario.

Thanks in advance.





--
View this message in context: 
http://lucene.472066.n3.nabble.com/multiValue-schema-example-tp4062209.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to