On 08/11/2016 04:41 PM, Jan Berkel wrote:
You could run a regular database query from within the auxiliary
function implementation. Not sure how that would perform though -
perhaps similarly to the FTS3/4 approach, perhaps a little better.
Or, you could add the "weight" as an UNINDEXED column to the fts5
documents table. Then access it via the auxiliary function xColumn()
API.
Thanks, I was under the assumption that this would be slow, since the
xColumn() access will cause the whole row to be loaded (separately,
instead of the more efficient join upfront), but I'll try it.

Another open question I have is how to access the user query expression
from within the ranking function. Don't think this is exposed anywhere.
(Looking at the source I noticed Fts5Expr *, but it is private).

The best option would then be to pass it through to the
ranking function as a parameter?

I guess so. You can't actually get at the query text from within an auxiliary function implementation. You can get the number of phrases, query the FTS index for each phrase and some other things, but the actual query text or parsed query is not currently available.

What exactly do you need? What do you think the API should look like?

Dan.


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

Reply via email to