postgresql - Indexing column for full text search -
i have column col
data type character varying
i need index column gin
index. if trying directly set gin index column, returned error:
data type character varying has no default operator class access method "gin" hint: must specify operator class index or define default operator class data type
if trying:
create index col_vector on mytable using gin (to_tsvector(col))
i got error: functions in index expression must marked immutable
how create gin
index character varying
column ?
p.s. need full text search
try code:
create index "name " on "tablename" using gin(to_tsvector('english', "columnname"));
Comments
Post a Comment