Reference Page: http://www.sqlite.org/fts3.html#appendix_a

At the bottom of the page, there is a sample c file to calculate the 
rank, and a FTS query to use it.  I can't get it to work.

You can see my files here:

http://coldmist.homeip.net/quotes_sql_test.txt
http://coldmist.homeip.net/rank.c.txt

 > gcc -shared -fPIC -I/opt/include -o rank.so rank.c
 > rm test.sql; sqlite3 test.sql <quotes_sql_test.txt

The C file compiles without errors or warnings on my x86 Linux machine 
(and I verified one plugin I found compiled and worked fine, just to 
remove build issues as a cause), but when I execute the import, it 
complains with this:

Error: near line 16: wrong number of arguments to function myrank()

C is not my strong language, but I played with it a bit, and couldn't 
figure out what is going on with it.

Overall, I'd like to be able to set up 2 sqlite3 FTS databases. One that 
holds quotes, with ranked search output, as the above example is trying 
to do.

The other one is to hold entire books, with some minimal structure, like 
'Book / Volume or Section / Chapter / text' so that I could do a query 
to show a list of all the books in the db, then when one is selected, it 
would show all chapters in a clickable list on the left side of a web 
page, with the text from a selected chapter on the right.  Or be able to 
search, and have the results ranked, with the output like this:

book / Chapter:
    Hit 1's paragraph text
Book / Chapter:
    Hit 2's paragraph text

I want the search results to be limited to either a specific chapter, a 
specific book, or over the entire database, via select boxes in the 
book/chapter list displayed on the left of a web page.

One question I have about this FTS stuff, is do I need to insert the 
text twice, once in the virtual table, and again in a real table?  The 
examples from the page above doesn't really show that, but some of the 
replies on this list imply that I would.

Any help with this would be greatly appreciated.

Ryan

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

Reply via email to