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?