|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ReqExclScorer | Line # 27 | 49 | 24 | 85.2% |
0.85227275
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (43) | |||
| Result | |||
|
0.85227275
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testRandomQueries
org.apache.lucene.search.TestBooleanMinShouldMatch.testRandomQueries
|
1 PASS | |
|
0.85227275
|
org.apache.lucene.search.TestBoolean2.testRandomQueries
org.apache.lucene.search.TestBoolean2.testRandomQueries
|
1 PASS | |
|
0.6931818
|
org.apache.lucene.search.TestSimpleExplanations.testBQ6
org.apache.lucene.search.TestSimpleExplanations.testBQ6
|
1 PASS | |
|
0.6931818
|
org.apache.lucene.search.TestSimpleExplanations.testBQ9
org.apache.lucene.search.TestSimpleExplanations.testBQ9
|
1 PASS | |
|
0.6931818
|
org.apache.lucene.search.TestSimpleExplanations.testBQ10
org.apache.lucene.search.TestSimpleExplanations.testBQ10
|
1 PASS | |
|
0.65909094
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testSomeReqSomeProhibAndSomeOptional
org.apache.lucene.search.TestBooleanMinShouldMatch.testSomeReqSomeProhibAndSomeOptional
|
1 PASS | |
|
0.65909094
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testSomeReqOneProhibAndSomeOptional
org.apache.lucene.search.TestBooleanMinShouldMatch.testSomeReqOneProhibAndSomeOptional
|
1 PASS | |
|
0.65909094
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testOneProhibAndSomeOptional
org.apache.lucene.search.TestBooleanMinShouldMatch.testOneProhibAndSomeOptional
|
1 PASS | |
|
0.65909094
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testOneReqOneProhibAndSomeOptional
org.apache.lucene.search.TestBooleanMinShouldMatch.testOneReqOneProhibAndSomeOptional
|
1 PASS | |
|
0.65909094
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testSomeProhibAndSomeOptional
org.apache.lucene.search.TestBooleanMinShouldMatch.testSomeProhibAndSomeOptional
|
1 PASS | |
|
0.65909094
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testOneReqSomeProhibAndSomeOptional
org.apache.lucene.search.TestBooleanMinShouldMatch.testOneReqSomeProhibAndSomeOptional
|
1 PASS | |
|
0.64772725
|
org.apache.lucene.search.TestComplexExplanations.testBQ13
org.apache.lucene.search.TestComplexExplanations.testBQ13
|
1 PASS | |
|
0.6363636
|
org.apache.lucene.search.TestSimpleExplanations.testBQ19
org.apache.lucene.search.TestSimpleExplanations.testBQ19
|
1 PASS | |
|
0.59090906
|
org.apache.lucene.search.TestSimpleExplanations.testDMQ7
org.apache.lucene.search.TestSimpleExplanations.testDMQ7
|
1 PASS | |
|
0.59090906
|
org.apache.lucene.search.TestSimpleExplanations.testDMQ6
org.apache.lucene.search.TestSimpleExplanations.testDMQ6
|
1 PASS | |
|
0.47727272
|
org.apache.lucene.search.TestSimpleExplanations.testBQ16
org.apache.lucene.search.TestSimpleExplanations.testBQ16
|
1 PASS | |
|
0.47727272
|
org.apache.lucene.search.TestBoolean2.testQueries06
org.apache.lucene.search.TestBoolean2.testQueries06
|
1 PASS | |
|
0.47727272
|
org.apache.lucene.search.TestSimpleExplanations.testBQ4
org.apache.lucene.search.TestSimpleExplanations.testBQ4
|
1 PASS | |
|
0.47727272
|
org.apache.lucene.search.TestSimpleExplanations.testBQ17
org.apache.lucene.search.TestSimpleExplanations.testBQ17
|
1 PASS | |
|
0.47727272
|
org.apache.lucene.search.TestBoolean2.testQueries05
org.apache.lucene.search.TestBoolean2.testQueries05
|
1 PASS | |
|
0.47727272
|
org.apache.lucene.search.TestBoolean2.testQueries04
org.apache.lucene.search.TestBoolean2.testQueries04
|
1 PASS | |
|
0.4659091
|
org.apache.lucene.search.TestBoolean2.testQueries08
org.apache.lucene.search.TestBoolean2.testQueries08
|
1 PASS | |
|
0.45454547
|
org.apache.lucene.search.TestComplexExplanations.test2
org.apache.lucene.search.TestComplexExplanations.test2
|
1 PASS | |
|
0.45454547
|
org.apache.lucene.search.TestComplexExplanations.test1
org.apache.lucene.search.TestComplexExplanations.test1
|
1 PASS | |
|
0.4431818
|
org.apache.lucene.search.TestComplexExplanations.testBQ22
org.apache.lucene.search.TestComplexExplanations.testBQ22
|
1 PASS | |
|
0.4431818
|
org.apache.lucene.search.TestComplexExplanations.testT3
org.apache.lucene.search.TestComplexExplanations.testT3
|
1 PASS | |
|
0.4431818
|
org.apache.lucene.search.TestComplexExplanations.testDMQ10
org.apache.lucene.search.TestComplexExplanations.testDMQ10
|
1 PASS | |
|
0.4431818
|
org.apache.lucene.search.TestComplexExplanations.testCSQ4
org.apache.lucene.search.TestComplexExplanations.testCSQ4
|
1 PASS | |
|
0.4431818
|
org.apache.lucene.search.TestComplexExplanations.testBQ21
org.apache.lucene.search.TestComplexExplanations.testBQ21
|
1 PASS | |
|
0.4431818
|
org.apache.lucene.search.TestSimpleExplanations.testBQ15
org.apache.lucene.search.TestSimpleExplanations.testBQ15
|
1 PASS | |
|
0.4431818
|
org.apache.lucene.search.TestComplexExplanations.testMA3
org.apache.lucene.search.TestComplexExplanations.testMA3
|
1 PASS | |
|
0.4431818
|
org.apache.lucene.search.TestComplexExplanations.testSF3
org.apache.lucene.search.TestComplexExplanations.testSF3
|
1 PASS | |
|
0.4431818
|
org.apache.lucene.search.TestComplexExplanations.testMPQ7
org.apache.lucene.search.TestComplexExplanations.testMPQ7
|
1 PASS | |
|
0.4431818
|
org.apache.lucene.search.TestComplexExplanations.testSNot6
org.apache.lucene.search.TestComplexExplanations.testSNot6
|
1 PASS | |
|
0.4431818
|
org.apache.lucene.search.TestComplexExplanations.testFQ5
org.apache.lucene.search.TestComplexExplanations.testFQ5
|
1 PASS | |
|
0.4431818
|
org.apache.lucene.search.TestComplexExplanations.testST3
org.apache.lucene.search.TestComplexExplanations.testST3
|
1 PASS | |
|
0.4431818
|
org.apache.lucene.search.TestComplexExplanations.testSNot3
org.apache.lucene.search.TestComplexExplanations.testSNot3
|
1 PASS | |
|
0.4431818
|
org.apache.lucene.search.TestComplexExplanations.testSF7
org.apache.lucene.search.TestComplexExplanations.testSF7
|
1 PASS | |
|
0.38636363
|
org.apache.lucene.search.TestSimpleExplanations.testBQ7
org.apache.lucene.search.TestSimpleExplanations.testBQ7
|
1 PASS | |
|
0.38636363
|
org.apache.lucene.search.TestSimpleExplanations.testDMQ5
org.apache.lucene.search.TestSimpleExplanations.testDMQ5
|
1 PASS | |
|
0.38636363
|
org.apache.lucene.search.TestSimpleExplanations.testBQ8
org.apache.lucene.search.TestSimpleExplanations.testBQ8
|
1 PASS | |
|
0.3181818
|
org.apache.lucene.search.TestNot.testNot
org.apache.lucene.search.TestNot.testNot
|
1 PASS | |
|
0.29545453
|
org.apache.lucene.search.TestBooleanScorer.testMethod
org.apache.lucene.search.TestBooleanScorer.testMethod
|
1 PASS | |
| 1 | package org.apache.lucene.search; | |
| 2 | ||
| 3 | /** | |
| 4 | * Copyright 2005 The Apache Software Foundation | |
| 5 | * | |
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 7 | * you may not use this file except in compliance with the License. | |
| 8 | * You may obtain a copy of the License at | |
| 9 | * | |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 11 | * | |
| 12 | * Unless required by applicable law or agreed to in writing, software | |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 15 | * See the License for the specific language governing permissions and | |
| 16 | * limitations under the License. | |
| 17 | */ | |
| 18 | ||
| 19 | import java.io.IOException; | |
| 20 | ||
| 21 | ||
| 22 | /** A Scorer for queries with a required subscorer and an excluding (prohibited) subscorer. | |
| 23 | * <br> | |
| 24 | * This <code>Scorer</code> implements {@link Scorer#skipTo(int)}, | |
| 25 | * and it uses the skipTo() on the given scorers. | |
| 26 | */ | |
| 27 | public class ReqExclScorer extends Scorer { | |
| 28 | private Scorer reqScorer, exclScorer; | |
| 29 | ||
| 30 | /** Construct a <code>ReqExclScorer</code>. | |
| 31 | * @param reqScorer The scorer that must match, except where | |
| 32 | * @param exclScorer indicates exclusion. | |
| 33 | */ | |
| 34 | 8957 |
public ReqExclScorer( |
| 35 | Scorer reqScorer, | |
| 36 | Scorer exclScorer) { | |
| 37 | 8957 | super(null); // No similarity used. |
| 38 | 8957 | this.reqScorer = reqScorer; |
| 39 | 8957 | this.exclScorer = exclScorer; |
| 40 | } | |
| 41 | ||
| 42 | private boolean firstTime = true; | |
| 43 | ||
| 44 | 11096 |
public boolean next() throws IOException { |
| 45 | 11096 | if (firstTime) { |
| 46 | 6767 | if (! exclScorer.next()) { |
| 47 | 783 | exclScorer = null; // exhausted at start |
| 48 | } | |
| 49 | 6767 | firstTime = false; |
| 50 | } | |
| 51 | 11096 | if (reqScorer == null) { |
| 52 | 0 | return false; |
| 53 | } | |
| 54 | 11096 | if (! reqScorer.next()) { |
| 55 | 3768 | reqScorer = null; // exhausted, nothing left |
| 56 | 3768 | return false; |
| 57 | } | |
| 58 | 7328 | if (exclScorer == null) { |
| 59 | 2052 | return true; // reqScorer.next() already returned true |
| 60 | } | |
| 61 | 5276 | return toNonExcluded(); |
| 62 | } | |
| 63 | ||
| 64 | /** Advance to non excluded doc. | |
| 65 | * <br>On entry: | |
| 66 | * <ul> | |
| 67 | * <li>reqScorer != null, | |
| 68 | * <li>exclScorer != null, | |
| 69 | * <li>reqScorer was advanced once via next() or skipTo() | |
| 70 | * and reqScorer.doc() may still be excluded. | |
| 71 | * </ul> | |
| 72 | * Advances reqScorer a non excluded required doc, if any. | |
| 73 | * @return true iff there is a non excluded required doc. | |
| 74 | */ | |
| 75 | ||