I'm currently implementing FTS5 in my application and I'm at the stage
where
I want to rank the results in an efficient way. I'm following the
examples
from "Appendix A: Search Application Tips"
(https://www.sqlite.org/fts3.html#appendix_a).

Similar to the example there I have a static weight component (a
separate rank
table with scores) which I want to combine with a query-specific ranking
function. The FTS4 example from the appendix reads:

  SELECT docid, rank(matchinfo(documents), documents_data.weight) AS
  rank
  ...
  ORDER BY RANK desc

The rank function gets the static score passed in and calculates a new
score, 
taking the query into account.

In FTS5, rank functions are defined with

 SELECT ... WHERE fts MATCH ? AND rank MATCH 'functionName(parameters)'
 ORDER BY RANK

The parameters need to be SQL literals, therefore I can't
pass in arbitrary data as done in the previous FTS4 example.

What would be the best way to pass the data to the function, in order to
achieve similar results?
As far as I can tell the function does not have access to the "outer"
data.

  Thanks, 

    Jan


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to