mirror of https://github.com/apache/lucene.git
SOLR-3362: log unexpected term for facet refinement
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1327192 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
19c450884b
commit
6f5930d9b8
|
@ -30,6 +30,8 @@ import org.apache.solr.common.util.StrUtils;
|
||||||
import org.apache.solr.request.SimpleFacets;
|
import org.apache.solr.request.SimpleFacets;
|
||||||
import org.apache.solr.schema.FieldType;
|
import org.apache.solr.schema.FieldType;
|
||||||
import org.apache.solr.search.QueryParsing;
|
import org.apache.solr.search.QueryParsing;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
@ -43,6 +45,8 @@ import java.util.*;
|
||||||
*/
|
*/
|
||||||
public class FacetComponent extends SearchComponent
|
public class FacetComponent extends SearchComponent
|
||||||
{
|
{
|
||||||
|
public static Logger log = LoggerFactory.getLogger(FacetComponent.class);
|
||||||
|
|
||||||
public static final String COMPONENT_NAME = "facet";
|
public static final String COMPONENT_NAME = "facet";
|
||||||
|
|
||||||
static final String PIVOT_KEY = "facet_pivot";
|
static final String PIVOT_KEY = "facet_pivot";
|
||||||
|
@ -486,6 +490,15 @@ public class FacetComponent extends SearchComponent
|
||||||
String name = shardCounts.getName(j);
|
String name = shardCounts.getName(j);
|
||||||
long count = ((Number)shardCounts.getVal(j)).longValue();
|
long count = ((Number)shardCounts.getVal(j)).longValue();
|
||||||
ShardFacetCount sfc = dff.counts.get(name);
|
ShardFacetCount sfc = dff.counts.get(name);
|
||||||
|
if (sfc == null) {
|
||||||
|
// we got back a term we didn't ask for?
|
||||||
|
log.error("Unexpected term returned for facet refining. key=" + key + " term='" + name + "'"
|
||||||
|
+ "\n\trequest params=" + sreq.params
|
||||||
|
+ "\n\ttoRefine=" + dff._toRefine
|
||||||
|
+ "\n\tresponse=" + shardCounts
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
sfc.count += count;
|
sfc.count += count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue