LUCENE-5666: still return missing count etc when there are no terms

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene5666@1594445 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2014-05-14 01:57:38 +00:00
parent fe8dd29a74
commit cce7c4db9c
1 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ public class DocValuesStats {
// TODO: remove multiValuedFieldCache(), check dv type / uninversion type?
final boolean multiValued = schemaField.multiValued() || ft.multiValuedFieldCache();
final SortedSetDocValues si; // for term lookups only
SortedSetDocValues si; // for term lookups only
OrdinalMap ordinalMap = null; // for mapping per-segment ords to global ones
if (multiValued) {
si = searcher.getAtomicReader().getSortedSetDocValues(fieldName);
@ -84,7 +84,7 @@ public class DocValuesStats {
}
}
if (si == null) {
return res;
si = DocValues.EMPTY_SORTED_SET;
}
if (si.getValueCount() >= Integer.MAX_VALUE) {
throw new UnsupportedOperationException("Currently this stats method is limited to " + Integer.MAX_VALUE + " unique terms");