|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ConjunctionScorer | Line # 24 | 53 | 26 | 96.9% |
0.96938777
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (39) | |||
| Result | |||
|
0.96938777
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testRandomQueries
org.apache.lucene.search.TestBooleanMinShouldMatch.testRandomQueries
|
1 PASS | |
|
0.96938777
|
org.apache.lucene.search.TestBoolean2.testRandomQueries
org.apache.lucene.search.TestBoolean2.testRandomQueries
|
1 PASS | |
|
0.93877554
|
org.apache.lucene.search.TestScorerPerf.testConjunctions
org.apache.lucene.search.TestScorerPerf.testConjunctions
|
1 PASS | |
|
0.8979592
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testOneOptionalEqualToMin
org.apache.lucene.search.TestBooleanMinShouldMatch.testOneOptionalEqualToMin
|
1 PASS | |
|
0.86734694
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testMinEqualToNumOptional
org.apache.lucene.search.TestBooleanMinShouldMatch.testMinEqualToNumOptional
|
1 PASS | |
|
0.85714287
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testSomeReqAndSomeOptional
org.apache.lucene.search.TestBooleanMinShouldMatch.testSomeReqAndSomeOptional
|
1 PASS | |
|
0.85714287
|
org.apache.lucene.search.spans.TestSpansAdvanced.testBooleanQueryWithSpanQueries
org.apache.lucene.search.spans.TestSpansAdvanced.testBooleanQueryWithSpanQueries
|
1 PASS | |
|
0.85714287
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testSomeReqSomeProhibAndSomeOptional
org.apache.lucene.search.TestBooleanMinShouldMatch.testSomeReqSomeProhibAndSomeOptional
|
1 PASS | |
|
0.85714287
|
org.apache.lucene.search.TestSimpleExplanations.testBQ1
org.apache.lucene.search.TestSimpleExplanations.testBQ1
|
1 PASS | |
|
0.85714287
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testSomeReqOneProhibAndSomeOptional
org.apache.lucene.search.TestBooleanMinShouldMatch.testSomeReqOneProhibAndSomeOptional
|
1 PASS | |
|
0.85714287
|
org.apache.lucene.search.spans.TestSpansAdvanced2.testBooleanQueryWithSpanQueries
org.apache.lucene.search.spans.TestSpansAdvanced2.testBooleanQueryWithSpanQueries
|
1 PASS | |
|
0.85714287
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testOneReqOneProhibAndSomeOptional
org.apache.lucene.search.TestBooleanMinShouldMatch.testOneReqOneProhibAndSomeOptional
|
1 PASS | |
|
0.85714287
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testOneReqAndSomeOptional
org.apache.lucene.search.TestBooleanMinShouldMatch.testOneReqAndSomeOptional
|
1 PASS | |
|
0.85714287
|
org.apache.lucene.search.TestSimpleExplanations.testBQ10
org.apache.lucene.search.TestSimpleExplanations.testBQ10
|
1 PASS | |
|
0.85714287
|
org.apache.lucene.search.TestBooleanMinShouldMatch.testOneReqSomeProhibAndSomeOptional
org.apache.lucene.search.TestBooleanMinShouldMatch.testOneReqSomeProhibAndSomeOptional
|
1 PASS | |
|
0.82653064
|
org.apache.lucene.search.spans.TestSpansAdvanced2.testMultipleDifferentSpanQueries
org.apache.lucene.search.spans.TestSpansAdvanced2.testMultipleDifferentSpanQueries
|
1 PASS | |
|
0.82653064
|
org.apache.lucene.search.spans.TestBasics.testBoolean
org.apache.lucene.search.spans.TestBasics.testBoolean
|
1 PASS | |
|
0.82653064
|
org.apache.lucene.search.TestDisjunctionMaxQuery.testBooleanRequiredEqualScores
org.apache.lucene.search.TestDisjunctionMaxQuery.testBooleanRequiredEqualScores
|
1 PASS | |
|
0.82653064
|
org.apache.lucene.search.TestSimpleExplanations.testBQ2
org.apache.lucene.search.TestSimpleExplanations.testBQ2
|
1 PASS | |
|
0.82653064
|
org.apache.lucene.search.TestPhraseQuery.testPhraseQueryInConjunctionScorer
org.apache.lucene.search.TestPhraseQuery.testPhraseQueryInConjunctionScorer
|
1 PASS | |
|
0.7755102
|
org.apache.lucene.search.TestSimpleExplanations.testBQ7
org.apache.lucene.search.TestSimpleExplanations.testBQ7
|
1 PASS | |
|
0.70408165
|
org.apache.lucene.search.TestBoolean2.testQueries10
org.apache.lucene.search.TestBoolean2.testQueries10
|
1 PASS | |
|
0.70408165
|
org.apache.lucene.search.TestBoolean2.testQueries09
org.apache.lucene.search.TestBoolean2.testQueries09
|
1 PASS | |
|
0.63265306
|
org.apache.lucene.search.TestBoolean2.testQueries01
org.apache.lucene.search.TestBoolean2.testQueries01
|
1 PASS | |
|
0.63265306
|
org.apache.lucene.search.TestMultiPhraseQuery.testBooleanQueryContainingSingleTermPrefixQuery
org.apache.lucene.search.TestMultiPhraseQuery.testBooleanQueryContainingSingleTermPrefixQuery
|
1 PASS | |
|
0.63265306
|
org.apache.lucene.search.TestMatchAllDocsQuery.testQuery
org.apache.lucene.search.TestMatchAllDocsQuery.testQuery
|
1 PASS | |
|
0.63265306
|
org.apache.lucene.search.TestConstantScoreRangeQuery.testBooleanOrderUnAffected
org.apache.lucene.search.TestConstantScoreRangeQuery.testBooleanOrderUnAffected
|
1 PASS | |
|
0.5714286
|
org.apache.lucene.index.TestParallelReader.testQueries
org.apache.lucene.index.TestParallelReader.testQueries
|
1 PASS | |
|
0.5714286
|
org.apache.lucene.search.TestBoolean2.testQueries06
org.apache.lucene.search.TestBoolean2.testQueries06
|
1 PASS | |
|
0.5714286
|
org.apache.lucene.search.TestBooleanOr.testParenthesisMust
org.apache.lucene.search.TestBooleanOr.testParenthesisMust
|
1 PASS | |
|
0.5714286
|
org.apache.lucene.search.TestBooleanScorer.testMethod
org.apache.lucene.search.TestBooleanScorer.testMethod
|
1 PASS | |
|
0.5714286
|
org.apache.lucene.search.TestBoolean2.testQueries05
org.apache.lucene.search.TestBoolean2.testQueries05
|
1 PASS | |
|
0.5714286
|
org.apache.lucene.search.TestSimpleExplanations.testBQ8
org.apache.lucene.search.TestSimpleExplanations.testBQ8
|
1 PASS | |
|
0.5714286
|
org.apache.lucene.analysis.TestKeywordAnalyzer.testPerFieldAnalyzer
org.apache.lucene.analysis.TestKeywordAnalyzer.testPerFieldAnalyzer
|
1 PASS | |
|
0.52040815
|
org.apache.lucene.search.spans.TestBasics.testBoolean2
org.apache.lucene.search.spans.TestBasics.testBoolean2
|
1 PASS | |
|
0.48979592
|
org.apache.lucene.search.TestMultiPhraseQuery.testPhrasePrefixWithBooleanQuery
org.apache.lucene.search.TestMultiPhraseQuery.testPhrasePrefixWithBooleanQuery
|
1 PASS | |
|
0.48979592
|
org.apache.lucene.search.TestFilteredQuery.testBoolean
org.apache.lucene.search.TestFilteredQuery.testBoolean
|
1 PASS | |
|
0.47959185
|
org.apache.lucene.search.TestSimpleExplanations.testBQ9
org.apache.lucene.search.TestSimpleExplanations.testBQ9
|
1 PASS | |
|
0.3469388
|
org.apache.lucene.search.TestMultiSearcherRanking.testNoMatchQuery
org.apache.lucene.search.TestMultiSearcherRanking.testNoMatchQuery
|
1 PASS | |
| 1 | package org.apache.lucene.search; | |
| 2 | ||
| 3 | /** | |
| 4 | * Copyright 2006 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 | import java.util.Arrays; | |
| 21 | import java.util.Comparator; | |
| 22 | ||
| 23 | /** Scorer for conjunctions, sets of queries, all of which are required. */ | |
| 24 | class ConjunctionScorer extends Scorer { | |
| 25 | private Scorer[] scorers = new Scorer[2]; | |
| 26 | private int length = 0; | |
| 27 | private int first = 0; | |
| 28 | private int last = -1; | |
| 29 | private boolean firstTime = true; | |
| 30 | private boolean more = true; | |
| 31 | private float coord; | |
| 32 | ||
| 33 | 43217 |
public ConjunctionScorer(Similarity similarity) { |
| 34 | 43217 | super(similarity); |
| 35 | } | |
| 36 | ||
| 37 | 117596 |
final void add(Scorer scorer) { |
| 38 | 117596 | if (length >= scorers.length) { |
| 39 | // grow the array | |
| 40 | 25743 | Scorer[] temps = new Scorer[scorers.length * 2]; |
| 41 | 25743 | System.arraycopy(scorers, 0, temps, 0, length); |
| 42 | 25743 | scorers = temps; |
| 43 | } | |
| 44 | 117596 | last += 1; |
| 45 | 117596 | length += 1; |
| 46 | 117596 | scorers[last] = scorer; |
| 47 | } | |
| 48 | ||
| 49 | 45241 |
public int doc() { return scorers[first].doc(); } |
| 50 | ||
| 51 | 50778 |
public boolean next() throws IOException { |
| 52 | 50778 | if (firstTime) { |
| 53 | 41399 | init(true); |
| 54 | 9379 | } else if (more) { |
| 55 | 9379 | more = scorers[last].next(); // trigger further scanning |
| 56 | } | |
| 57 | 50778 | return doNext(); |
| 58 | } | |
| 59 | ||
| 60 | 55835 |
private boolean doNext() throws IOException { |
| 61 | 122306 | while (more && scorers[first].doc() < scorers[last].doc()) { // find doc w/ all clauses |
| 62 | 66471 | |