|
49 | 49 | import org.apache.lucene.util.BitSetIterator;
|
50 | 50 | import org.apache.lucene.util.DocIdSetBuilder;
|
51 | 51 | import org.apache.lucene.util.FixedBitSet;
|
| 52 | +import org.apache.lucene.util.IntsRef; |
52 | 53 |
|
53 | 54 | /**
|
54 | 55 | * Base query class for all spatial geometries: {@link LatLonShape}, {@link LatLonPoint} and {@link
|
@@ -445,6 +446,11 @@ public void visit(DocIdSetIterator iterator) throws IOException {
|
445 | 446 | adder.add(iterator);
|
446 | 447 | }
|
447 | 448 |
|
| 449 | + @Override |
| 450 | + public void visit(IntsRef ref) { |
| 451 | + adder.add(ref); |
| 452 | + } |
| 453 | + |
448 | 454 | @Override
|
449 | 455 | public void visit(int docID, byte[] t) {
|
450 | 456 | if (leafPredicate.test(t)) {
|
@@ -489,6 +495,14 @@ public void visit(DocIdSetIterator iterator) throws IOException {
|
489 | 495 | cost[0] += iterator.cost();
|
490 | 496 | }
|
491 | 497 |
|
| 498 | + @Override |
| 499 | + public void visit(IntsRef ref) { |
| 500 | + for (int i = 0; i < ref.length; i++) { |
| 501 | + result.set(ref.ints[ref.offset + i]); |
| 502 | + } |
| 503 | + cost[0] += ref.length; |
| 504 | + } |
| 505 | + |
492 | 506 | @Override
|
493 | 507 | public void visit(int docID, byte[] t) {
|
494 | 508 | if (result.get(docID) == false) {
|
@@ -532,6 +546,14 @@ public void visit(int docID) {
|
532 | 546 | cost[0]++;
|
533 | 547 | }
|
534 | 548 |
|
| 549 | + @Override |
| 550 | + public void visit(IntsRef ref) { |
| 551 | + for (int i = 0; i < ref.length; i++) { |
| 552 | + result.set(ref.ints[ref.offset + i]); |
| 553 | + } |
| 554 | + cost[0] += ref.length; |
| 555 | + } |
| 556 | + |
535 | 557 | @Override
|
536 | 558 | public void visit(DocIdSetIterator iterator) throws IOException {
|
537 | 559 | result.or(iterator);
|
@@ -589,6 +611,13 @@ public void visit(DocIdSetIterator iterator) throws IOException {
|
589 | 611 | excluded.or(iterator);
|
590 | 612 | }
|
591 | 613 |
|
| 614 | + @Override |
| 615 | + public void visit(IntsRef ref) { |
| 616 | + for (int i = 0; i < ref.length; i++) { |
| 617 | + visit(ref.ints[ref.offset + i]); |
| 618 | + } |
| 619 | + } |
| 620 | + |
592 | 621 | @Override
|
593 | 622 | public void visit(int docID, byte[] t) {
|
594 | 623 | if (excluded.get(docID) == false) {
|
@@ -643,6 +672,14 @@ public void visit(int docID) {
|
643 | 672 | cost[0]--;
|
644 | 673 | }
|
645 | 674 |
|
| 675 | + @Override |
| 676 | + public void visit(IntsRef ref) { |
| 677 | + for (int i = 0; i < ref.length; i++) { |
| 678 | + result.clear(ref.ints[ref.offset + i]); |
| 679 | + } |
| 680 | + cost[0] -= ref.length; |
| 681 | + } |
| 682 | + |
646 | 683 | @Override
|
647 | 684 | public void visit(DocIdSetIterator iterator) throws IOException {
|
648 | 685 | result.andNot(iterator);
|
@@ -693,6 +730,13 @@ public void visit(DocIdSetIterator iterator) throws IOException {
|
693 | 730 | result.andNot(iterator);
|
694 | 731 | }
|
695 | 732 |
|
| 733 | + @Override |
| 734 | + public void visit(IntsRef ref) { |
| 735 | + for (int i = 0; i < ref.length; i++) { |
| 736 | + visit(ref.ints[ref.offset + i]); |
| 737 | + } |
| 738 | + } |
| 739 | + |
696 | 740 | @Override
|
697 | 741 | public void visit(int docID, byte[] packedTriangle) {
|
698 | 742 | // NO-OP
|
|
0 commit comments