Is there any reason why the tseach indexes couldn't be modified to just work
on TEXT fields and not TXTIDX fields. Is there really a reason to have the
TXTIDX type?
I mean, when the index is created over the text column, instead of just
indexing the text as-is, index the txt2txtidx'd version...?
That would vastly reduce the complexity of tsearch, and would make the
indexed text invisible, as it is in most other fti implementations...?
I tried to simulate this myself, although ideally it would be invisible to
the user:
test=# create table test (a text);
CREATE
test=# CREATE INDEX my_idx ON test USING gist(txt2txtidx(a));
ERROR: DefineIndex: index function must be marked iscachable
So the index isn't iscachable - why's that?
Say it was marked iscachable, then I'd be able to query like this:
SELECT * FROM test WHERE txt2txtidx(test) ## 'apple';
This would mean that the index on-disk file would be large, but the table
file would stay small. It would also vastly reduce the size of pg_dumps...
Could we move towards something like:
CREATE FULLTEXT INDEX my_idx ON test (a);
Or something?
Chris