@Override SortedSetDocValues getValues(LeafReader reader, String field) throws IOException { return DocValues.getSortedSet(reader, field); } };
@Override protected SortedDocValues getSortedDocValues(LeafReaderContext context, String field) throws IOException { return SortedSetSelector.wrap(DocValues.getSortedSet(context.reader(), field), selector); } };
@Override public Matches matches(LeafReaderContext context, int doc) throws IOException { final SortedSetDocValues fcsi = DocValues.getSortedSet(context.reader(), query.field); return MatchesUtils.forField(query.field, () -> DisjunctionMatchesIterator.fromTermsEnum(context, doc, query, query.field, getTermsEnum(fcsi))); }
/** Wraps a {@link SortedSetDocValues} as a single-valued view if the field is an instance of {@link SortedSetSortField}, * returns {@link SortedDocValues} for the field otherwise. */ static SortedDocValues getOrWrapSorted(LeafReader reader, SortField sortField) throws IOException { if (sortField instanceof SortedSetSortField) { SortedSetSortField sf = (SortedSetSortField) sortField; return SortedSetSelector.wrap(DocValues.getSortedSet(reader, sf.getField()), sf.getSelector()); } else { return DocValues.getSorted(reader, sortField.getField()); } }
@Override public SortedSetDocValues getOrdinalsValues() { try { return DocValues.getSortedSet(reader, field); } catch (IOException e) { throw new IllegalStateException("cannot load docvalues", e); } }
@Override public Scorer scorer(LeafReaderContext context) throws IOException { final SortedSetDocValues fcsi = DocValues.getSortedSet(context.reader(), query.field); TermsEnum termsEnum = getTermsEnum(fcsi); assert termsEnum != null;
final SortedSetDocValues sorted = DocValues.getSortedSet(reader, field); values = DocValues.unwrapSingleton(sorted); if (values == null) {
@Override public SortedSetDocValues apply(LeafReader ctx) throws IOException { return DocValues.getSortedSet(ctx, field); } };
@Override SortedSetDocValues getValues(LeafReader reader, String field) throws IOException { return DocValues.getSortedSet(reader, field); } };
@Override public SortedSetDocValues getOrdinalsValues() { try { return DocValues.getSortedSet(reader, field); } catch (IOException e) { throw new IllegalStateException("cannot load docvalues", e); } }
@Override public SortedSetDocValues getOrdinalsValues() { try { return DocValues.getSortedSet(reader, field); } catch (IOException e) { throw new IllegalStateException("cannot load docvalues", e); } }
@Override public RandomAccessOrds getOrdinalsValues() { try { return FieldData.maybeSlowRandomAccessOrds(DocValues.getSortedSet(reader, field)); } catch (IOException e) { throw new IllegalStateException("cannot load docvalues", e); } }
@Override public RandomAccessOrds getOrdinalsValues() { try { return FieldData.maybeSlowRandomAccessOrds(DocValues.getSortedSet(reader, field)); } catch (IOException e) { throw new IllegalStateException("cannot load docvalues", e); } }
@Override protected SortedDocValues getSortedDocValues(LeafReaderContext context, String field) throws IOException { return SortedSetSelector.wrap(DocValues.getSortedSet(context.reader(), field), selector); } };
@Override protected SortedDocValues getSortedDocValues(LeafReaderContext context, String field) throws IOException { SortedSetDocValues sortedSet = DocValues.getSortedSet(context.reader(), field); return SortedSetSelector.wrap(sortedSet, selector); } };
@Override protected SortedDocValues getSortedDocValues(LeafReaderContext context, String field) throws IOException { SortedSetDocValues sortedSet = DocValues.getSortedSet(context.reader(), field); return SortedSetSelector.wrap(sortedSet, selector); } };
@Override public FunctionValues getValues(Map context, LeafReaderContext readerContext) throws IOException { SortedSetDocValues sortedSet = DocValues.getSortedSet(readerContext.reader(), field); SortedDocValues view = SortedSetSelector.wrap(sortedSet, selector); return new DocTermsIndexDocValues(this.field, this, view) { @Override protected String toTerm(String readableValue) { return readableValue; } @Override public Object objectVal(int doc) throws IOException { return strVal(doc); } }; }
@Override public Matches matches(LeafReaderContext context, int doc) throws IOException { final SortedSetDocValues fcsi = DocValues.getSortedSet(context.reader(), query.field); return MatchesUtils.forField(query.field, () -> DisjunctionMatchesIterator.fromTermsEnum(context, doc, query, query.field, getTermsEnum(fcsi))); }
/** Wraps a {@link SortedSetDocValues} as a single-valued view if the field is an instance of {@link SortedSetSortField}, * returns {@link SortedDocValues} for the field otherwise. */ static SortedDocValues getOrWrapSorted(LeafReader reader, SortField sortField) throws IOException { if (sortField instanceof SortedSetSortField) { SortedSetSortField sf = (SortedSetSortField) sortField; return SortedSetSelector.wrap(DocValues.getSortedSet(reader, sf.getField()), sf.getSelector()); } else { return DocValues.getSorted(reader, sortField.getField()); } }
@Override protected SortedDocValues getSortedDocValues(LeafReaderContext context, String field) throws IOException { SortedSetDocValues sortedSet = DocValues.getSortedSet(context.reader(), field); final BlockJoinSelector.Type type = order ? BlockJoinSelector.Type.MAX : BlockJoinSelector.Type.MIN; final BitSet parents = parentFilter.getBitSet(context); final BitSet children = childFilter.getBitSet(context); if (children == null) { return DocValues.emptySorted(); } return BlockJoinSelector.wrap(sortedSet, type, parents, children); }