SOLR-5685: fix FieldFacetAccumulator

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1563176 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2014-01-31 16:59:06 +00:00
parent db5964de02
commit f42caf79bd
1 changed files with 15 additions and 7 deletions

View File

@ -117,18 +117,26 @@ public class FieldFacetAccumulator extends ValueAccumulator {
}
} else {
if(numField){
long v = numValues.get(doc);
if( v != 0 || numValuesBits.get(doc) ){
parent.collectField(doc, name, ((NumericParser)parser).parseNum(numValues.get(doc)));
if(numValues != null) {
long v = numValues.get(doc);
if( v != 0 || numValuesBits.get(doc) ){
parent.collectField(doc, name, ((NumericParser)parser).parseNum(v));
} else {
parent.collectField(doc, name, FacetingAccumulator.MISSING_VALUE );
}
} else {
parent.collectField(doc, name, FacetingAccumulator.MISSING_VALUE );
}
} else {
sortValues.get(doc,value);
if( BytesRef.EMPTY_BYTES == value.bytes ){
parent.collectField(doc, name, FacetingAccumulator.MISSING_VALUE );
if(sortValues != null) {
sortValues.get(doc,value);
if( BytesRef.EMPTY_BYTES == value.bytes ){
parent.collectField(doc, name, FacetingAccumulator.MISSING_VALUE );
} else {
parent.collectField(doc, name, parser.parse(value) );
}
} else {
parent.collectField(doc, name, parser.parse(value) );
parent.collectField(doc, name, FacetingAccumulator.MISSING_VALUE );
}
}
}