You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/03/10 13:35:36 UTC

[GitHub] [lucene-solr] ameliahenderson opened a new pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

ameliahenderson opened a new pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334
 
 
   <!--
   _(If you are a project committer then you may remove some/all of the following template.)_
   
   Before creating a pull request, please file an issue in the ASF Jira system for Lucene or Solr:
   
   * https://issues.apache.org/jira/projects/LUCENE
   * https://issues.apache.org/jira/projects/SOLR
   
   You will need to create an account in Jira in order to create an issue.
   
   The title of the PR should reference the Jira issue number in the form:
   
   * LUCENE-####: <short description of problem or changes>
   * SOLR-####: <short description of problem or changes>
   
   LUCENE and SOLR must be fully capitalized. A short description helps people scanning pull requests for items they can work on.
   
   Properly referencing the issue in the title ensures that Jira is correctly updated with code review comments and commits. -->
   
   
   # Description
   
   Please provide a short description of the changes you're making with this pull request.
   
   # Solution
   
   Please provide a short description of the approach taken to implement your solution.
   
   # Tests
   
   Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [x] I have created a Jira issue and added the issue ID to my pull request title.
   - [ ] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
   - [x] I have developed this patch against the `master` branch.
   - [x] I have run `ant precommit` and the appropriate test suite.
   - [x] I have added tests for my changes.
   - [ ] I have added documentation for the [Ref Guide](https://github.com/apache/lucene-solr/tree/master/solr/solr-ref-guide) (for Solr changes only).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#discussion_r392042877
 
 

 ##########
 File path: solr/CHANGES.txt
 ##########
 @@ -114,6 +114,8 @@ Improvements
 * SOLR-13965: In GraphHandler, support <expressible> configuration and deprecate <streamFunctions> configuration.
    (Eric Pugh via Christine Poerschke)
 
+* SOLR-8306: Enhance ExpandComponent to allow expand.hits=0 (Marshall Sanders, Amelia Henderson)
 
 Review comment:
   This should be in 8.6 probably in optimization section

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] ameliahenderson commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
ameliahenderson commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#discussion_r393101862
 
 

 ##########
 File path: solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java
 ##########
 @@ -153,6 +153,23 @@ public void test() throws Exception {
     assertExpandGroupCountAndOrder("group3", 1, results, "9");
     assertExpandGroupCountAndOrder("group4", 1, results, "14");
 
+    //Test expand.rows = 0 - no docs only expand count
+
+    params = new ModifiableSolrParams();
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] munendrasn commented on issue #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
munendrasn commented on issue #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#issuecomment-599875285
 
 
   I had to rebase with master due to some conflicts

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#discussion_r393126595
 
 

 ##########
 File path: solr/solr-ref-guide/src/collapse-and-expand-results.adoc
 ##########
 @@ -142,6 +142,8 @@ The “expand=true” parameter turns on the ExpandComponent. The ExpandComponen
 
 Inside the expanded section there is a _map_ with each group head pointing to the expanded documents that are within the group. As applications iterate the main collapsed result set, they can access the _expanded_ map to retrieve the expanded groups.
 
+If you would like to have only the number of documents found from the groups in the expanded section returned and not the actual documents, you can set "expand.rows=0". Note that when using "expand.rows=0", score won’t be computed for the expanded section even when requested so maxScore will not be available.
 
 Review comment:
   Thanks for the documentation update. I think this should be part of `expand.rows=0`. Something like this https://github.com/apache/lucene-solr/pull/1334/files#diff-9c5999131702feec07a6b7057fa3bcd7R23
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] ameliahenderson commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
ameliahenderson commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#discussion_r393158282
 
 

 ##########
 File path: solr/solr-ref-guide/src/collapse-and-expand-results.adoc
 ##########
 @@ -142,6 +142,8 @@ The “expand=true” parameter turns on the ExpandComponent. The ExpandComponen
 
 Inside the expanded section there is a _map_ with each group head pointing to the expanded documents that are within the group. As applications iterate the main collapsed result set, they can access the _expanded_ map to retrieve the expanded groups.
 
