@Override public NumericDocValues getNormValues( String field ) { return DocValues.emptyNumeric(); }
/** * Returns NumericDocValues for the field, or {@link #emptyNumeric()} 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#NUMERIC}. * @throws IOException if an I/O error occurs. */ public static NumericDocValues getNumeric(LeafReader reader, String field) throws IOException { NumericDocValues dv = reader.getNumericDocValues(field); if (dv == null) { checkField(reader, field, DocValuesType.NUMERIC); return emptyNumeric(); } else { return dv; } }
if (entry.docsWithFieldOffset == -2) { return DocValues.emptyNumeric(); } else if (entry.docsWithFieldOffset == -1) {
private NumericDocValues getNumeric(NumericEntry entry) throws IOException { if (entry.docsWithFieldOffset == -2) { return DocValues.emptyNumeric(); } else if (entry.docsWithFieldOffset == -1) {
return FieldData.replaceMissing(DocValues.emptyNumeric(), missingValue);
DocValuesType type = getDocValuesType(reader, field); if (type == null || type == DocValuesType.NONE) { values = DocValues.emptyNumeric(); return ;
@Override public NumericDocValues getNorms(FieldInfo field) throws IOException { return DocValues.emptyNumeric(); }
@Override public synchronized NumericDocValues getNorms(FieldInfo field) throws IOException { if (UndeadNormsProducer.isUndead(field)) { // Bring undead norms back to life; this is set in Lucene46FieldInfosFormat, to emulate pre-5.0 undead norms return DocValues.emptyNumeric(); } NumericDocValues instance = instances.get(field.name); if (instance == null) { instance = loadNorms(field); if (!merging) { instances.put(field.name, instance); activeCount.incrementAndGet(); } } return instance; }
/** * An empty SortedNumericDocValues which returns zero values for every document */ public static final SortedNumericDocValues emptySortedNumeric(int maxDoc) { return singleton(emptyNumeric(), new Bits.MatchNoBits(maxDoc)); }
@Override public NumericDocValues getNorms(FieldInfo field) throws IOException { if (UndeadNormsProducer.isUndead(field)) { // Bring undead norms back to life; this is set in Lucene40FieldInfosFormat, to emulate pre-5.0 undead norms return DocValues.emptyNumeric(); } return impl.getNumeric(field); }
/** * An empty SortedNumericDocValues which returns zero values for every document */ public static final SortedNumericDocValues emptySortedNumeric(int maxDoc) { return singleton(emptyNumeric(), new Bits.MatchNoBits(maxDoc)); }
@Override public NumericDocValues getNorms(FieldInfo field) throws IOException { if (UndeadNormsProducer.isUndead(field)) { // Bring undead norms back to life; this is set in Lucene42FieldInfosFormat, to emulate pre-5.0 undead norms return DocValues.emptyNumeric(); } return impl.getNumeric(field); }
/** * Returns NumericDocValues for the field, or {@link #emptyNumeric()} 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#NUMERIC}. * @throws IOException if an I/O error occurs. */ public static NumericDocValues getNumeric(LeafReader reader, String field) throws IOException { NumericDocValues dv = reader.getNumericDocValues(field); if (dv == null) { checkField(reader, field, DocValuesType.NUMERIC); return emptyNumeric(); } else { return dv; } }
/** * Returns NumericDocValues for the field, or {@link #emptyNumeric()} 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#NUMERIC}. * @throws IOException if an I/O error occurs. */ public static NumericDocValues getNumeric(LeafReader reader, String field) throws IOException { NumericDocValues dv = reader.getNumericDocValues(field); if (dv == null) { checkField(reader, field, DocValuesType.NUMERIC); return emptyNumeric(); } else { return dv; } }
/** * Returns NumericDocValues for the field, or {@link #emptyNumeric()} 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#NUMERIC}. * @throws IOException if an I/O error occurs. */ public static NumericDocValues getNumeric(LeafReader reader, String field) throws IOException { NumericDocValues dv = reader.getNumericDocValues(field); if (dv == null) { checkField(reader, field, DocValuesType.NUMERIC); return emptyNumeric(); } else { return dv; } }
@Override public NumericDocValues getNumerics(LeafReader reader, String field, Parser parser, boolean setDocsWithField) throws IOException { if (parser == null) { throw new NullPointerException(); } final NumericDocValues valuesIn = reader.getNumericDocValues(field); if (valuesIn != null) { // Not cached here by FieldCacheImpl (cached instead // per-thread by SegmentReader): return valuesIn; } else { final FieldInfo info = reader.getFieldInfos().fieldInfo(field); if (info == null) { return DocValues.emptyNumeric(); } else if (info.getDocValuesType() != DocValuesType.NONE) { throw new IllegalStateException("Type mismatch: " + field + " was indexed as " + info.getDocValuesType()); } else if (info.getIndexOptions() == IndexOptions.NONE) { return DocValues.emptyNumeric(); } return (NumericDocValues) caches.get(Long.TYPE).get(reader, new CacheKey(field, parser), setDocsWithField); } }
@Override protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException { SortedNumericDocValues sortedNumeric = DocValues.getSortedNumeric(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.emptyNumeric(); } return BlockJoinSelector.wrap(sortedNumeric, type, parents, children); } @Override
@Override protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException { SortedNumericDocValues sortedNumeric = DocValues.getSortedNumeric(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.emptyNumeric(); } return BlockJoinSelector.wrap(sortedNumeric, type, parents, children); } @Override
@Override protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException { SortedNumericDocValues sortedNumeric = DocValues.getSortedNumeric(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.emptyNumeric(); } final NumericDocValues view = BlockJoinSelector.wrap(sortedNumeric, type, parents, children); // undo the numericutils sortability return new NumericDocValues() { @Override public long get(int docID) { return NumericUtils.sortableDoubleBits(view.get(docID)); } }; } @Override
@Override protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException { SortedNumericDocValues sortedNumeric = DocValues.getSortedNumeric(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.emptyNumeric(); } final NumericDocValues view = BlockJoinSelector.wrap(sortedNumeric, type, parents, children); // undo the numericutils sortability return new NumericDocValues() { @Override public long get(int docID) { return NumericUtils.sortableFloatBits((int) view.get(docID)); } }; } };