@Override public Bits getLiveDocs() { ensureOpen(); return new Bits() { @Override public boolean get(int index) { int[] delSet = _currentDelDocIds; if (delSet != null && Arrays.binarySearch(delSet, index) >= 0) { return false; } Bits liveDocs = in.getLiveDocs(); if (liveDocs == null) { return true; } return liveDocs.get(index); } @Override public int length() { return in.getLiveDocs().length(); } }; }
@Override public Bits getLiveDocs() { ensureOpen(); return new Bits() { @Override public boolean get(int index) { int[] delSet = _currentDelDocIds; if (delSet != null && Arrays.binarySearch(delSet, index) >= 0) { return false; } Bits liveDocs = in.getLiveDocs(); if (liveDocs == null) { return true; } return liveDocs.get(index); } @Override public int length() { return in.getLiveDocs().length(); } }; }
@Override public TermDocs termDocs() throws IOException { ensureOpen(); TermDocs td = in.termDocs(); if(_noDedup) return td; int[] delDocIds = _delDocIds;//.get(); if(td == null || delDocIds == null || delDocIds.length == 0) return td; return new ZoieSegmentTermDocs(td, new ArrayDocIdSet(delDocIds)); }
@Override public TermPositions termPositions(Term term) throws IOException { ensureOpen(); TermPositions tp = in.termPositions(term); if(_noDedup) return tp; int[] delDocIds = _delDocIds;//.get(); if(tp == null || delDocIds == null || delDocIds.length == 0) return tp; return new ZoieSegmentTermPositions(tp, new ArrayDocIdSet(delDocIds)); }
@Override public TermPositions termPositions() throws IOException { ensureOpen(); TermPositions tp = in.termPositions(); if(_noDedup) return tp; int[] delDocIds = _delDocIds;//.get(); if(tp == null || delDocIds == null || delDocIds.length == 0) return tp; return new ZoieSegmentTermPositions(tp, new ArrayDocIdSet(delDocIds)); }
@Override public TermDocs termDocs(Term term) throws IOException { ensureOpen(); TermDocs td = in.termDocs(term); if(_noDedup) return td; int[] delDocIds = _delDocIds;//.get(); if(td == null || delDocIds == null || delDocIds.length == 0) return td; return new ZoieSegmentTermDocs(td, new ArrayDocIdSet(delDocIds)); }