@Override public SortedDocValues getSorted(FieldInfo field) throws IOException { return reader.getSortedDocValues(field.name); }
@Override public SortedDocValues getSortedDocValues(final String field) throws IOException { return isMeta(field) ? in.getSortedDocValues(field) : null; }
@Override public SortedDocValues getSortedDocValues(String field) throws IOException { ensureOpen(); return in.getSortedDocValues(field); }
@Override public SortedDocValues getSortedDocValues(String field) throws IOException { ensureOpen(); LeafReader reader = fieldToReader.get(field); return reader == null ? null : reader.getSortedDocValues(field); }
/** * Returns SortedDocValues for the field, or {@link #emptySorted} if it has none. * @return docvalues instance, or an empty instance if {@code field} does not exist in this reader. * @throws IllegalStateException if {@code field} exists, but was not indexed with docvalues. * @throws IllegalStateException if {@code field} has docvalues, but the type is not {@link DocValuesType#SORTED}. * @throws IOException if an I/O error occurs. */ public static SortedDocValues getSorted(LeafReader reader, String field) throws IOException { SortedDocValues dv = reader.getSortedDocValues(field); if (dv == null) { checkField(reader, field, DocValuesType.SORTED); return emptySorted(); } else { return dv; } }
@Override public SortedDocValues getSortedDocValues(String field) throws IOException { SortedDocValues oldDocValues = in.getSortedDocValues(field); if (oldDocValues == null) { return null; } int[] ords; synchronized (cachedSortedDVs) { ords = cachedSortedDVs.get(field); if (ords == null) { ords = new int[maxDoc()]; Arrays.fill(ords, -1); int docID; while ((docID = oldDocValues.nextDoc()) != NO_MORE_DOCS) { int newDocID = docMap.oldToNew(docID); ords[newDocID] = oldDocValues.ordValue(); } cachedSortedDVs.put(field, ords); } } return new SortingSortedDocValues(oldDocValues, ords); }
/** * Returns BinaryDocValues for the field, or {@link #emptyBinary} if it has none. * @return docvalues instance, or an empty instance if {@code field} does not exist in this reader. * @throws IllegalStateException if {@code field} exists, but was not indexed with docvalues. * @throws IllegalStateException if {@code field} has docvalues, but the type is not {@link DocValuesType#BINARY} * or {@link DocValuesType#SORTED}. * @throws IOException if an I/O error occurs. */ public static BinaryDocValues getBinary(LeafReader reader, String field) throws IOException { BinaryDocValues dv = reader.getBinaryDocValues(field); if (dv == null) { dv = reader.getSortedDocValues(field); if (dv == null) { checkField(reader, field, DocValuesType.BINARY, DocValuesType.SORTED); return emptyBinary(); } } return dv; }
/** * Returns SortedSetDocValues for the field, or {@link #emptySortedSet} if it has none. * @return docvalues instance, or an empty instance if {@code field} does not exist in this reader. * @throws IllegalStateException if {@code field} exists, but was not indexed with docvalues. * @throws IllegalStateException if {@code field} has docvalues, but the type is not {@link DocValuesType#SORTED_SET} * or {@link DocValuesType#SORTED}. * @throws IOException if an I/O error occurs. */ public static SortedSetDocValues getSortedSet(LeafReader reader, String field) throws IOException { SortedSetDocValues dv = reader.getSortedSetDocValues(field); if (dv == null) { SortedDocValues sorted = reader.getSortedDocValues(field); if (sorted == null) { checkField(reader, field, DocValuesType.SORTED, DocValuesType.SORTED_SET); return emptySortedSet(); } dv = singleton(sorted); } return dv; }
return null; } else if (size == 1) { return leaves.get(0).reader().getSortedDocValues(field); for (int i = 0; i < size; i++) { LeafReaderContext context = leaves.get(i); SortedDocValues v = context.reader().getSortedDocValues(field); if (v == null) { v = DocValues.emptySorted();
break; case SORTED: iterator = reader.getSortedDocValues(field); break; case SORTED_NUMERIC:
break; case SORTED: reader.getSortedDocValues(info.name); break; case SORTED_NUMERIC:
public static String getParentId(ParentFieldMapper fieldMapper, LeafReader reader, int docId) { try { SortedDocValues docValues = reader.getSortedDocValues(fieldMapper.name()); if (docValues == null || docValues.advanceExact(docId) == false) { // hit has no _parent field. return null; } BytesRef parentId = docValues.binaryValue(); return parentId.length > 0 ? parentId.utf8ToString() : null; } catch (IOException e) { throw ExceptionsHelper.convertToElastic(e); } } }
return null; SortedDocValues v = reader.getSortedDocValues(field); if (v == null) { v = DocValues.emptySorted();
docValuesMap.clear(); for (String field : parentFields) { docValuesMap.put(field, subReaderContext.reader().getSortedDocValues(field));
@Override protected final boolean init(LeafReaderContext context) throws IOException { sdv = context.reader().getSortedDocValues(field); return sdv != null; }
@Override public SortedDocValues getSortedDocValues(String field) throws IOException { ensureOpen(); LeafReader reader = fieldToReader.get(field); return reader == null ? null : reader.getSortedDocValues(field); }
@Override public SortedDocValues getSortedDocValues(String field) throws IOException { ensureOpen(); return in.getSortedDocValues(field); }
@Override public SortedDocValues getSortedDocValues(String field) throws IOException { SortedDocValues sortedDV = in.getSortedDocValues(field); if (sortedDV == null) { return null; } else { return new SortingSortedDocValues(sortedDV, docMap); } }
@Override public SortedDocValues getSortedDocValues(String field) throws IOException { ensureOpen(); return in.getSortedDocValues(field); }
@Override public void doSetNextReader(LeafReaderContext context) throws IOException { this.dataValues.hash = context.reader().getBinaryDocValues(Monitor.FIELDS.hash); this.dataValues.id = context.reader().getSortedDocValues(Monitor.FIELDS.id); this.dataValues.mq = context.reader().getBinaryDocValues(Monitor.FIELDS.mq); }