Solr
  1. Solr
  2. SOLR-5829

Allow ExpandComponent to accept query and filter query parameters

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.8
    • Labels:
      None

      Description

      By default the ExpandComponent re-runs both the main query and filter queries to expand the groups collapsed by the CollapsingQParserPlugin. 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.

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

      1. SOLR-5829.patch
        13 kB
        Joel Bernstein
      2. SOLR-5829.patch
        9 kB
        Joel Bernstein
      3. SOLR-5829.patch
        9 kB
        Joel Bernstein
      4. SOLR-5829.patch
        4 kB
        Joel Bernstein

        Issue Links

          Activity

          Hide
          Joel Bernstein added a comment -

          Added tests for expand.q and expand.fq

          Show
          Joel Bernstein added a comment - Added tests for expand.q and expand.fq
          Hide
          Joel Bernstein added a comment - - edited

          Ignore

          expand.fq=*:*
          Show
          Joel Bernstein added a comment - - edited Ignore expand.fq=*:*
          Hide
          ASF subversion and git services added a comment -

          Commit 1583802 from Joel Bernstein in branch 'dev/trunk'
          [ https://svn.apache.org/r1583802 ]

          SOLR-5829: Allow ExpandComponent to accept query and filter query parameters

          Show
          ASF subversion and git services added a comment - Commit 1583802 from Joel Bernstein in branch 'dev/trunk' [ https://svn.apache.org/r1583802 ] SOLR-5829 : Allow ExpandComponent to accept query and filter query parameters
          Hide
          ASF subversion and git services added a comment -

          Commit 1583806 from Joel Bernstein in branch 'dev/branches/branch_4x'
          [ https://svn.apache.org/r1583806 ]

          SOLR-5829: Allow ExpandComponent to accept query and filter query parameters

          Show
          ASF subversion and git services added a comment - Commit 1583806 from Joel Bernstein in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1583806 ] SOLR-5829 : Allow ExpandComponent to accept query and filter query parameters
          Hide
          Uwe Schindler added a comment -

          Close issue after release of 4.8.0

          Show
          Uwe Schindler added a comment - Close issue after release of 4.8.0

            People

            • Assignee:
              Joel Bernstein
              Reporter:
              Joel Bernstein
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development