>>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? I use SQLite as backend to build a dictionary so my requirements might not be typical (indexing a large number of very small documents, bm25 is not a good fit) Right now the main reason I want to be able to get the query term in the ranking function is to boost shorter matches over longer, partial ones: foo* => [ foo, foobar, foobarbaz ] I was expecting to be able to get a reference to the query term expression, something like: Fts5ExprTerm *(*xPhraseTerm)(Fts5Context*, int iPhrase, int iTerm) But actually I think for now I might be able to do this sort of ranking without knowing the exact query term, just by simply scoring results based on their length. – Jan _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users