/** * Loads or returns the already loaded the global field number map for this {@link SegmentInfos}. * If this {@link SegmentInfos} has no global field number map the returned instance is empty */ private FieldNumbers getFieldNumberMap() throws IOException { final FieldNumbers map = new FieldNumbers(config.softDeletesField); for(SegmentCommitInfo info : segmentInfos) { FieldInfos fis = readFieldInfos(info); for(FieldInfo fi : fis) { map.addOrGet(fi.name, fi.number, fi.getDocValuesType(), fi.getPointDataDimensionCount(), fi.getPointIndexDimensionCount(), fi.getPointNumBytes(), fi.isSoftDeletesField()); } } return map; }
public FieldInfo add(FieldInfo fi, long dvGen) { // IMPORTANT - reuse the field number if possible for consistent field numbers across segments return addOrUpdateInternal(fi.name, fi.number, fi.hasVectors(), fi.omitsNorms(), fi.hasPayloads(), fi.getIndexOptions(), fi.getDocValuesType(), dvGen, fi.getPointDataDimensionCount(), fi.getPointIndexDimensionCount(), fi.getPointNumBytes(), fi.isSoftDeletesField()); }
writeState.segmentInfo.name, fieldInfo.getPointDataDimensionCount(), fieldInfo.getPointIndexDimensionCount(), fieldInfo.getPointNumBytes(), maxPointsInLeafNode,
writeState.segmentInfo.name, fieldInfo.getPointDataDimensionCount(), fieldInfo.getPointIndexDimensionCount(), fieldInfo.getPointNumBytes(), maxPointsInLeafNode,
for(FieldInfo fi : fis) { globalFieldNumberMap.addOrGet(fi.name, fi.number, fi.getDocValuesType(), fi.getPointDataDimensionCount(), fi.getPointIndexDimensionCount(), fi.getPointNumBytes(), fi.isSoftDeletesField());
output.writeVInt(fi.getPointDataDimensionCount()); if (fi.getPointDataDimensionCount() != 0) { output.writeVInt(fi.getPointIndexDimensionCount()); output.writeVInt(fi.getPointNumBytes());
Tuple<List<BytesRef>, Map<String, List<byte[]>>> extractTermsAndRanges(IndexReader indexReader) throws IOException { List<BytesRef> extractedTerms = new ArrayList<>(); Map<String, List<byte[]>> encodedPointValuesByField = new HashMap<>(); LeafReader reader = indexReader.leaves().get(0).reader(); for (FieldInfo info : reader.getFieldInfos()) { Terms terms = reader.terms(info.name); if (terms != null) { BytesRef fieldBr = new BytesRef(info.name); TermsEnum tenum = terms.iterator(); for (BytesRef term = tenum.next(); term != null; term = tenum.next()) { BytesRefBuilder builder = new BytesRefBuilder(); builder.append(fieldBr); builder.append(FIELD_VALUE_SEPARATOR); builder.append(term); extractedTerms.add(builder.toBytesRef()); } } if (info.getPointIndexDimensionCount() == 1) { // not != 0 because range fields are not supported PointValues values = reader.getPointValues(info.name); List<byte[]> encodedPointValues = new ArrayList<>(); encodedPointValues.add(values.getMinPackedValue().clone()); encodedPointValues.add(values.getMaxPackedValue().clone()); encodedPointValuesByField.put(info.name, encodedPointValues); } } return new Tuple<>(extractedTerms, encodedPointValuesByField); }
Tuple<List<BytesRef>, Map<String, List<byte[]>>> extractTermsAndRanges(IndexReader indexReader) throws IOException { List<BytesRef> extractedTerms = new ArrayList<>(); Map<String, List<byte[]>> encodedPointValuesByField = new HashMap<>(); LeafReader reader = indexReader.leaves().get(0).reader(); for (FieldInfo info : reader.getFieldInfos()) { Terms terms = reader.terms(info.name); if (terms != null) { BytesRef fieldBr = new BytesRef(info.name); TermsEnum tenum = terms.iterator(); for (BytesRef term = tenum.next(); term != null; term = tenum.next()) { BytesRefBuilder builder = new BytesRefBuilder(); builder.append(fieldBr); builder.append(FIELD_VALUE_SEPARATOR); builder.append(term); extractedTerms.add(builder.toBytesRef()); } } if (info.getPointIndexDimensionCount() == 1) { // not != 0 because range fields are not supported PointValues values = reader.getPointValues(info.name); List<byte[]> encodedPointValues = new ArrayList<>(); encodedPointValues.add(values.getMinPackedValue().clone()); encodedPointValues.add(values.getMaxPackedValue().clone()); encodedPointValuesByField.put(info.name, encodedPointValues); } } return new Tuple<>(extractedTerms, encodedPointValuesByField); }
/** * Loads or returns the already loaded the global field number map for this {@link SegmentInfos}. * If this {@link SegmentInfos} has no global field number map the returned instance is empty */ private FieldNumbers getFieldNumberMap() throws IOException { final FieldNumbers map = new FieldNumbers(config.softDeletesField); for(SegmentCommitInfo info : segmentInfos) { FieldInfos fis = readFieldInfos(info); for(FieldInfo fi : fis) { map.addOrGet(fi.name, fi.number, fi.getDocValuesType(), fi.getPointDataDimensionCount(), fi.getPointIndexDimensionCount(), fi.getPointNumBytes(), fi.isSoftDeletesField()); } } return map; }
public FieldInfo add(FieldInfo fi, long dvGen) { // IMPORTANT - reuse the field number if possible for consistent field numbers across segments return addOrUpdateInternal(fi.name, fi.number, fi.hasVectors(), fi.omitsNorms(), fi.hasPayloads(), fi.getIndexOptions(), fi.getDocValuesType(), dvGen, fi.getPointDataDimensionCount(), fi.getPointIndexDimensionCount(), fi.getPointNumBytes(), fi.isSoftDeletesField()); }
info.fieldInfo.name, info.fieldInfo.number, info.fieldInfo.hasVectors(), info.fieldInfo.hasPayloads(), info.fieldInfo.hasPayloads(), info.fieldInfo.getIndexOptions(), docValuesType, -1, info.fieldInfo.attributes(), info.fieldInfo.getPointDataDimensionCount(), info.fieldInfo.getPointIndexDimensionCount(), info.fieldInfo.getPointNumBytes(), info.fieldInfo.isSoftDeletesField() );
writeState.segmentInfo.name, fieldInfo.getPointDataDimensionCount(), fieldInfo.getPointIndexDimensionCount(), fieldInfo.getPointNumBytes(), maxPointsInLeafNode,
writeState.segmentInfo.name, fieldInfo.getPointDataDimensionCount(), fieldInfo.getPointIndexDimensionCount(), fieldInfo.getPointNumBytes(), maxPointsInLeafNode,
writeState.segmentInfo.name, fieldInfo.getPointDataDimensionCount(), fieldInfo.getPointIndexDimensionCount(), fieldInfo.getPointNumBytes(), SimpleTextBKDWriter.DEFAULT_MAX_POINTS_IN_LEAF_NODE,
SimpleTextUtil.write(out, Integer.toString(fi.getPointIndexDimensionCount()), scratch); SimpleTextUtil.writeNewline(out);
for(FieldInfo fi : fis) { globalFieldNumberMap.addOrGet(fi.name, fi.number, fi.getDocValuesType(), fi.getPointDataDimensionCount(), fi.getPointIndexDimensionCount(), fi.getPointNumBytes(), fi.isSoftDeletesField());
output.writeVInt(fi.getPointDataDimensionCount()); if (fi.getPointDataDimensionCount() != 0) { output.writeVInt(fi.getPointIndexDimensionCount()); output.writeVInt(fi.getPointNumBytes());