Examples of bits()


Examples of org.apache.lucene.search.Filter.bits()

  public BitSet bits(IndexReader reader) throws IOException {
    if (chainedFilters.size() == 0) throw new AssertionFailure("Chainedfilter has no filters to chain for");
    //we need to copy the first BitSet because BitSet is modified by .logicalOp
    Filter filter = chainedFilters.get( 0 );
    BitSet result = (BitSet) filter.bits( reader ).clone();
    for (int index = 1 ; index < chainedFilters.size() ; index++) {
      result.and( chainedFilters.get( index ).bits( reader ) );
    }
    return result;
  }
View Full Code Here

Examples of org.apache.lucene.util.BitDocIdSet.bits()

            if (!objectMapper.nested().isNested()) {
                continue;
            }

            BitDocIdSet nestedTypeBitSet = cache.getBitDocIdSetFilter(objectMapper.nestedTypeFilter()).getDocIdSet(context);
            if (nestedTypeBitSet != null && nestedTypeBitSet.bits().get(nestedDocId)) {
                if (nestedObjectMapper == null) {
                    nestedObjectMapper = objectMapper;
                } else {
                    if (nestedObjectMapper.fullPath().length() < objectMapper.fullPath().length()) {
                        nestedObjectMapper = objectMapper;
View Full Code Here

Examples of org.apache.lucene.util.BitDocIdSet.bits()

            BitDocIdSet parentSet = parentFilter.getDocIdSet(reader);
            if (DocIdSets.isEmpty(parentSet)) {
                parentDocs = null;
                childDocs = null;
            } else {
                parentDocs = parentSet.bits();
                // In ES if parent is deleted, then also the children are deleted. Therefore acceptedDocs can also null here.
                BitDocIdSet childSet = childFilter.getDocIdSet(reader);
                if (DocIdSets.isEmpty(childSet)) {
                    childDocs = new Bits.MatchAllBits(reader.reader().maxDoc());
                } else {
View Full Code Here

Examples of org.apache.lucene.util.BitDocIdSet.bits()

                // In ES if parent is deleted, then also the children are deleted. Therefore acceptedDocs can also null here.
                BitDocIdSet childSet = childFilter.getDocIdSet(reader);
                if (DocIdSets.isEmpty(childSet)) {
                    childDocs = new Bits.MatchAllBits(reader.reader().maxDoc());
                } else {
                    childDocs = childSet.bits();
                }
            }
        } catch (IOException ioe) {
            throw new AggregationExecutionException("Failed to aggregate [" + name + "]", ioe);
        }
View Full Code Here

Examples of org.apache.lucene.util.BitDocIdSet.bits()

    public static BitSet toBitSet(DocIdSetIterator iterator, int numBits) throws IOException {
        BitDocIdSet.Builder builder = new BitDocIdSet.Builder(numBits);
        builder.or(iterator);
        BitDocIdSet result = builder.build();
        if (result != null) {
            return result.bits();
        } else {
            return new SparseFixedBitSet(numBits);
        }
    }
View Full Code Here

Examples of org.apache.lucene.util.BitDocIdSet.bits()

    }

    private int findRootDocumentIfNested(SearchContext context, LeafReaderContext subReaderContext, int subDocId) throws IOException {
        if (context.mapperService().hasNested()) {
            BitDocIdSet nonNested = context.bitsetFilterCache().getBitDocIdSetFilter(NonNestedDocsFilter.INSTANCE).getDocIdSet(subReaderContext);
            BitSet bits = nonNested.bits();
            if (!bits.get(subDocId)) {
                return bits.nextSetBit(subDocId);
            }
        }
        return -1;
View Full Code Here

Examples of org.apache.lucene.util.BitDocIdSet.bits()

                field = nestedObjectMapper.fullPath();
                parentFilter = NonNestedDocsFilter.INSTANCE;
            }

            BitDocIdSet parentBitSet = context.bitsetFilterCache().getBitDocIdSetFilter(parentFilter).getDocIdSet(subReaderContext);
            BitSet parentBits = parentBitSet.bits();
            int offset = 0;
            BitDocIdSet nestedDocsBitSet = context.bitsetFilterCache().getBitDocIdSetFilter(nestedObjectMapper.nestedTypeFilter()).getDocIdSet(subReaderContext);
            BitSet nestedBits = nestedDocsBitSet.bits();
            int nextParent = parentBits.nextSetBit(currentParent);
            for (int docId = nestedBits.nextSetBit(currentParent + 1); docId < nextParent && docId != DocIdSetIterator.NO_MORE_DOCS; docId = nestedBits.nextSetBit(docId + 1)) {
View Full Code Here

Examples of org.apache.lucene.util.BitDocIdSet.bits()

            BitDocIdSet parentBitSet = context.bitsetFilterCache().getBitDocIdSetFilter(parentFilter).getDocIdSet(subReaderContext);
            BitSet parentBits = parentBitSet.bits();
            int offset = 0;
            BitDocIdSet nestedDocsBitSet = context.bitsetFilterCache().getBitDocIdSetFilter(nestedObjectMapper.nestedTypeFilter()).getDocIdSet(subReaderContext);
            BitSet nestedBits = nestedDocsBitSet.bits();
            int nextParent = parentBits.nextSetBit(currentParent);
            for (int docId = nestedBits.nextSetBit(currentParent + 1); docId < nextParent && docId != DocIdSetIterator.NO_MORE_DOCS; docId = nestedBits.nextSetBit(docId + 1)) {
                offset++;
            }
            currentParent = nextParent;
View Full Code Here

Examples of org.elasticsearch.common.lucene.docset.AndDocIdSet.bits()

                        }
                    };
                }
            }
            AndDocIdSet andSet = new AndDocIdSet(sets);
            Bits andBits = andSet.bits();
            if (andBits != null) {
                for (int i = 0; i < numDocs; ++i) {
                    assertEquals(anded.get(i), andBits.get(i));
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.