ALTER TABLE companies
ADD COLUMN fti_business tsvector;UPDATE companies SET fti_business = to_tsvector('default',business_model);
VACUUM FULL ANALYZE companies;
CREATE INDEX idx_fti_business ON companies USING gist(fti_business);
CREATE TRIGGER tg_fti_companies
BEFORE UPDATE OR INSERT ON companies
FOR EACH ROW EXECUTE PROCEDURE
tsearch2(fti_business, business_model);SELECT company_name, business_model
FROM companies
WHERE fti_business @@
to_tsquery('default','bushing | engine');URL: http://www.opennet.me/opennews/art.shtml?num=3801
Обсуждается: http://www.opennet.me/tips/info/677.shtml
не плохо было бы указывать версию PostgreSQL. начиная с 8.2 там все сильно изменилось с tsearch2...