+If you would like to have only the number of documents found from the groups in the expanded section returned and not the actual documents, you can set "expand.rows=0". Note that when using "expand.rows=0", score won’t be computed for the expanded section even when requested so maxScore will not be available.
 
 Review comment:
   Updated. Please let me know if it's still in wrong place

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#discussion_r393125271
 
 

 ##########
 File path: solr/CHANGES.txt
 ##########
 @@ -57,7 +57,7 @@ Improvements
 
 Optimizations
 ---------------------
-(No changes)
+* SOLR-8306: Enhance ExpandComponent to allow expand.hits=0 (Marshall Sanders, Amelia Henderson)
 
 Review comment:
   Maybe change the wording here, something like `Do not collect expand documents when expand.rows=0`
   there is no `expand.hits` parameter

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] munendrasn merged pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
munendrasn merged pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#discussion_r392044537
 
 

 ##########
 File path: solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java
 ##########
 @@ -153,6 +153,23 @@ public void test() throws Exception {
     assertExpandGroupCountAndOrder("group3", 1, results, "9");
     assertExpandGroupCountAndOrder("group4", 1, results, "14");
 
+    //Test expand.rows = 0 - no docs only expand count
+
+    params = new ModifiableSolrParams();
 
 Review comment:
   Is it possible to add a case w/o collapse too (with expand.field) and with fl with and w/o `score`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] ameliahenderson commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
ameliahenderson commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#discussion_r393101812
 
 

 ##########
 File path: solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java
 ##########
 @@ -234,6 +234,21 @@ private void _testExpand(String group, String floatAppend, String hint) throws E
         "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/str[@name='id'][.='8']"
     );
 
+    //Test expand.rows = 0 - no docs only expand count
+    params = new ModifiableSolrParams();
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] ameliahenderson commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
ameliahenderson commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#discussion_r393158074
 
 

 ##########
 File path: solr/CHANGES.txt
 ##########
 @@ -57,7 +57,7 @@ Improvements
 
 Optimizations
 ---------------------
-(No changes)
+* SOLR-8306: Enhance ExpandComponent to allow expand.hits=0 (Marshall Sanders, Amelia Henderson)
 
 Review comment:
   Thanks for that. updated

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#discussion_r392043974
 
 

 ##########
 File path: solr/core/src/java/org/apache/solr/search/DocSlice.java
 ##########
 @@ -56,7 +56,7 @@ public DocSlice(int offset, int len, int[] docs, float[] scores, long matches, f
     this.scores=scores;
     this.matches=matches;
     this.maxScore=maxScore;
-    this.ramBytesUsed = BASE_RAM_BYTES_USED + ((long)docs.length << 2) + (scores == null ? 0 : ((long)scores.length<<2)+RamUsageEstimator.NUM_BYTES_ARRAY_HEADER);
+    this.ramBytesUsed = BASE_RAM_BYTES_USED + (docs == null ? 0 : ((long)docs.length << 2)) + (scores == null ? 0 : ((long)scores.length<<2)+RamUsageEstimator.NUM_BYTES_ARRAY_HEADER);
 
 Review comment:
   👍 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] ameliahenderson commented on issue #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
ameliahenderson commented on issue #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#issuecomment-600253414
 
 
   thanks for taking care of rebase and uploading patch again

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] ameliahenderson commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
ameliahenderson commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#discussion_r393111927
 
 

 ##########
 File path: solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java
 ##########
 @@ -668,6 +676,18 @@ public void collect(int docId) throws IOException {
 
   }
 
