On Fri, Aug 12, 2011 at 11:27 AM, john Papier <johnpap...@gmail.com> wrote:
> I have a FTS3 table that was created with the simple tokenizer. I want to
> change the tokenizer and reindex the table.
>
> Is there a way to change the tokenizer in place and have it reindex with
> minimal code?
>
> Else the other option I was thinking about was dropping the table,
> re-creating it with the new tokenizer, and inserting back the data

That's the option!  Make it seamless something like:

BEGIN;
ALTER TABLE my_table RENAME TO my_table_tmp;
CREATE VIRTUAL TABLE my_table USING FTS3(blah blah blah);
INSERT INTO my_table SELECT x, y, z FROM my_table_tmp;
DROP TABLE my_table_tmp;
COMMIT;

There's really not anything more in-place, because the code would have
to be tricky, like remembering which rows were indexed with which
tokenizer, so that it can update the right parts of the index when the
row is updated or deleted.

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

Reply via email to