[Xapian-discuss] 100% relevant again

Olly Betts olly at survex.com
Wed Nov 3 10:54:08 GMT 2004


On Wed, Nov 03, 2004 at 09:53:25AM +0000, Francis Irving wrote:
> > If it's not the above, I'd suggest building a debug version of Xapian
> > (configure with --enable-debug).  That will enable various consistency
> > checks which might flag something up.
> 
> I've done that.  How should I expect the consistency checks to occur?

Just use the code - they're assert-type tests.  If one fails it throws
Xapian::AssertionError.

> Any other suggestions for debugging this?

Reading back up the thread, I wonder if all terms have wdf 0.  That's
easy to test - just run:

    delve /path/to/db -v -1 -t TERM|head

where TERM is a term in /path/to/db.  The output should be something
like:

Posting List for term `bug':
1 2 22
12 1 1386
29 1 668
33 2 561
46 2 851
48 2 220
50 7 599
52 1 673
85 3 163

The numbers are (docid, wdf, document length).

A quick poke with the Perl bindings suggests that they get this wrong.

If the middle column above is all zeros, try the attached patch.  I sent
Alex a large stack of changes (wrapping missing methods and classes, and
fixing some broken wrapping) and he uploaded Search::Xapian 0.8.3.0 last
week - you'll probably need to start from that to apply this successfully.

(Alex: this is definitely wrong, but I'll add some test cases and send
you a more polished patch later today...)

Cheers,
    Olly
-------------- next part --------------
diff -ru1 Search-Xapian-0.8.3.0-orig/XS/Document.xs Search-Xapian-0.8.3.0/XS/Document.xs
--- Search-Xapian-0.8.3.0-orig/XS/Document.xs	2004-10-28 16:43:47.000000000 +0100
+++ Search-Xapian-0.8.3.0/XS/Document.xs	2004-11-03 10:46:53.000000000 +0000
@@ -50,3 +50,3 @@
     CODE:
-        if (items == 3) {
+        if (items == 4) { /* items includes the hidden this pointer */
             THIS->add_posting(tname, tpos, wdfinc);
@@ -61,3 +61,3 @@
     CODE:
-        if (items == 2) {
+        if (items == 3) { /* items includes the hidden this pointer */
             THIS->add_term(tname, wdfinc);
@@ -74,3 +74,3 @@
 	try {
-            if (items == 3) {
+            if (items == 4) { /* items includes the hidden this pointer */
                 THIS->remove_posting(tname, tpos, wdfdec);
diff -ru1 Search-Xapian-0.8.3.0-orig/XS/Enquire.xs Search-Xapian-0.8.3.0/XS/Enquire.xs
--- Search-Xapian-0.8.3.0-orig/XS/Enquire.xs	2004-10-28 16:43:47.000000000 +0100
+++ Search-Xapian-0.8.3.0/XS/Enquire.xs	2004-11-03 10:47:35.000000000 +0000
@@ -43,3 +43,3 @@
     CODE:
-        if (items == 2) {
+        if (items == 3) { /* items includes the hidden this pointer */
             THIS->set_cutoff(percent_cutoff, weight_cutoff);
@@ -55,3 +55,3 @@
     CODE:
-        if (items == 3) {
+        if (items == 4) { /* items includes the hidden this pointer */
 	    THIS->set_sorting(sort_key, sort_bands, sort_by_relevance);
diff -ru1 Search-Xapian-0.8.3.0-orig/XS/QueryParser.xs Search-Xapian-0.8.3.0/XS/QueryParser.xs
--- Search-Xapian-0.8.3.0-orig/XS/QueryParser.xs	2004-10-28 16:43:47.000000000 +0100
+++ Search-Xapian-0.8.3.0/XS/QueryParser.xs	2004-11-03 10:48:29.000000000 +0000
@@ -16,3 +16,3 @@
     CODE:
-	if (items == 1)
+	if (items == 2) /* items includes the hidden this pointer */
 	    THIS->set_stemming_options(lang);


More information about the Xapian-discuss mailing list