fix distributed facet counts when field may not exist in shard

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@638444 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2008-03-18 17:16:05 +00:00
parent b331ca07fa
commit 160f664e5f
3 changed files with 3 additions and 2 deletions

View File

@ -206,7 +206,7 @@ New Features
query faceting, highlighting, and debug information are supported
in distributed mode.
(Sharad Agarwal, Patrick O'Leary, Sabyasachi Dalal, Stu Hood,
ryan, yonik)
Jayson Minard, ryan, yonik)
41. SOLR-356: Pluggable functions (value sources) that allow
registration of new functions via solrconfig.xml

View File

@ -233,7 +233,7 @@ public class FacetComponent extends SearchComponent
for (DistribFieldFacet dff : fi.topFacets.values()) {
ShardFacetCount[] counts = dff.getSorted();
int ntop = Math.min(counts.length, dff.offset + dff.limit);
long smallestCount = counts[ntop-1].count;
long smallestCount = counts.length == 0 ? 0 : counts[ntop-1].count;
for (int i=0; i<counts.length; i++) {
ShardFacetCount sfc = counts[i];

View File

@ -477,6 +477,7 @@ public class TestDistributedSearch extends TestCase {
query("q","*:*", "rows",100, "facet","true", "facet.query","quick", "facet.query","all", "facet.query","*:*");
query("q","*:*", "rows",100, "facet","true", "facet.field",t1, "facet.offset",1);
query("q","*:*", "rows",100, "facet","true", "facet.field",t1,"facet.mincount",2);
query("q","*:*", "rows",100, "facet","true", "facet.field","missing_field_t","facet.mincount",2);
// index the same document to two servers and make sure things