- Where Developers Learn, Share, & Build Careers


I have a list of restaurants, which I want to match with the restaurant in my database using the phone number. The problem is that numbers are formatted separately (i.e. (123) 123-1234 or 123 123-123 or other combination).

My current solar search looks like this:

  search = restaurant / Search (Phone, SanspotHelper, sanitize_term (pr.phone) .gsub (/ \ s + /, "")) with page: 1, per page: 15 end   

SunspotHelper.sanitize_term (pr.phone) .gsub (/ \ s + /, "") will strip down my search query just numbers However, the values ​​in my database now include other non-numeric characters And thus, search.hits returns a blank array because I can not find any results.

What

thank you

enter your phone number field Configure for
It also enables you to index phone data in various formats and make them searchable.
You will not need to make any changes to the database

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -