Package org.apache.lucene.util

Examples of org.apache.lucene.util.BitVector


                String[] vals,FacetValueConverter valConverter,boolean takeCompliment){
    _dataCache = facetHandler.getFacetData(reader);
    _orderArray = _dataCache.orderArray;
      _index = valConverter.convert(_dataCache, vals);
     
      _bitset = new BitVector(_dataCache.valArray.size());
      for (int i : _index)
      {
        _bitset.set(i);
      }
      if (takeCompliment)
View Full Code Here


  public RandomAccessDocIdSet getRandomAccessDocIdSet(BoboIndexReader reader) throws IOException
  {
  final MultiValueFacetDataCache dataCache = (MultiValueFacetDataCache)_facetHandler.getFacetData(reader);
  final int[] index = _valueConverter.convert(dataCache, _vals);
  final BigNestedIntArray nestedArray = dataCache._nestedArray;
  final BitVector bitset = new BitVector(dataCache.valArray.size());
 
  for (int i : index){
    bitset.set(i);
    }
 
  if (_takeCompliment)
    {
      // flip the bits
    int size = bitset.size();
      for (int i=0;i<size;++i){
        if (bitset.get(i)){
          bitset.clear(i);
        }
        else{
          bitset.set(i);
        }
      }
    }
 
  int count = bitset.count();
 
    if (count == 0)
    {
      final DocIdSet empty = EmptyDocIdSet.getInstance();
        return new RandomAccessDocIdSet()
View Full Code Here

                String[] vals,FacetValueConverter valConverter,boolean takeCompliment){
    _dataCache = facetHandler.getFacetData(reader);
    _orderArray = _dataCache.orderArray;
      _index = valConverter.convert(_dataCache, vals);
     
      _bitset = new BitVector(_dataCache.valArray.size());
      for (int i : _index)
      {
        _bitset.set(i);
      }
      if (takeCompliment)
View Full Code Here

    }

    BigNestedIntArray nestedArray = new BigNestedIntArray();
    nestedArray.load(maxId, loader);

    BitVector filter = new BitVector(numVals);
    for (int i = 0; i < numVals; i++)
    {
      if (i % 2 == 0)
      {
        filter.set(i);
      }
    }

    for (int i = 0; i < maxId; i++)
    {
View Full Code Here

        || (uncommittedDeletedDocuments != null && uncommittedDeletedDocuments.get(docNum))) {
      return;
    }

    if (uncommittedDeletedDocuments == null) {
      uncommittedDeletedDocuments = new BitVector(maxDoc());
    }

    uncommittedDeletedDocuments.set(docNum);
  }
View Full Code Here

    fieldNameBuffer.clear();


    // update deleted documents bitset
    if (index.getDeletedDocuments() != null) {
      BitVector deletedDocuments = new BitVector(index.getDocumentsByNumber().length);
      for (int i = 0; i < index.getDeletedDocuments().size(); i++) {
        if (index.getDeletedDocuments().get(i)) {
          deletedDocuments.set(i);
        }
      }
      index.setDeletedDocuments(deletedDocuments);
    }
View Full Code Here


    documentsByNumber = new InstantiatedDocument[sourceIndexReader.maxDoc()];

    if (sourceIndexReader.hasDeletions()) {
      deletedDocuments = new BitVector(sourceIndexReader.maxDoc());
    }

    // create documents
    for (int i = 0; i < sourceIndexReader.maxDoc(); i++) {
      if (sourceIndexReader.hasDeletions() && sourceIndexReader.isDeleted(i)) {
View Full Code Here

    SegmentReader sr1 = SegmentReader.getOnlySegmentReader(r1);
    SegmentReader sr2 = (SegmentReader) rs2[0];

    // At this point they share the same BitVector
    assertTrue(sr1.deletedDocs==sr2.deletedDocs);
    final BitVector delDocs = sr1.deletedDocs;
    r1.close();

    r2.deleteDocument(0);
    assertTrue(delDocs==sr2.deletedDocs);
    r2.close();
View Full Code Here

  }

  private void loadDeletedDocs() throws IOException {
    // NOTE: the bitvector is stored using the regular directory, not cfs
    if (hasDeletions(si)) {
      deletedDocs = new BitVector(directory(), si.getDelFileName());
      deletedDocsRef = new Ref();
      assert checkDeletedCounts();
    } else
      assert si.getDelCount() == 0;
  }
View Full Code Here

  }

  @Override
  protected void doDelete(int docNum) {
    if (deletedDocs == null) {
      deletedDocs = new BitVector(maxDoc());
      deletedDocsRef = new Ref();
    }
    // there is more than 1 SegmentReader with a reference to this
    // deletedDocs BitVector so decRef the current deletedDocsRef,
    // clone the BitVector, create a new deletedDocsRef
View Full Code Here

TOP

Related Classes of org.apache.lucene.util.BitVector

Copyright © 2018 www.massapicom. 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.