scopes with multiple languages?

22 views
Skip to first unread message

John Small

unread,
May 1, 2015, 4:07:09 PM5/1/15
to casecom...@googlegroups.com
I have a relatively simple table with a few text fields that will be searched using pg_search. But they have many languages, how do I set up a scope to deal with that?

The documentation gives this example

pg_search_scope :fast_content_search,
                :against => :content,
                :using => {
                  dmetaphone: {
                    tsvector_column: 'tsvector_content_dmetaphone'
                  },
                  tsearch: {
                    dictionary: 'english',
                    tsvector_column: 'tsvector_content_tsearch'
                  }
                  trigram: {} # trigram does not use tsvectors
                }/
But what if I want to search for 'french' or 'spanish' and will be including another column 'locale' to limit the search to only those records in the right language? 

Reply all
Reply to author
Forward
0 new messages