Example usage for org.apache.lucene.index DocValues emptyBinary

List of usage examples for org.apache.lucene.index DocValues emptyBinary

Introduction

In this page you can find the example usage for org.apache.lucene.index DocValues emptyBinary.

Prototype

public static final BinaryDocValues emptyBinary() 

Source Link

Document

An empty BinaryDocValues which returns no documents

Usage

From source file:org.apache.solr.uninverting.FieldCacheImpl.java

License:Apache License

public BinaryDocValues getTerms(LeafReader reader, String field, float acceptableOverheadRatio)
        throws IOException {
    BinaryDocValues valuesIn = reader.getBinaryDocValues(field);
    if (valuesIn == null) {
        valuesIn = reader.getSortedDocValues(field);
    }// ww w .  jav  a  2  s.  co  m

    if (valuesIn != null) {
        // Not cached here by FieldCacheImpl (cached instead
        // per-thread by SegmentReader):
        return valuesIn;
    }

    final FieldInfo info = reader.getFieldInfos().fieldInfo(field);
    if (info == null) {
        return DocValues.emptyBinary();
    } 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.emptyBinary();
    }

    BinaryDocValuesImpl impl = (BinaryDocValuesImpl) caches.get(BinaryDocValues.class).get(reader,
            new CacheKey(field, acceptableOverheadRatio));
    return impl.iterator();
}

From source file:org.codelibs.elasticsearch.index.fielddata.FieldData.java

License:Apache License

/**
 * Return a {SortedBinaryDocValues} that doesn't contain any value.
 *///from w  ww. ja  v a2 s.c o m
public static SortedBinaryDocValues emptySortedBinary(int maxDoc) {
    return singleton(DocValues.emptyBinary(), new Bits.MatchNoBits(maxDoc));
}

From source file:org.neo4j.kernel.api.impl.index.IndexReaderStub.java

License:Open Source License

@Override
public BinaryDocValues getBinaryDocValues(String field) throws IOException {
    return DocValues.emptyBinary();
}