I am struggling to do searchs for like emails and phone numbers.
For instance we have a strig field in the index called PhoneNumber and it might have “(555) 555 -5555” but when I try to search 555-5555 or 555- I get no results. Another is CustomerEmail with “[email protected]’ and searching abs@ gives no results. I have seen tokens and analyzers but have not got it to work. Are there any examples on querying for emails or phone or special characters for .net sdk or github?
so a user can type in say '(816)555-5555' or '816 555-5555' and it would find 81655555555 in index?
What analyzer configurations have you tried? It all comes down to how your documents and query terms are processed what you can learn about from the following article: How full text search works in Azure Search.
With the
standard
analyzer, the phone number(555) 555-5555
is tokenized to:555
,555
,5555
. Searching for 555-5555 should return it as your query becomes555
OR5555
.Same for the email address, [email protected] is tokenized to :
abs
,gmail.com
. The@
character is removed from your query term so your query becomesabs
what should find a match.Could you share an example of your queries and index configuration?