[zope2-tracker] [Bug 815469] Re: ZCatalog 2.13.12 doesn't preserve relevance in search results

Hanno Schlichting hanno at hannosch.eu
Sun Jul 24 12:54:16 EDT 2011


Hhm, looks like I wasn't careful enough when trying to understand what
weightedIntersection actually does. I tracked it down to the C code,
where it boils down to:

intersection (intersection_m):

set_operation(o1, o2, 0, 0, 1, 1, 0, 1, 0);

weightedIntersection (wintersection_m):

set_operation(o1, o2, 1, 1, 1, 1, 0, 1, 0);

The fifth and sixth arguments are the weights, thus being equal. We used
that in a call that basically did:

rs = None
r = _apply_index(query)
w, rs = weightedIntersection(rs, r)

and then ignored w.

So I was assuming this had no effect. But looking again, it seems that
weightedIntersection is actually sneaky. It doesn't actually return a
set as everyone else does, but it returns a mapping. The third and forth
argument of the set_operation call are named "use_values". ZCTextIndex
is the only index that returns a mapping and puts that into the
apparently misnamed "resultset" variable.

I'll fix this. I've tried to improve the test coverage of ZCatalog, but
there's still many glaring holes - any help is welcome.

-- 
You received this bug notification because you are a member of Zope 2
Developers, which is subscribed to Zope 2.
https://bugs.launchpad.net/bugs/815469

Title:
  ZCatalog 2.13.12 doesn't preserve relevance in search results

To manage notifications about this bug go to:
https://bugs.launchpad.net/zope2/+bug/815469/+subscriptions


More information about the zope2-tracker mailing list