lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romseyg...@apache.org
Subject svn commit: r1447060 - in /lucene/dev/branches/LUCENE-2878/lucene/core/src: java/org/apache/lucene/search/intervals/ test/org/apache/lucene/search/intervals/
Date Sun, 17 Feb 2013 19:08:17 GMT
Author: romseygeek
Date: Sun Feb 17 19:08:17 2013
New Revision: 1447060

URL: http://svn.apache.org/r1447060
Log:
UnorderedNearQuery slop calculation takes into account number of subscorers; correct offset
tests

Modified:
    lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/intervals/UnorderedNearQuery.java
    lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/intervals/IntervalTestBase.java
    lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/intervals/TestDisjunctionIntervalIterator.java
    lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/intervals/TestPositionsAndOffsets.java

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/intervals/UnorderedNearQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/intervals/UnorderedNearQuery.java?rev=1447060&r1=1447059&r2=1447060&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/intervals/UnorderedNearQuery.java
(original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/intervals/UnorderedNearQuery.java
Sun Feb 17 19:08:17 2013
@@ -119,7 +119,7 @@ public class UnorderedNearQuery extends 
     }
 
     public int getMatchDistance() {
-      return lastIntervalBegin - firstIntervalEnd - 1;
+      return lastIntervalBegin - firstIntervalEnd - scorerCount + 1;
     }
 
     public boolean isFull() {

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/intervals/IntervalTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/intervals/IntervalTestBase.java?rev=1447060&r1=1447059&r2=1447060&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/intervals/IntervalTestBase.java
(original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/intervals/IntervalTestBase.java
Sun Feb 17 19:08:17 2013
@@ -62,13 +62,13 @@ public abstract class IntervalTestBase e
     searcher.search(q, c);
 
     PositionsCollector.DocPositions[] matches = c.getPositions();
-    Assert.assertEquals("Incorrect number of hits", expectedResults.length, matches.length);
+    Assert.assertEquals("Incorrect number of hits", expectedResults.length, c.getNumDocs());
     for (int i = 0; i < expectedResults.length; i++) {
       int expectedDocMatches[] = expectedResults[i];
       int docid = expectedDocMatches[0];
       Iterator<Interval> matchIt = matches[i].positions.iterator();
       for (int j = 1; j < expectedDocMatches.length; j += 2) {
-        String expectation = "Expected match at docid " + docid + ", position " + expectedDocMatches[j];
+        String expectation = "Expected match at docid " + docid + ", offset " + expectedDocMatches[j];
         Assert.assertTrue(expectation, matchIt.hasNext());
         Interval match = matchIt.next();
         System.err.println(match);

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/intervals/TestDisjunctionIntervalIterator.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/intervals/TestDisjunctionIntervalIterator.java?rev=1447060&r1=1447059&r2=1447060&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/intervals/TestDisjunctionIntervalIterator.java
(original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/intervals/TestDisjunctionIntervalIterator.java
Sun Feb 17 19:08:17 2013
@@ -73,9 +73,9 @@ public class TestDisjunctionIntervalIter
     disj.add(conj2, Occur.SHOULD);
 
     checkIntervals(disj, searcher, new int[][]{
-        { 0, 1, 2, 1, 1, 2, 4, 2, 2, 4, 4, 32, 33, 32, 32, 33, 35, 33, 33, 35, 35 },
-        { 1, 4, 5, 4, 4, 5, 7, 5, 5, 7, 7, 35, 36, 35, 35, 36, 36 },
-        { 2, 3, 8, 3, 3, 8, 8 },
+        { 0, 1, 1, 2, 2, 4, 4, 32, 32, 33, 33, 35, 35 },
+        { 1, 4, 4, 5, 5, 7, 7, 35, 35, 36, 36 },
+        { 2, 3, 3, 8, 8 },
     });
 
   }

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/intervals/TestPositionsAndOffsets.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/intervals/TestPositionsAndOffsets.java?rev=1447060&r1=1447059&r2=1447060&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/intervals/TestPositionsAndOffsets.java
(original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/intervals/TestPositionsAndOffsets.java
Sun Feb 17 19:08:17 2013
@@ -61,7 +61,7 @@ public class TestPositionsAndOffsets ext
     query.add(new BooleanClause(new TermQuery(new Term("field", "nine")),
         BooleanClause.Occur.MUST));
     checkIntervalOffsets(query,  searcher, new int[][]{
-        { 0, 47, 71, 47, 55, 67, 71, 143, 172, 143, 147, 164, 172 }
+        { 0, 6, 14, 26, 34, 47, 55, 67, 71, 143, 147, 164, 172, 184, 192 }
     });
   }
 



Mime
View raw message