在Rails應用中使用Postgres(使用pg_search gem),我已經使用tsvector進行搜索。在與超過35,000條記錄的數據庫我得到幾個消息說導致哪條記錄通知:單詞太長,無法索引
NOTICE: word is too long to be indexed
DETAIL: Words longer than 2047 characters are ignored.
上午我在承擔一個「字」糾正不包括空白?我如何確定哪些記錄導致此消息?
這裏是由它引入了索引
== AddIndexForFullTextSearch: migrating ======================================
-- add_column(:posts, :tsv, :tsvector)
-> 0.0344s
-- execute(" CREATE INDEX index_posts_tsv ON posts USING gin(tsv);\n")
-> 0.1694s
-- execute(" UPDATE posts SET tsv = (to_tsvector('english', coalesce(title, '')) || \n to_tsvector('english', coalesce(intro, '')) || \n to_tsvector('english', coalesce(body, '')));\n")
NOTICE: word is too long to be indexed
DETAIL: Words longer than 2047 characters are ignored.
NOTICE: word is too long to be indexed
DETAIL: Words longer than 2047 characters are ignored.
NOTICE: word is too long to be indexed
DETAIL: Words longer than 2047 characters are ignored.
NOTICE: word is too long to be indexed
DETAIL: Words longer than 2047 characters are ignored.
-> 343.0556s
-- execute(" CREATE TRIGGER tsvectorupdate BEFORE INSERT OR UPDATE\n ON posts FOR EACH ROW EXECUTE PROCEDURE\n tsvector_update_trigger(tsv, 'pg_catalog.english', title, intro, body);\n")
-> 0.0266s
這裏是[關於抑制這些通知的問題](http://stackoverflow.com/q/12925623/578288) –