On 7/14/2018 6:46 AM, sara hajili wrote:
i need to have nested object to solr document , and query in nested objects
and children. i create this schema :
<field name="topic" type="text_fa" indexed="true" stored="true" multiValued=
"true" termVectors="true"/> <field name="topic.code" type="text_general"
indexed="true" stored="true" multiValued="true" /> <field name="topic.name"
type="text_fa" indexed="true" stored="true" multiValued="true"/>
and add this doc :
{
"id":12,
"topic":{"code":12,"name":"hi"}
}
this file added completly but have a probelm in search. i didn't get any
result when is search : "topic.code:12"
i didn't get any result from solr.
Parent/Child document support doesn't work that way.
It seems that what you actually want is to send a nested structure and
have Solr parse a complex field definition into multiple fields. Solr
isn't going to do this for you. You'll need to handle this in your
indexing application. When your application gets results from Solr, it
can recreate the nested structure to show to the user.
A child document is a completely separate document. That document has a
field which links it to another document that gets indexed at the same
time -- its parent.
I have no idea what Solr would do when indexing the json that you sent
it. As you've noticed, it doesn't do what you expected.
Thanks,
Shawn