mirror of https://github.com/apache/lucene.git
FieldCacheImpl#getTermsIndex: throw an exception when the field is not indexed and has unsorted doc values.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1438594 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b7bcad0360
commit
f7db724186
|
@ -1036,6 +1036,13 @@ class FieldCacheImpl implements FieldCache {
|
|||
// per-thread by SegmentReader):
|
||||
return valuesIn;
|
||||
} else {
|
||||
final FieldInfo info = reader.getFieldInfos().fieldInfo(field);
|
||||
if (info != null && !info.isIndexed() && info.hasDocValues()) {
|
||||
// we don't try to build a sorted instance from numeric/binary doc
|
||||
// values because dedup can be very costly
|
||||
throw new IllegalArgumentException("Cannot get terms index for \"" + field
|
||||
+ "\": it isn't indexed and doesn't have sorted doc values");
|
||||
}
|
||||
return (SortedDocValues) caches.get(SortedDocValues.class).get(reader, new CacheKey(field, acceptableOverheadRatio), false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue