mkhludnev commented on a change in pull request #1161: SOLR-12325 Added 
uniqueBlockQuery(parent:true) aggregation for JSON Facet
URL: https://github.com/apache/lucene-solr/pull/1161#discussion_r365842011
 
 

 ##########
 File path: solr/core/src/test/org/apache/solr/search/facet/TestJsonFacets.java
 ##########
 @@ -3183,6 +3183,41 @@ public void testUniquesForMethod() throws Exception {
             "    ]}" +
             "}"
     );
+
+    //the same test with uniqueBlockQuery agg function
+    client.testJQ(params(p, "q", "type_s:page"
+        , "json.facet", "{" +
+            "  types: {" +
+            "    type:terms," +
+            "    field:type_s," +
+            "    limit:-1," +
+            "    facet: {" +
+            "           in_books: \"unique(_root_)\" }"+
+            "  }," +
+            "  pages: {" +
+            "    type:terms," +
+            "    field:page_s," +
+            "    limit:-1," +
+            "    facet: {" +
+            "           in_books: \"uniqueBlockQuery(type_s:book)\" }"+
+            "  }" +
+            "}" )
+
+        , "response=={numFound:6,start:0,docs:[]}"
+        , "facets=={ count:6," +
+            "types:{" +
+            "    buckets:[ {val:page, count:6, in_books:2} ]}" +
+            "pages:{" +
+            "    buckets:[ " +
+            "     {val:a, count:1, in_books:1}," +
 
 Review comment:
   asserting equal counts across children and parents is little bit pointless. 
The later, should be smaller than former. 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to