mirror of https://github.com/apache/lucene.git
SOLR-10520: fix child.facet.field counts
This commit is contained in:
parent
cd02dd7d4a
commit
680f4d7fd3
|
@ -241,6 +241,7 @@ Bug Fixes
|
|||
when there was a mincount > 1. This has been corrected by changing numBuckets cardinality processing to
|
||||
ignore mincount > 1 for non-distributed requests. (yonik)
|
||||
|
||||
* SOLR-10520: child.facet.field doubled counts at least when rows>0. (Dr. Oleg Savrasov via Mikhail Khludnev)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
|
|
@ -124,11 +124,13 @@ abstract class BlockJoinFacetComponentSupport extends SearchComponent {
|
|||
|
||||
@Override
|
||||
public void handleResponses(ResponseBuilder rb, ShardRequest sreq) {
|
||||
NamedList collectedChildFacetFields = getChildFacetFields(rb.rsp.getValues(), true);
|
||||
List<ShardResponse> responses = sreq.responses;
|
||||
for (ShardResponse shardResponse : responses) {
|
||||
NamedList shardChildFacetFields = getChildFacetFields(shardResponse.getSolrResponse().getResponse(), false);
|
||||
mergeFacets(collectedChildFacetFields, shardChildFacetFields);
|
||||
if ((sreq.purpose & ShardRequest.PURPOSE_GET_TOP_IDS) != 0) {
|
||||
NamedList collectedChildFacetFields = getChildFacetFields(rb.rsp.getValues(), true);
|
||||
List<ShardResponse> responses = sreq.responses;
|
||||
for (ShardResponse shardResponse : responses) {
|
||||
NamedList shardChildFacetFields = getChildFacetFields(shardResponse.getSolrResponse().getResponse(), false);
|
||||
mergeFacets(collectedChildFacetFields, shardChildFacetFields);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -130,12 +130,18 @@ public class BlockJoinFacetDistribTest extends SolrCloudTestCase{
|
|||
|
||||
// to parent query
|
||||
final String childQueryClause = "COLOR_s:("+(matchingColors.toString().replaceAll("[,\\[\\]]", " "))+")";
|
||||
final boolean oldFacetsEnabled = random().nextBoolean();
|
||||
QueryResponse results = query("q", "{!parent which=\"type_s:parent\"}"+childQueryClause,
|
||||
"facet", random().nextBoolean() ? "true":"false",
|
||||
"facet", oldFacetsEnabled ? "true":"false", // try to enforce multiple phases
|
||||
oldFacetsEnabled ? "facet.field" : "ignore" , "BRAND_s",
|
||||
oldFacetsEnabled&&usually() ? "facet.limit" : "ignore" , "1",
|
||||
oldFacetsEnabled&&usually() ? "facet.mincount" : "ignore" , "2",
|
||||
oldFacetsEnabled&&usually() ? "facet.overrequest.count" : "ignore" , "0",
|
||||
"qt", random().nextBoolean() ? "blockJoinDocSetFacetRH" : "blockJoinFacetRH",
|
||||
"child.facet.field", "COLOR_s",
|
||||
"child.facet.field", "SIZE_s",
|
||||
"rows","0" // we care only abt results
|
||||
"distrib.singlePass", random().nextBoolean() ? "true":"false",
|
||||
"rows", random().nextBoolean() ? "0":"10"
|
||||
);
|
||||
NamedList<Object> resultsResponse = results.getResponse();
|
||||
assertNotNull(resultsResponse);
|
||||
|
|
Loading…
Reference in New Issue