I have a string attribute WorkPhone in SP user profiles which has format like this: "+123 45-633-2153" I made a query which search by phone extension (user inputs last 4 digits and it returns user attribute, var workPhone in this case is: 2153):

url: _spPageContextInfo.webAbsoluteUrl + "/_api/search/query?querytext='*'&sourceid='xxxxx-xxxxxx-xxxx-xxx-xxxxxxx'&selectproperties='AccountName,WorkPhone'&refinementfilters='WorkPhone:(*-"+workPhone+")'"

It used to work. Now the format of phone changed to "+123 456332153" (attribute is string). I changed accordingly search query to:

url: _spPageContextInfo.webAbsoluteUrl + "/_api/search/query?querytext='*'&sourceid='xxxxx-xxxxxx-xxxx-xxx-xxxxxxx'&selectproperties='AccountName,WorkPhone'&refinementfilters='WorkPhone:(*"+workPhone+")'"

However it is not working. I tried many versions of search queries - with quotes, the whole number search: 'WorkPhone:("+123 456332153")' also doesnt work. Do you have any idea? Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.