[Zope] relevance ranking in ZCTextIndex or equivalent

Dieter Maurer dieter at handshake.de
Sat Jun 3 07:23:13 EDT 2006


Miles Waller wrote at 2006-5-31 15:59 +0100:
>I'm planning to implement a text search where
>
>(match against the title)
>  ranks more highly than
>(match in the description)
>  ranks more highly than
>(matches against the body text).

If you are lucky, "AdvancedQuery" will soon support ranking:

  For efficiency reasons, it will not use term frequencies -- thus,
  you will not have the form of ranking you know now from ZCTextIndex.

  Instead, the rank will be determined by evaluating which
  queries are fullfilled by the document.

  It will look like:

     evalAdvancedQuery(q, rank=((v_1,q_1), (v_2,q_1), ... (v_n,q_n)))

  The rank of document "d" with be the sum of the "v_i" for with
  "d" matches "q_i" divided by the sum of all "v_i".



-- 
Dieter


More information about the Zope mailing list