You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mk...@apache.org on 2016/08/19 14:02:52 UTC

lucene-solr:branch_6x: SOLR-8644: Test asserts that block join facets work with parent level fq exclusions

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x bff472cb4 -> 082f36e01


SOLR-8644: Test asserts that block join facets work with parent level fq exclusions


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/082f36e0
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/082f36e0
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/082f36e0

Branch: refs/heads/branch_6x
Commit: 082f36e0127dbf51c5575d4de42e432fcf0a1324
Parents: bff472c
Author: Mikhail Khludnev <mk...@apache.org>
Authored: Fri Aug 19 16:50:22 2016 +0300
Committer: Mikhail Khludnev <mk...@apache.org>
Committed: Fri Aug 19 16:56:56 2016 +0300

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  2 ++
 .../search/join/BlockJoinFacetSimpleTest.java   | 24 ++++++++++++++++++++
 2 files changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/082f36e0/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 21b025a..41e4d40 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -254,6 +254,8 @@ Other Changes
 
 * SOLR-8643: BlockJoinFacetComponent is substituted by BlockJoinFacetDocSetComponent. It doesn't need to change solrconfig.xml (Mikhail Khludnev)
 
+* SOLR-8644: Test asserts that block join facets work with parent level fq exclusions. (Dr. Oleg Savrasov via Mikhail Khludnev) 
+
 ==================  6.1.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/082f36e0/solr/core/src/test/org/apache/solr/search/join/BlockJoinFacetSimpleTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/join/BlockJoinFacetSimpleTest.java b/solr/core/src/test/org/apache/solr/search/join/BlockJoinFacetSimpleTest.java
index a34e1d9..5e610cf 100644
--- a/solr/core/src/test/org/apache/solr/search/join/BlockJoinFacetSimpleTest.java
+++ b/solr/core/src/test/org/apache/solr/search/join/BlockJoinFacetSimpleTest.java
@@ -22,6 +22,7 @@ import java.util.Collections;
 import java.util.List;
 
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.request.SolrQueryRequest;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -94,4 +95,27 @@ public class BlockJoinFacetSimpleTest extends SolrTestCaseJ4 {
     }
   }
 
+  @Test
+  public void testParentLevelFQExclusion() {
+    SolrQueryRequest req = req(
+        "qt", handler,
+        "q", "{!parent which=type_s:parent}+SIZE_s:XL",
+        "fq", "{!term f=BRAND_s tag=rbrand}Nike",
+        "facet", "true",
+        "facet.field", "BRAND_s",
+        "child.facet.field", "COLOR_s");
+    assertQ("no exclusion, brand facet got only one Nike",req, "//*[@numFound='" + 1 + "']",
+        "count(//lst[@name='BRAND_s']/int[.='1'])=1");
+  
+    assertQ("nike filter is excluded, expecting both brand in facet",req(
+        "qt", handler,
+        "q", "{!parent which=type_s:parent}+SIZE_s:XL",
+        "fq", "{!term f=BRAND_s tag=rbrand}Nike",
+        "facet", "true",
+        "facet.field", "{!ex=rbrand}BRAND_s",
+        "child.facet.field", "COLOR_s"),
+     "//*[@numFound='" + 1 + "']",
+        "count(//lst[@name='BRAND_s']/int[.='1'])=2");
+  
+  }
 }