On 06/30/2011 08:55 PM, Ryan Henrie wrote:
> Even if I use the stock example from the web page, with only 2 columns,
> and the exact schema from the example, I get the same result.
>
> I'm wondering if it is a bug in the example code on the website (ie the
> source code has moved on, invalidating an example based on old code), or
> it's just something in turning their c code example into a full
> extension that I didn't do right.
>
> From the extension's source code:
>
> nCol = aMatchinfo[1];
> if( nVal!=(*1+nCol*) ) goto wrong_number_args;
>
> So, it should scale with the number of columns. (I would hope it's not
> hardcoded to a set number of columns!)
The page is a bit deceptive. The key phrase relating to the C code
example is:
"Instead of a single weight, it allows a weight to be externally
assigned to each column of each document."
Making the C code function incompatible with the SQL example above
it. The C code function would work with the example in its header
comment:
CREATE VIRTUAL TABLE documents USING fts3(title, content);
SELECT docid FROM documents
WHERE documents MATCH <query>
ORDER BY rank(matchinfo(documents), 1.0, 0.5) DESC;
It wouldn't be real hard to adapt the C code so that it accepted
a single weight argument like the hypothetical function in the
SQL example above it.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users