-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Made DocIdsWriter use DISI when reading documents with an IntersectVisitor #13149
Changes from 6 commits
72a6286
8287e85
60495d4
e826696
2b6328b
cc39cc1
95e3bcc
288ab03
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ | |
import org.apache.lucene.util.BitSetIterator; | ||
import org.apache.lucene.util.DocIdSetBuilder; | ||
import org.apache.lucene.util.FixedBitSet; | ||
import org.apache.lucene.util.IntsRef; | ||
|
||
/** | ||
* Abstract class for range queries against single or multidimensional points such as {@link | ||
|
@@ -185,6 +186,13 @@ public void visit(DocIdSetIterator iterator) throws IOException { | |
adder.add(iterator); | ||
} | ||
|
||
@Override | ||
public void visit(IntsRef ref) { | ||
for (int i = ref.offset; i < ref.offset + ref.length; i++) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we delegate this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would probably be better. I don't think we should expect huge performance increases from it (since it would only affect narrow range queries). But it would make a large difference if a third implementation of the adder is ever used. I have limited time this week to look at it - I will try to find some time for it though! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I unfortunately did not find time enough for this this week - and since this PR seems to be wrapping up I will leave it out. It looks like a simple change but I got stuck implementing tests (which I feel would be very needed). I will leave this for future improvement! |
||
adder.add(ref.ints[i]); | ||
} | ||
} | ||
|
||
@Override | ||
public void visit(int docID, byte[] packedValue) { | ||
if (matches(packedValue)) { | ||
|
@@ -222,6 +230,14 @@ public void visit(DocIdSetIterator iterator) throws IOException { | |
cost[0] = Math.max(0, cost[0] - iterator.cost()); | ||
} | ||
|
||
@Override | ||
public void visit(IntsRef ref) { | ||
for (int i = ref.offset; i < ref.offset + ref.length; i++) { | ||
result.clear(ref.ints[i]); | ||
} | ||
cost[0] -= ref.length; | ||
} | ||
|
||
@Override | ||
public void visit(int docID, byte[] packedValue) { | ||
if (matches(packedValue) == false) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implements
->implementations
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops, fixed!