Index/search email addresses

14 views
Skip to first unread message

Ian Vaughan

unread,
Dec 5, 2014, 11:10:57 AM12/5/14
to ruby-s...@googlegroups.com
I am lost as to why my email addresses are not fully searchable.

Given a short match query it finds it :

pry(main)> Account.search { fulltext "ian.here*som" }.results
=> [#<Account id: 21185, email_address_primary: "ian....@somecompany.com",

Add one more matching later, and it does not hit :

pry(main)> Account.search { fulltext "ian.here*some" }.results
=> []

And using the ampersand also results in no hits :

pry(main)> Account.search { fulltext "ian.here@som" }.results
=> []

This is the lucene query string :

pry(main)> Account.search { fulltext "ian.here*som" }
=> <Sunspot::Search:{:fq=>["type:Account"], :q=>"ian.here*som", :fl=>"* score", :qf=>"name_given_name_text email_address_primary_text", :defType=>"edismax", :start=>0, :rows=>30}>

Model has searchable
 
        text :email_address_primary


Reply all
Reply to author
Forward
0 new messages