You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by manju16832003 <ma...@gmail.com> on 2013/05/13 11:00:01 UTC
Re: multiValued schema example (SOLVED)
Hi All,
I managed to *solve* the issue I had posted earlier with respect to
multiValued.
Here is the Query suppose to configured this way in *data-config.xml *
Description: in the below, first query has associated table images. Each
person would have many images. Here the JSON/XML would return all the images
associated with the person in block.
<document name="manju">
<entity name="list" dataSource="manjudb" query="select
member_id,MemberName FROM member">
<entity name="imagelist" dataSource="manjudb" query="SELECT imagepath FROM
images WHERE member_id='${list.member_id}'">
</entity>
</entity>
</document>
and *schema.xml* for the above query fields looks like
<field name="member_id" type="int" indexed="true" stored="true"
required="true"/>
<field name="MemberName" type="string" indexed="true" stored="true"/>
<field name="imagepath" type="string" indexed="true" stored="true"
<b>multiValued="true"* />
Output:
"response": {
"numFound": 3,
"start": 0,
"docs": [
{
"MemberName": "Vettel",
"member_id": 1,
"_version_": 1434904021528739800
},
{
"MemberName": "Schumacher",
"member_id": 2,
"imagepath": [ //As you could see here that Three rows from the
table *images* returned as one JSON object.
"c:\\\\images\\etc\\test.jpg",
"c:\\\\images\\etc\\test211.jpg",
"c:\\\\images\\etc\\test2343434.jpg",
"C:\\\\manju"
],
"_version_": 1434904021541322800
},
{
"MemberName": "J.Button",
"member_id": 3,
"_version_": 1434904021543420000
}
]
}
}
Thanks
--
View this message in context: http://lucene.472066.n3.nabble.com/multiValued-schema-example-SOLVED-tp4062209p4062864.html
Sent from the Solr - User mailing list archive at Nabble.com.