[Xapian-discuss] 100% relevant again

Francis Irving francis at flourish.org
Wed Nov 3 18:18:29 GMT 2004


On Wed, Nov 03, 2004 at 10:54:08AM +0000, Olly Betts wrote:
> 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.

Yes, the middle column of numbers comes out as all zero.
 
> 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.

This patch works.  By which I mean, my test script which creates an
index and breaks now functions correctly after I installed
Search-Xapian-0.8.3.0 with the below patch.

Fab!  Now off to rebuild the complete search database again.
 
> (Alex: this is definitely wrong, but I'll add some test cases and send
> you a more polished patch later today...)
> 
> Cheers,
>     Olly

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

> _______________________________________________
> Xapian-discuss mailing list
> Xapian-discuss at lists.xapian.org
> http://lists.xapian.org/mailman/listinfo/xapian-discuss


-- 
Web: http://www.flourish.org  email: francis at flourish.org



More information about the Xapian-discuss mailing list