lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roo...@apache.org
Subject svn commit: r155655 - in incubator/lucene4c/trunk: src/search/scorer.c test/search/scorer_test.c
Date Mon, 28 Feb 2005 00:48:17 GMT
Author: rooneg
Date: Sun Feb 27 16:48:15 2005
New Revision: 155655

URL: http://svn.apache.org/viewcvs?view=rev&rev=155655
Log:
Get a bit closer to boolean queries working.

It's still not totally right, since we're missing out on the last
document because we bail when moving the previous scorer ahead the
next time through the loop.  Oops.  I Still need to find a good
way to avoid that little problem...

* src/search/scorer.c
  (pick_scorer): skip duplicate documents so they don't come up
   later.

* test/search/scorer_test.c
  (test_boolean_scorer): correct the count we're expecting, since
   we started counting at zero we want one less than the actual
   total number of hits.

Modified:
    incubator/lucene4c/trunk/src/search/scorer.c
    incubator/lucene4c/trunk/test/search/scorer_test.c

Modified: incubator/lucene4c/trunk/src/search/scorer.c
URL: http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/src/search/scorer.c?view=diff&r1=155654&r2=155655
==============================================================================
--- incubator/lucene4c/trunk/src/search/scorer.c (original)
+++ incubator/lucene4c/trunk/src/search/scorer.c Sun Feb 27 16:48:15 2005
@@ -110,6 +110,11 @@
                   bsb->last_scorer = scorer;
                   lowest = doc;
                 }
+              else if (doc == lowest)
+                {
+                  /* move on to avoid duplicates next time around... */
+                  LCN_ERR (lcn_scorer_next (scorer));
+                }
             }
         }
 

Modified: incubator/lucene4c/trunk/test/search/scorer_test.c
URL: http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/test/search/scorer_test.c?view=diff&r1=155654&r2=155655
==============================================================================
--- incubator/lucene4c/trunk/test/search/scorer_test.c (original)
+++ incubator/lucene4c/trunk/test/search/scorer_test.c Sun Feb 27 16:48:15 2005
@@ -175,7 +175,7 @@
   ABTS_INT_EQUAL (tc, APR_EOF, err->apr_err);
 
   /* expected to fail for now, should queries aren't quite working yet */
-  ABTS_INT_EQUAL (tc, 114, count);
+  ABTS_INT_EQUAL (tc, 113, count);
 
   apr_pool_clear (p);
 }



Mime
View raw message