Solr
  1. Solr
  2. SOLR-5720

Add ExpandComponent to expand results collapsed by the CollapsingQParserPlugin

    Details

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

      Description

      This ticket introduces a new search component called the ExpandComponent. The expand component expands a single page of results collapsed by the CollapsingQParserPlugin.

      Sample syntax:

      q=*:*&fq={!collapse field=fieldA}&expand=true&expand.sort=fieldB+asc&expand.rows=10
      

      In the above query the results are collapsed on "fieldA" with the CollapsingQParserPlugin. The expand component expands the current page of collapsed results.

      The initial implementation of the ExpandComponent takes three parameters:

      expand=true (Turns on the ExpandComponent)
      expand.sort=fieldB+asc,fieldC+desc (Sorts the documents based on a sort spec. If none is specified the documents are sorted by relevance based on the main query.)
      expand.rows=10 (Sets the numbers of rows that groups are expanded to).

      1. SOLR-5720.patch
        30 kB
        Joel Bernstein
      2. SOLR-5720.patch
        28 kB
        Joel Bernstein
      3. SOLR-5720.patch
        28 kB
        Joel Bernstein
      4. SOLR-5720.patch
        30 kB
        Joel Bernstein
      5. SOLR-5720.patch
        30 kB
        Joel Bernstein
      6. SOLR-5720.patch
        32 kB
        Joel Bernstein
      7. SOLR-5720.patch
        34 kB
        Joel Bernstein
      8. SOLR-5720.patch
        34 kB
        Joel Bernstein
      9. SOLR-5720.patch
        35 kB
        Joel Bernstein

        Issue Links

          Activity

          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
          Hide
          ASF subversion and git services added a comment -

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

          SOLR-5720: Updated CHANGES.txt

          Show
          ASF subversion and git services added a comment - Commit 1575267 from Joel Bernstein in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1575267 ] SOLR-5720 : Updated CHANGES.txt
          Hide
          ASF subversion and git services added a comment -

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

          SOLR-5720: Updated CHANGES.txt

          Show
          ASF subversion and git services added a comment - Commit 1575266 from Joel Bernstein in branch 'dev/trunk' [ https://svn.apache.org/r1575266 ] SOLR-5720 : Updated CHANGES.txt
          Hide
          ASF subversion and git services added a comment -

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

          SOLR-5720: Add ExpandComponent to expand results collapsed by the CollapsingQParserPlugin

          Show
          ASF subversion and git services added a comment - Commit 1573669 from Joel Bernstein in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1573669 ] SOLR-5720 : Add ExpandComponent to expand results collapsed by the CollapsingQParserPlugin
          Hide
          ASF subversion and git services added a comment -

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

          SOLR-5720: Java 6 compatibility change

          Show
          ASF subversion and git services added a comment - Commit 1573636 from Joel Bernstein in branch 'dev/trunk' [ https://svn.apache.org/r1573636 ] SOLR-5720 : Java 6 compatibility change
          Hide
          ASF subversion and git services added a comment -

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

          SOLR-5720: Add ExpandComponent to expand results collapsed by the CollapsingQParserPlugin

          Show
          ASF subversion and git services added a comment - Commit 1573589 from Joel Bernstein in branch 'dev/trunk' [ https://svn.apache.org/r1573589 ] SOLR-5720 : Add ExpandComponent to expand results collapsed by the CollapsingQParserPlugin
          Hide
          Joel Bernstein added a comment -

          All tests are passing as well as precommit. I'm going to commit to trunk and continue to work on this feature for Solr 4.8. One ticket to keep an eye on is SOLR-5773 which deals with how elevated documents are collapsed. This will effect the ExpandComponent as well.

          Show
          Joel Bernstein added a comment - All tests are passing as well as precommit. I'm going to commit to trunk and continue to work on this feature for Solr 4.8. One ticket to keep an eye on is SOLR-5773 which deals with how elevated documents are collapsed. This will effect the ExpandComponent as well.
          Hide
          Joel Bernstein added a comment -

          Some more refactoring for efficiency and added test case for expanding when nullPolicy is used with the CollapsingQParserPlugin.

          Show
          Joel Bernstein added a comment - Some more refactoring for efficiency and added test case for expanding when nullPolicy is used with the CollapsingQParserPlugin.
          Hide
          Joel Bernstein added a comment -

          New patch using fieldType.indexedToReadable(bytesRef, charsRef) when outputing the group names to handle non-string fields properly.

          Show
          Joel Bernstein added a comment - New patch using fieldType.indexedToReadable(bytesRef, charsRef) when outputing the group names to handle non-string fields properly.
          Hide
          Joel Bernstein added a comment -

          New patch, handles the zero result case and added tests for zero results and zero expand results.

          Show
          Joel Bernstein added a comment - New patch, handles the zero result case and added tests for zero results and zero expand results.
          Hide
          Joel Bernstein added a comment -

          Added ExpandParams and ResponseBuilder.doExpand variable and wired them into the ExpandComponent

          Show
          Joel Bernstein added a comment - Added ExpandParams and ResponseBuilder.doExpand variable and wired them into the ExpandComponent
          Hide
          Joel Bernstein added a comment -

          New patch, passes all tests and precommit

          Show
          Joel Bernstein added a comment - New patch, passes all tests and precommit
          Hide
          Joel Bernstein added a comment -

          Changed "expanded" output from a NamedList to a Map. This was done because the expanded groups are not designed to be an ordered list. The documents within the groups are ordered SolrDocumentList, but the groups themselves are designed to be referenced by group name from the main collapsed result list. So, applications will iterate the main collapsed result list and lookup the expanded groups in the expanded Map.

          Also beefed up the distributed test cases.

          Show
          Joel Bernstein added a comment - Changed "expanded" output from a NamedList to a Map. This was done because the expanded groups are not designed to be an ordered list. The documents within the groups are ordered SolrDocumentList, but the groups themselves are designed to be referenced by group name from the main collapsed result list. So, applications will iterate the main collapsed result list and lookup the expanded groups in the expanded Map. Also beefed up the distributed test cases.
          Hide
          Joel Bernstein added a comment -

          New implementation, much cleaner.

          Show
          Joel Bernstein added a comment - New implementation, much cleaner.
          Hide
          Joel Bernstein added a comment -

          Removed the ID lookups during a distributed search as this is already being done in the QueryComponent. Now the ExpandComponent uses the DocList provided by the QueryComponent in both distributed and non-distributed situations.

          Show
          Joel Bernstein added a comment - Removed the ID lookups during a distributed search as this is already being done in the QueryComponent. Now the ExpandComponent uses the DocList provided by the QueryComponent in both distributed and non-distributed situations.
          Hide
          Joel Bernstein added a comment -

          Initial patch created from trunk

          Show
          Joel Bernstein added a comment - Initial patch created from trunk

            People

            • Assignee:
              Joel Bernstein
              Reporter:
              Joel Bernstein
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development