Phone # search query


(Nitin Goel) #1

I am having the phone # in the following format

(123) 456-789

I would like to build a search query which will result me this phone whenever user specify any of the following values

12
123
12345
1234567
123456789

Because of special characters '(', I am facing it difficult to get it.

May I know the best possible way to achieve this?


(Nik Everett) #2

I'd do phone numbers with a prefix search or a completion suggester and I'd strip all the special characters on the application side. You could also look at the pattern replace token filter.


(system) #3