[
https://issues.apache.org/jira/browse/SOLR-5285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14020948#comment-14020948
]
Varun Thacker commented on SOLR-5285:
-------------------------------------
Documentation we should add to the ref guide under -
https://cwiki.apache.org/confluence/display/solr/Common+Query+Parameters
{code}
[child]{code}
DocTransformer for optionally including Block-Join decendent documents inline
in the results of a search. This transformer returns all descendants of each
parent document in a flat list nested inside the parent document. This is
useful when you have indexed nested child documents and want to retrieve the
child documents for the relavant parent documents for any type of search query.
Supported response formats are - xml, json, and javabin
Usage example -
{code}
[child parentFilter="fieldName:fieldValue"]
{code}
{code}
[child parentFilter="fieldName:fieldValue" childFilter="fieldName:fieldValue"]
{code}
{code}
[child parentFilter="fieldName:fieldValue" childFilter="fieldName:fieldValue"
limit=20]
{code}
Mandatory -
- The "parentFilter" parameter is mandatory. This condition should identify
only child documents.
Optional -
- The "childFilter" parameter is used to filter out which child documents
should be returned.
- The "limit" parameter which provides an option to specify the number of child
documents to be returned per parent document. By default it's set to 10.
> 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
> Assignee: Hoss Man
> 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, 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]