我正在關注this Railscasts插曲。將前綴匹配添加到pg_search
如果我搜索「Kerber」,它會返回正確的文章。 但是,如果我搜索「Ke」它不會返回相同的文章。
有辦法解決這個問題嗎?
class Item < ActiveRecord::Base
include PgSearch
pg_search_scope :search, against: [:description, :about, :link, :twitterhandle, :builtby],
using: {tsearch: {dictionary: "english"}}
def self.text_search(query)
if query.present?
search(query)
else
scoped
end
end
方便,謝謝你的跟進。那麼多關於如此多不同工具包,語言等的[tag:postgresql]問題......無法全面瞭解它們的細節。 – 2013-04-23 23:34:07