List of usage examples for org.apache.lucene.search DocIdSetIterator NO_MORE_DOCS
int NO_MORE_DOCS
To view the source code for org.apache.lucene.search DocIdSetIterator NO_MORE_DOCS.
Click Source Link
From source file:com.browseengine.bobo.util.LazyBigIntArray.java
License:Apache License
@Override public int findValue(int val, int id, int maxId) { while (id <= maxId) { int i = id >> SHIFT_SIZE; if (_array[i] == null) { if (val == _fillValue) return id; else//from ww w . j a v a2s .co m id = (i + 1) << SHIFT_SIZE; // jump to next segment } else { if (_array[i][id & MASK] == val) return id; else id++; } } return DocIdSetIterator.NO_MORE_DOCS; }
From source file:com.browseengine.bobo.util.LazyBigIntArray.java
License:Apache License
@Override public int findValues(OpenBitSet bitset, int id, int maxId) { while (id <= maxId) { int i = id >> SHIFT_SIZE; if (_array[i] == null) { if (bitset.fastGet(_fillValue)) return id; else//from w ww . java2 s.c om id = (i + 1) << SHIFT_SIZE; // jump to next segment } else { if (bitset.fastGet(_array[i][id & MASK])) return id; else id++; } } return DocIdSetIterator.NO_MORE_DOCS; }
From source file:com.browseengine.bobo.util.LazyBigIntArray.java
License:Apache License
@Override public int findValues(BitVector bitset, int id, int maxId) { while (id <= maxId) { int i = id >> SHIFT_SIZE; if (_array[i] == null) { if (bitset.get(_fillValue)) return id; else// w ww .jav a 2 s .co m id = (i + 1) << SHIFT_SIZE; // jump to next segment } else { if (bitset.get(_array[i][id & MASK])) return id; else id++; } } return DocIdSetIterator.NO_MORE_DOCS; }
From source file:com.browseengine.bobo.util.LazyBigIntArray.java
License:Apache License
@Override public int findValueRange(int minVal, int maxVal, int id, int maxId) { while (id <= maxId) { int i = id >> SHIFT_SIZE; if (_array[i] == null) { if (_fillValue >= minVal && _fillValue <= maxVal) return id; else//from www. j ava 2 s. c o m id = (i + 1) << SHIFT_SIZE; // jump to next segment } else { int val = _array[i][id & MASK]; if (val >= minVal && val <= maxVal) return id; else id++; } } return DocIdSetIterator.NO_MORE_DOCS; }
From source file:com.browseengine.bobo.util.LazyBigIntArray.java
License:Apache License
@Override public int findBits(int bits, int id, int maxId) { while (id <= maxId) { int i = id >> SHIFT_SIZE; if (_array[i] == null) { if ((_fillValue & bits) != 0) return id; else/*w w w . j a v a 2 s . c o m*/ id = (i + 1) << SHIFT_SIZE; // jump to next segment } else { int val = _array[i][id & MASK]; if ((val & bits) != 0) return id; else id++; } } return DocIdSetIterator.NO_MORE_DOCS; }
From source file:com.browseengine.bobo.util.test.BigSegmentedArrayTest.java
License:Apache License
private static void findValueHelper(BigSegmentedArray array) { final int a = array.maxValue() / 16; final int b = a * 2; final int c = a * 3; array.add(1000, a);// w ww . j a v a 2 s. c om array.add(2000, b); assertEquals(1000, array.findValue(a, 0, 2000)); assertEquals(DocIdSetIterator.NO_MORE_DOCS, array.findValue(a, 1001, 2000)); assertEquals(2000, array.findValue(b, 2000, 3000)); array.fill(c); assertEquals(DocIdSetIterator.NO_MORE_DOCS, array.findValue(b, 2000, 3000)); assertEquals(4000, array.findValue(c, 4000, 4000)); }
From source file:com.browseengine.bobo.util.test.BigSegmentedArrayTest.java
License:Apache License
private static void findValueRangeHelper(BigSegmentedArray array) { final int a = array.maxValue() / 16; final int b = a * 2; final int c = a * 3; final int d = a * 4; final int e = a * 5; final int f = a * 6; array.add(10000, b);//from ww w. ja v a 2s. c om assertEquals(DocIdSetIterator.NO_MORE_DOCS, array.findValueRange(d, e, 0, array.size())); assertEquals(10000, array.findValueRange(a, e, 0, array.size())); assertEquals(10000, array.findValueRange(a, e, 10000, array.size())); assertEquals(10000, array.findValueRange(a, e, 0, 10000)); assertEquals(10000, array.findValueRange(a, b, 9000, 10100)); assertEquals(10000, array.findValueRange(b, e, 9000, 10000)); assertEquals(10000, array.findValueRange(b, b, 9000, 10000)); }
From source file:com.floragunn.searchguard.configuration.DlsFlsFilterLeafReader.java
License:Open Source License
DlsFlsFilterLeafReader(final LeafReader delegate, final Set<String> includes, final Query dlsQuery) { super(delegate); flsEnabled = includes != null && !includes.isEmpty(); dlsEnabled = dlsQuery != null;//from w w w . java 2 s . c om if (flsEnabled) { this.includes = includes.toArray(new String[0]); final FieldInfos infos = delegate.getFieldInfos(); final List<FieldInfo> fi = new ArrayList<FieldInfo>(infos.size()); for (final FieldInfo info : infos) { final String fname = info.name; if ((!WildcardMatcher.containsWildcard(fname) && includes.contains(fname)) || WildcardMatcher.matchAny(this.includes, fname)) { fi.add(info); } } this.flsFieldInfos = new FieldInfos(fi.toArray(new FieldInfo[0])); } else { this.includes = null; this.flsFieldInfos = null; } if (dlsEnabled) { try { //borrowed from Apache Lucene (Copyright Apache Software Foundation (ASF)) final IndexSearcher searcher = new IndexSearcher(this); searcher.setQueryCache(null); final boolean needsScores = false; final Weight preserveWeight = searcher.createNormalizedWeight(dlsQuery, needsScores); final int maxDoc = in.maxDoc(); final FixedBitSet bits = new FixedBitSet(maxDoc); final Scorer preverveScorer = preserveWeight.scorer(this.getContext()); if (preverveScorer != null) { bits.or(preverveScorer.iterator()); } if (in.hasDeletions()) { final Bits oldLiveDocs = in.getLiveDocs(); assert oldLiveDocs != null; final DocIdSetIterator it = new BitSetIterator(bits, 0L); for (int i = it.nextDoc(); i != DocIdSetIterator.NO_MORE_DOCS; i = it.nextDoc()) { if (!oldLiveDocs.get(i)) { bits.clear(i); } } } this.liveDocs = bits; this.numDocs = bits.cardinality(); } catch (Exception e) { throw new RuntimeException(e); } } else { this.liveDocs = null; this.numDocs = -1; } }
From source file:com.kamikaze.docidset.utils.DisiDocQueue.java
License:Apache License
public final boolean topNextAndAdjustElsePop() throws IOException { return checkAdjustElsePop(topHDD.disi.nextDoc() != DocIdSetIterator.NO_MORE_DOCS); }
From source file:com.kamikaze.docidset.utils.DisiDocQueue.java
License:Apache License
public final boolean topSkipToAndAdjustElsePop(int target) throws IOException { return checkAdjustElsePop(topHDD.disi.advance(target) != DocIdSetIterator.NO_MORE_DOCS); }