+  private static Collector getExpandCollector(int limit, Sort sort) throws IOException {
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#discussion_r392043206
 
 

 ##########
 File path: solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java
 ##########
 @@ -420,37 +421,48 @@ public void process(ResponseBuilder rb) throws IOException {
     CharsRefBuilder charsRef = new CharsRefBuilder();
     for (LongObjectCursor<Collector> cursor : groups) {
       long groupValue = cursor.key;
-      TopDocsCollector<?> topDocsCollector = TopDocsCollector.class.cast(cursor.value);
-      TopDocs topDocs = topDocsCollector.topDocs();
-      ScoreDoc[] scoreDocs = topDocs.scoreDocs;
-      if (scoreDocs.length > 0) {
-        if (returnFields.wantsScore() && sort != null) {
-          TopFieldCollector.populateScores(scoreDocs, searcher, query);
-        }
-        int[] docs = new int[scoreDocs.length];
-        float[] scores = new float[scoreDocs.length];
-        for (int i = 0; i < docs.length; i++) {
-          ScoreDoc scoreDoc = scoreDocs[i];
-          docs[i] = scoreDoc.doc;
-          scores[i] = scoreDoc.score;
+      if (cursor.value instanceof TopDocsCollector) {
+        TopDocsCollector<?> topDocsCollector = TopDocsCollector.class.cast(cursor.value);
+        TopDocs topDocs = topDocsCollector.topDocs();
+        ScoreDoc[] scoreDocs = topDocs.scoreDocs;
+        if (scoreDocs.length > 0) {
+          if (returnFields.wantsScore() && sort != null) {
+            TopFieldCollector.populateScores(scoreDocs, searcher, query);
+          }
+          int[] docs = new int[scoreDocs.length];
+          float[] scores = new float[scoreDocs.length];
+          for (int i = 0; i < docs.length; i++) {
+            ScoreDoc scoreDoc = scoreDocs[i];
+            docs[i] = scoreDoc.doc;
+            scores[i] = scoreDoc.score;
+          }
+          assert topDocs.totalHits.relation == TotalHits.Relation.EQUAL_TO;
+          DocSlice slice = new DocSlice(0, docs.length, docs, scores, topDocs.totalHits.value, Float.NaN);
+          addGroupSliceToOutputMap(fieldType, ordBytes, outMap, charsRef, groupValue, slice);
         }
-        assert topDocs.totalHits.relation == TotalHits.Relation.EQUAL_TO;
-        DocSlice slice = new DocSlice(0, docs.length, docs, scores, topDocs.totalHits.value, Float.NaN);
-
-        if(fieldType instanceof StrField) {
-          final BytesRef bytesRef = ordBytes.get((int)groupValue);
-          fieldType.indexedToReadable(bytesRef, charsRef);
-          String group = charsRef.toString();
-          outMap.add(group, slice);
-        } else {
-          outMap.add(numericToString(fieldType, groupValue), slice);
+      } else {
+        int totalHits = ((TotalHitCountCollector) cursor.value).getTotalHits();
+        if (totalHits > 0) {
+          DocSlice slice = new DocSlice(0, 0, null, null, totalHits, 0);
 
 Review comment:
   Here, maxScore is always 0 even if score is requested and I think this needs to be documented

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#discussion_r392044626
 
 

 ##########
 File path: solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java
 ##########
 @@ -234,6 +234,21 @@ private void _testExpand(String group, String floatAppend, String hint) throws E
         "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/str[@name='id'][.='8']"
     );
 
+    //Test expand.rows = 0 - no docs only expand count
+    params = new ModifiableSolrParams();
 
 Review comment:
   Same as above so that we can cover more cases

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#discussion_r392043916
 
 

 ##########
 File path: solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java
 ##########
 @@ -668,6 +676,18 @@ public void collect(int docId) throws IOException {
 
   }
 
+  private static Collector getExpandCollector(int limit, Sort sort) throws IOException {
 
 Review comment:
   I think this method should be part of `GroupCollector` (default implementation) and method name could simply be `getCollector`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0

Posted by GitBox <gi...@apache.org>.
munendrasn commented on a change in pull request #1334: SOLR-8306: Enhance ExpandComponent to allow expand.hits=0
URL: https://github.com/apache/lucene-solr/pull/1334#discussion_r393132417
 
 

 ##########
 File path: solr/solr-ref-guide/src/collapse-and-expand-results.adoc
 ##########
 @@ -142,6 +142,8 @@ The “expand=true” parameter turns on the ExpandComponent. The ExpandComponen
 
 Inside the expanded section there is a _map_ with each group head pointing to the expanded documents that are within the group. As applications iterate the main collapsed result set, they can access the _expanded_ map to retrieve the expanded groups.
 
+If you would like to have only the number of documents found from the groups in the expanded section returned and not the actual documents, you can set "expand.rows=0". Note that when using "expand.rows=0", score won’t be computed for the expanded section even when requested so maxScore will not be available.
 
 Review comment:
   Example 
   ```
   [IMPORTANT]
   ====
   When `expand.rows=0`, then only the number of documents found for each expanded value is returned. Hence, scores won't be computed even if requested. `maxScore` is set to 0
   ====
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org