SOLR-8341: fix parsing of domain:{excludeTags:mytag}

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1716523 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2015-11-25 19:51:08 +00:00
parent c862370abe
commit 45aef9f26d
3 changed files with 10 additions and 6 deletions

View File

@ -425,6 +425,10 @@ Bug Fixes
* SOLR-7169: bin/solr status should return exit code 3, not 0 if Solr is not running
(Dominik Siebel via Timothy Potter)
* SOLR-8341: Fix JSON Facet API excludeTags when specified in the
form of domain:{excludeTags:mytag} (yonik)
Optimizations
----------------------

View File

@ -295,7 +295,7 @@ abstract class FacetParser<FacetRequestT extends FacetRequest> {
Map<String,Object> domainMap = (Map<String,Object>) m.get("domain");
if (domainMap != null) {
excludeTags = getStringList(m, "excludeTags");
excludeTags = getStringList(domainMap, "excludeTags");
if (excludeTags != null) {
getDomain().excludeTags = excludeTags;
}

View File

@ -940,14 +940,14 @@ public class TestJsonFacets extends SolrTestCaseHS {
"}"
);
// terms facet with nested query facet (with excludeTags)
// terms facet with nested query facet (with excludeTags, using new format inside domain:{})
client.testJQ(params(p, "q", "*:*", "fq", "{!tag=doc6,allfilt}-id:6", "fq","{!tag=doc3,allfilt}-id:3"
, "json.facet", "{processEmpty:true, " +
" f0:{${terms} type:terms, field:${cat_s}, facet:{nj:{query:'${where_s}:NJ'}} } " +
",f1:{${terms} type:terms, field:${cat_s}, excludeTags:doc3, missing:true, facet:{nj:{query:'${where_s}:NJ'}} } " +
",f2:{${terms} type:terms, field:${cat_s}, excludeTags:allfilt,missing:true, facet:{nj:{query:'${where_s}:NJ'}} } " +
",f3:{${terms} type:terms, field:${cat_s}, excludeTags:doc6, missing:true, facet:{nj:{query:'${where_s}:NJ'}} } " +
",f1:{${terms} type:terms, field:${cat_s}, domain:{excludeTags:doc3}, missing:true, facet:{nj:{query:'${where_s}:NJ'}} } " +
",f2:{${terms} type:terms, field:${cat_s}, domain:{excludeTags:allfilt},missing:true, facet:{nj:{query:'${where_s}:NJ'}} } " +
",f3:{${terms} type:terms, field:${cat_s}, domain:{excludeTags:doc6}, missing:true, facet:{nj:{query:'${where_s}:NJ'}} } " +
"}"
)
, "facets=={ count:4, " +
@ -961,7 +961,7 @@ public class TestJsonFacets extends SolrTestCaseHS {
// range facet with sub facets and stats, with "other:all" (with excludeTags)
client.testJQ(params(p, "q", "*:*", "fq", "{!tag=doc6,allfilt}-id:6", "fq","{!tag=doc3,allfilt}-id:3"
, "json.facet", "{processEmpty:true " +
", f1:{type:range, field:${num_d}, start:-5, end:10, gap:5, other:all, facet:{ x:'sum(${num_i})', ny:{query:'${where_s}:NY'}} , excludeTags:allfilt }" +
", f1:{type:range, field:${num_d}, start:-5, end:10, gap:5, other:all, facet:{ x:'sum(${num_i})', ny:{query:'${where_s}:NY'}} , domain:{excludeTags:allfilt} }" +
", f2:{type:range, field:${num_d}, start:-5, end:10, gap:5, other:all, facet:{ x:'sum(${num_i})', ny:{query:'${where_s}:NY'}} }" +
"}"
)