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

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

php - Using str_replace to translate a MySQL Table in html -

asp.net mvc - Cannot display error message on Editor or EditorFor -