[
https://issues.apache.org/jira/browse/SOLR-5285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14005678#comment-14005678
]
Arcadius Ahouansou commented on SOLR-5285:
------------------------------------------
Hi [~varunthacker]
I am experimenting with this patch and I have a quick question:
I have applied the patch
https://issues.apache.org/jira/secure/attachment/12646085/SOLR-5285.patch to
trunk.
I have indexed the json file
{code}
[
{
"id":"0",
"content_type":"level-0",
"_childDocuments_":[
{
"id":"1",
"content_type":"level-1",
"_childDocuments_":[
{
"id":"2",
"content_type":"level-2",
"_childDocuments_":[
{
"id":"3",
"content_type":"level-3"
}
]
}
]
}
]
}
]
{code}
when I query through
http://localhost:8983/solr/collection1/select?q=*:*&wt=json&indent=true&fl=*,[child%20parentFilter=%22content_type:level-0%22]&fq=content_type:level-0
I get back
{code}
{
"responseHeader":{
"status":0,
"QTime":1,
"params":{
"fl":"*,[child parentFilter=\"content_type:level-0\"]",
"indent":"true",
"q":"*:*",
"wt":"json",
"fq":"content_type:level-0"
}
},
"response":{
"numFound":1,
"start":0,
"docs":[
{
"id":"0",
"content_type":[
"level-0"
],
"_version_":1468783944507850752,
"childDocs":[
{
"id":"3",
"content_type":[
"level-3"
]
},
{
"id":"2",
"content_type":[
"level-2"
]
},
{
"id":"1",
"content_type":[
"level-1"
]
}
]
}
]
}
}
{code}
Is this the expected output or a bug or am I doing something wrong?
I would have thought that the hierarchy would be preserved.
Thanks.
> Solr response format should support child Docs
> ----------------------------------------------
>
> Key: SOLR-5285
> URL: https://issues.apache.org/jira/browse/SOLR-5285
> Project: Solr
> Issue Type: New Feature
> Reporter: Varun Thacker
> Fix For: 4.9, 5.0
>
> Attachments: SOLR-5285.patch, SOLR-5285.patch, SOLR-5285.patch,
> SOLR-5285.patch, SOLR-5285.patch, SOLR-5285.patch, SOLR-5285.patch,
> SOLR-5285.patch, SOLR-5285.patch, SOLR-5285.patch, SOLR-5285.patch,
> SOLR-5285.patch, SOLR-5285.patch, javabin_backcompat_child_docs.bin
>
>
> Solr has added support for taking childDocs as input ( only XML till now ).
> It's currently used for BlockJoinQuery.
> I feel that if a user indexes a document with child docs, even if he isn't
> using the BJQ features and is just searching which results in a hit on the
> parentDoc, it's childDocs should be returned in the response format.
> [[email protected]] on IRC suggested that the DocTransformers would
> be the place to add childDocs to the response.
> Now given a docId one needs to find out all the childDoc id's. A couple of
> approaches which I could think of are
> 1. Maintain the relation between a parentDoc and it's childDocs during
> indexing time in maybe a separate index?
> 2. Somehow emulate what happens in ToParentBlockJoinQuery.nextDoc() - Given a
> parentDoc it finds out all the childDocs but this requires a childScorer.
> Am I missing something obvious on how to find the relation between a
> parentDoc and it's childDocs because none of the above solutions for this
> look right.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]