postgresql - rails pg_search: which model attribute contained the search term? -
fairly simple question hope has simple answer:
i'm using pg_search scopes in rails app: https://github.com/casecommons/pg_search#pg_search_scope
how know which columns on model contained relevant search terms? assume i'm searching against :headline
, :expertise
columns on user model , want know whether it's :headline
or :expertise
column hit pg_search query such "ruby on rails"?
in user model:
include pgsearch
pg_search_scope :search, against: [:headline, :expertise],
thanks!
Comments
Post a Comment