Since fts3 development is sort of sporadic, I figure it's worth a heads-up about a minor feature I've recently checked in.
-scott *** http://www.sqlite.org/cvstrac/chngview?cn=5417 optimize() function. This takes all segments in the fts3 index and merges them into a single segment. As a side effect, it also removes deleted-token records from the index, which is actually the behavior that convinced me to implement it (some fts users had asked privacy-related questions). Usage is like: SELECT optimize(t) FROM t LIMIT 1; The use of LIMIT 1 is a hack. Virtual tables allow local functions, but the function applies per row of the table. optimize() tries to be smart about detecting whether it's being called on an already-optimized table, so omitting the LIMIT 1 isn't deadly, but it is wasted effort. *** http://www.sqlite.org/cvstrac/chngview?cn=5413 While writing optimize(), I wanted to test that when I had deleted everything from the table, optimize() would delete the entire index. Due to how virtual table functions are implemented, this was impossible - because there were no rows remaining, SQLite wouldn't call optimize() in this case! I realized that it would be better to just detect empty and automatically drop the index data. *** http://www.sqlite.org/cvstrac/chngview?cn=5340 Implements some fts3 testing functions when compiling with SQLITE_TEST. In writing the above code, I wanted to be able to write tests which verified that things were working correctly internally. I imagine this code will mutate substantially over time to provide better testing. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users