为什么无法通过当前表的第二列进行搜索?有谁知道该如何解决?
model.rb
pg_search_scope :search,
:against => [:name, :phone_number],
using: { tsearch: { prefix: true, any_word: true } },
associated_against: {
:client => [:name, :phone_number]
}
console_log
2.5.3 :060 > Client.search("Davis, Lorentzz")
=> #<ActiveRecord::Relation [#<Client id: 100, company_id: 8, name: "Davis, Lorentzz", email: "gdrgrd@fgrd.com", variety: "person", active: nil, created_at: "2019-01-29 11:50:17", updated_at: "2019-01-29 11:50:20", phone_number: "1456455453", organisation: "", office_note: "", special_note: "Special Davis">]>
2.5.3 :061 > Client.search("1456455453")
=> #<ActiveRecord::Relation []>