You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ro...@apache.org on 2005/02/28 01:48:17 UTC

svn commit: r155655 - in incubator/lucene4c/trunk: src/search/scorer.c test/search/scorer_test.c

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);
 }