FieldCache.DEFAULT.getDocTermOrds(ar, "binary");
fail();
} catch (IllegalStateException expected) {}
try {
new DocTermOrds(ar, null, "binary");
fail();
} catch (IllegalStateException expected) {}
Bits bits = FieldCache.DEFAULT.getDocsWithField(ar, "binary");
assertTrue(bits instanceof Bits.MatchAllBits);
// Sorted type: can be retrieved via getTerms(), getTermsIndex(), getDocTermOrds()
try {
FieldCache.DEFAULT.getInts(ar, "sorted", false);
fail();
} catch (IllegalStateException expected) {}
try {
new DocTermOrds(ar, null, "sorted");
fail();
} catch (IllegalStateException expected) {}
binary = FieldCache.DEFAULT.getTerms(ar, "sorted");
binary.get(0, scratch);
assertEquals("sorted value", scratch.utf8ToString());
SortedDocValues sorted = FieldCache.DEFAULT.getTermsIndex(ar, "sorted");
assertEquals(0, sorted.getOrd(0));
assertEquals(1, sorted.getValueCount());
sorted.get(0, scratch);
assertEquals("sorted value", scratch.utf8ToString());
SortedSetDocValues sortedSet = FieldCache.DEFAULT.getDocTermOrds(ar, "sorted");
sortedSet.setDocument(0);
assertEquals(0, sortedSet.nextOrd());
assertEquals(SortedSetDocValues.NO_MORE_ORDS, sortedSet.nextOrd());
assertEquals(1, sortedSet.getValueCount());
bits = FieldCache.DEFAULT.getDocsWithField(ar, "sorted");
assertTrue(bits instanceof Bits.MatchAllBits);
// Numeric type: can be retrieved via getInts() and so on
Ints numeric = FieldCache.DEFAULT.getInts(ar, "numeric", false);
assertEquals(42, numeric.get(0));
try {
FieldCache.DEFAULT.getTerms(ar, "numeric");
fail();
} catch (IllegalStateException expected) {}
try {
FieldCache.DEFAULT.getTermsIndex(ar, "numeric");
fail();
} catch (IllegalStateException expected) {}
try {
FieldCache.DEFAULT.getDocTermOrds(ar, "numeric");
fail();
} catch (IllegalStateException expected) {}
try {
new DocTermOrds(ar, null, "numeric");
fail();
} catch (IllegalStateException expected) {}
bits = FieldCache.DEFAULT.getDocsWithField(ar, "numeric");
assertTrue(bits instanceof Bits.MatchAllBits);
// SortedSet type: can be retrieved via getDocTermOrds()
if (defaultCodecSupportsSortedSet()) {
try {
FieldCache.DEFAULT.getInts(ar, "sortedset", false);
fail();
} catch (IllegalStateException expected) {}
try {
FieldCache.DEFAULT.getTerms(ar, "sortedset");
fail();
} catch (IllegalStateException expected) {}
try {
FieldCache.DEFAULT.getTermsIndex(ar, "sortedset");
fail();
} catch (IllegalStateException expected) {}
try {
new DocTermOrds(ar, null, "sortedset");
fail();
} catch (IllegalStateException expected) {}
sortedSet = FieldCache.DEFAULT.getDocTermOrds(ar, "sortedset");
sortedSet.setDocument(0);