stefanvodita commented on code in PR #13494:
URL: https://github.com/apache/lucene/pull/13494#discussion_r1643509094


##########
lucene/facet/src/java/org/apache/lucene/facet/StringValueFacetCounts.java:
##########
@@ -154,7 +154,7 @@ public FacetResult getAllChildren(String dim, String... 
path) throws IOException
         final BytesRef term = docValues.lookupOrd(sparseCount.key);
         labelValues.add(new LabelAndValue(term.utf8ToString(), count));
       }
-    } else {

Review Comment:
   I'm warming up to the current solution, since this case looks unique among 
other facets implementations, but we would also have to update the return 
statement in `getSpecificValue` and add it and `getAllChildren` to the test.



##########
lucene/facet/src/test/org/apache/lucene/facet/TestStringValueFacetCounts.java:
##########
@@ -80,6 +79,31 @@ public void testBasicSingleValued() throws Exception {
     IOUtils.close(searcher.getIndexReader(), dir);
   }
 
+  public void testNarrowSingleValued() throws Exception {

Review Comment:
   Thank you for the test! Can we rename it to something more precise, maybe 
`testEmptyMatchSet` or something along those lines?



##########
lucene/facet/src/test/org/apache/lucene/facet/TestStringValueFacetCounts.java:
##########
@@ -80,6 +79,31 @@ public void testBasicSingleValued() throws Exception {
     IOUtils.close(searcher.getIndexReader(), dir);
   }
 
+  public void testNarrowSingleValued() throws Exception {
+    Directory dir = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
+
+    Document doc = new Document();
+    doc.add(new SortedSetDocValuesField("field", new BytesRef("foo")));
+    writer.addDocument(doc);
+
+    IndexSearcher searcher = newSearcher(writer.getReader());
+    writer.close();
+
+    TopScoreDocCollectorManager docCollector = new 
TopScoreDocCollectorManager(10, 10);

Review Comment:
   Can we simplify and just have the `FacetsCollector`?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to