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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -