【发布时间】:2017-09-06 04:12:08
【问题描述】:
我的 postgres 表中有 jsonb 列,我只想搜索一个键而不是所有键。
例如
Book.create!(details: {authour: 'example', title: 'something'}
class Book < ApplicationRecord
include PgSearch
pg_search_scope :search,
against: [
:details
]
end
我想搜索标题并忽略作者姓名。
【问题讨论】:
标签: ruby-on-rails postgresql activerecord pg-search