mirror of https://github.com/apache/lucene.git
Only search soft deleted.
This commit is contained in:
parent
f4cd4b46fc
commit
2415e99562
|
@ -97,16 +97,21 @@ public final class SoftDeletesRetentionMergePolicy extends OneMergeWrappingMerge
|
||||||
static CodecReader applyRetentionQuery(
|
static CodecReader applyRetentionQuery(
|
||||||
String softDeleteField, Query retentionQuery, CodecReader reader) throws IOException {
|
String softDeleteField, Query retentionQuery, CodecReader reader) throws IOException {
|
||||||
Bits liveDocs = reader.getLiveDocs();
|
Bits liveDocs = reader.getLiveDocs();
|
||||||
|
// TODO: Move getHardLiveDocs to Parent(LeafReader)?
|
||||||
|
Bits hardLiveDocs = ((SegmentReader) reader).getHardLiveDocs();
|
||||||
if (liveDocs == null) { // no deletes - just keep going
|
if (liveDocs == null) { // no deletes - just keep going
|
||||||
return reader;
|
return reader;
|
||||||
}
|
}
|
||||||
|
// TODO: It seems wrapLiveDocs is useless?
|
||||||
CodecReader wrappedReader =
|
CodecReader wrappedReader =
|
||||||
FilterCodecReader.wrapLiveDocs(
|
FilterCodecReader.wrapLiveDocs(
|
||||||
reader,
|
reader,
|
||||||
new Bits() { // only search deleted
|
new Bits() { // only search soft deleted
|
||||||
@Override
|
@Override
|
||||||
public boolean get(int index) {
|
public boolean get(int index) {
|
||||||
return liveDocs.get(index) == false;
|
// TODO: Can we extract softLiveDocs from liveDocs and hardLiveDocs, and use it
|
||||||
|
// directly, even instead of FieldExistsQuery?
|
||||||
|
return liveDocs.get(index) == false && hardLiveDocs.get(index) == true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue