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

This commit is contained in:
Mikhail Khludnev 2016-08-19 16:50:22 +03:00
parent f0963b3b4f
commit 2c7d86bc4d
2 changed files with 26 additions and 0 deletions

View File

@ -289,6 +289,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.

View File

@ -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");
}
}