Package org.apache.lucene.util

Examples of org.apache.lucene.util.OpenBitSet.flip()


              && docs instanceof BitDocSet;
    }

    if (doNegative) {
      OpenBitSet bs = (OpenBitSet) ((BitDocSet) docs).getBits().clone();
      bs.flip(0, maxDoc);
      // TODO: when iterator across negative elements is available, use that
      // instead of creating a new bitset and inverting.
      docs = new BitDocSet(bs, maxDoc - baseSize);
      // simply negating will mean that we have deleted docs in the set.
      // that should be OK, as their entries in our table should be empty.
View Full Code Here


      test( both3.docList.equals(both.docList) );
      test( both3.docSet.equals(both.docSet) );

      OpenBitSet bits = both.docSet.getBits();
      OpenBitSet neg = ((OpenBitSet)bits.clone());
      neg.flip(0, bits.capacity());

      // use the negative as a filter (should result in 0 matches)
      // todo - fix if filter is not null
      both2 = searcher.getDocListAndSet(query,new BitDocSet(neg),sort, start, limit);
      test( both2.docList.size() == 0 );
View Full Code Here

  @Test
  public void testComplementIterator() throws Exception {
    final int n = atLeast(10000);
    final OpenBitSet bits = new OpenBitSet(n);
    for (int i = 0; i < 5 * n; i++) {
      bits.flip(random.nextInt(n));
    }
   
    OpenBitSet verify = new OpenBitSet(n);
    verify.or(bits);

View Full Code Here

        } while (termEnum.next());
      } finally {
        termDocs.close();
        termEnum.close();
      }
      res.flip(0, reader.maxDoc());
      return res;
    }
  }
 
View Full Code Here

      }
    }, precisionStep, lower, upper);
   
    if (useBitSet) {
      // after flipping all bits in the range, the cardinality should be zero
      bits.flip(0,upper-lower+1);
      assertTrue("The sub-range concenated should match the whole range", bits.isEmpty());
    }
  }
 
  public void testSplitLongRange() throws Exception {
View Full Code Here

      }
    }, precisionStep, lower, upper);
   
    if (useBitSet) {
      // after flipping all bits in the range, the cardinality should be zero
      bits.flip(0,upper-lower+1);
      assertTrue("The sub-range concenated should match the whole range", bits.isEmpty());
    }
  }
 
  public void testSplitIntRange() throws Exception {
View Full Code Here

      }
    }, precisionStep, lower, upper);
   
    if (useBitSet) {
      // after flipping all bits in the range, the cardinality should be zero
      bits.flip(0,upper-lower+1);
      assertTrue("The sub-range concenated should match the whole range", bits.isEmpty());
    }
  }
 
  public void testSplitLongRange() throws Exception {
View Full Code Here

      }
    }, precisionStep, lower, upper);
   
    if (useBitSet) {
      // after flipping all bits in the range, the cardinality should be zero
      bits.flip(0,upper-lower+1);
      assertTrue("The sub-range concenated should match the whole range", bits.isEmpty());
    }
  }
 
  public void testSplitIntRange() throws Exception {
View Full Code Here

              bitSet.fastSet(termDocs.doc());
            }
          }
        } while (termEnum.next());
               
        bitSet.flip(0,nBits);
        if (reader.hasDeletions()) {
          for (int i=0;i<nBits;i++) {
            if (bitSet.get(i) && reader.isDeleted(i)) {
              bitSet.fastFlip(i);
            }
View Full Code Here

                 } while (termEnum.next());
               } finally {
                 termDocs.close();
                 termEnum.close();
               }
               res.flip(0, reader.maxDoc());
               return res;
             }
           }
   
    // inherit javadocs
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.