I have a question about multi field search using pg_search
gem. What I want to do is make a query in multiples fields, so I have the following code in my Client
model:
pg_search_scope :search,
:against => [:name, :email],
:using => [:trigram, :tsearch],
:ignoring => :accents
For testing I have:
Client 1
name: "Anna"
email: "mycompany@foo.com"
Then I searched with Client.search("anna")
and no results are returned. Or
Client.search("nna")
also no results found.
Any suggestion here ?
Thanks in advance.
Update 1
I set the threshold
manually and it works:
pg_search_scope :search,
:against => [:name, :email],
using: {
tsearch: {},
trigram: {threshold: 0.1}
}