[ 
https://issues.apache.org/jira/browse/SOLR-5829?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joel Bernstein updated SOLR-5829:
---------------------------------

    Description: 
By default the ExpandComponent re-runs both the main query and filter queries 
to expand the groups. This ticket allows you to pass the main query and filter 
queries into the ExpandComponent. It also allows you to pass in the expand 
field.

This design allows the ExpandComponent to operate independently of the 
CollapsingQParserPlugin and allows for modeling of parent/child relationships. 

For example:

q=*:*&fq=type:parent&expand=true&expand.field=group_id&expand.q=*:*&expand.fq=type:child

In the query above the the main query returns all documents of the type:parent. 
The ExpandComponent then expands the groups by retrieving all documents with 
type:child and grouping them by the group_id.

In other words, the main result set will be the parent documents and the 
expanded result set will be the child documents.

You could reverse this as well:

q=*:*&fq=type:child&fq={!collapse 
field=group_id}&expand=true&expand.field=group_id&expand.q=*:*&expand.fq=type:parent

In the query above the main query returns all documents with type:child and 
collapses them on the group_id field. The ExpandComponent then expands the 
groups by retrieving all documents with type:parent and groups them by 
group_id. Since there is only one parent per collapsed child, each group will 
have one document 1 document.

In this case the main result set will be collapsed child documents and the 
expanded results will be parent documents.






  was:
Adding tag/exclude functionality to the ExpandComponent would allow it to 
operate independently of the CollapsingQParserPlugin. For example:

{code}
q=*:*&fq={!tag=parent}type=parent&expand=true&expand.field=group_id&expand.exclude=parent
{code}
The query above searches all documents limiting the results to type=parent. So 
the main result would contain only parent documents.

The expand component then excludes the type=parent filter and expands the 
groups based on the group_id field. 

Using this approach the main search result will contain only documents with 
type=parent and the expanded results will display the child documents for the 
group.

 


> Allow ExpandComponent to accept query and filter query parameters
> -----------------------------------------------------------------
>
>                 Key: SOLR-5829
>                 URL: https://issues.apache.org/jira/browse/SOLR-5829
>             Project: Solr
>          Issue Type: New Feature
>          Components: SearchComponents - other
>            Reporter: Joel Bernstein
>             Fix For: 4.8
>
>         Attachments: SOLR-5829.patch, SOLR-5829.patch
>
>
> By default the ExpandComponent re-runs both the main query and filter queries 
> to expand the groups. This ticket allows you to pass the main query and 
> filter queries into the ExpandComponent. It also allows you to pass in the 
> expand field.
> This design allows the ExpandComponent to operate independently of the 
> CollapsingQParserPlugin and allows for modeling of parent/child 
> relationships. 
> For example:
> q=*:*&fq=type:parent&expand=true&expand.field=group_id&expand.q=*:*&expand.fq=type:child
> In the query above the the main query returns all documents of the 
> type:parent. The ExpandComponent then expands the groups by retrieving all 
> documents with type:child and grouping them by the group_id.
> In other words, the main result set will be the parent documents and the 
> expanded result set will be the child documents.
> You could reverse this as well:
> q=*:*&fq=type:child&fq={!collapse 
> field=group_id}&expand=true&expand.field=group_id&expand.q=*:*&expand.fq=type:parent
> In the query above the main query returns all documents with type:child and 
> collapses them on the group_id field. The ExpandComponent then expands the 
> groups by retrieving all documents with type:parent and groups them by 
> group_id. Since there is only one parent per collapsed child, each group will 
> have one document 1 document.
> In this case the main result set will be collapsed child documents and the 
> expanded results will be parent documents.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to