[Zope] Weighing catalog searches per index ?

Casey Duncan casey at zope.com
Thu Jan 8 14:53:46 EST 2004


On Thu, 8 Jan 2004 13:43:43 -0500 
Jean-Francois.Doyon at CCRS.NRCan.gc.ca wrote:

> Hello,
> 
> Does anybody know of a decent implementation of a scoring algorithm
> that does "weighing" of results, presumably based on the indexes used
> ?

Low-level support for this already exists via the weightedIntersection
and weightedUnion set operations.

ZCatalog currently gives all indexes a weight of 1 however.
 
> I'd like to explore the possibility of searching the catalog, but
> giving results from certain indexes priority over others.

It is possible to implement an index whose results are scored. This is
used by TextIndexes to implement relevance ranking for instance. The
index just needs to return a mapping (usually a BTree) of rid->score
where rid is the record id of the catalog record. ZCatalog automatically
adds these scores when intersecting results across indexes.
 
> So in the case of the CMF, saying that if search terms are found in
> the Title or Descrption, they are more "important" than if they're
> found somewhere else and so on ...

This might be an iteresting addition to my FieldedTextIndex product.
Currently all indexed fields are weighted the same, but it would be
straightforward to make this configurable per field.
 
> I know this is a common concept in more advanced search engines (Such
> as Oracle's InterMedia), but I'm wondering if anyone has done
> something like this in Zope ...

Let me know what your specific use case is and maybe I'll add it to the
FieldedTextIndex product if it fits its usage.

-Casey



More information about the Zope mailing list