@Allen Han You'll need to replace the single quote with two single quotes.
filterString.Append(($"Provider eq '{provider.ProviderName.replace("'","''")}'"));
Let us know if you have further questions or concerns.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have group names contain single quote. I was trying to use double quotes to escape it, but the security search did not work. Seemed the filter was not working at all. Anyone saw similar case? Any suggestion to check or address it?
Thanks
@Allen Han You'll need to replace the single quote with two single quotes.
filterString.Append(($"Provider eq '{provider.ProviderName.replace("'","''")}'"));
Let us know if you have further questions or concerns.
Using two single quotes worked for the quote's case. Thanks!
After further test, it turned out the issue was actually coming from the space within the group name, not the single quote. Looks like ACS tokenized the group name and treated space as delimiter.
Is there a way to specify a special analyzer for the group_ids field so that the whole string should be treated as non-parsing entity?
Thanks
After following this link: https://learn.microsoft.com/en-us/azure/search/search-analyzers, I was able to specify analyzer to the group_ids field such as:
{ "name": "group_ids", "type": "Collection(Edm.String)", "filterable": true, "retrievable": true, "analyzer": "keyword" },
But the search still not working. Even when I tested with https://learn.microsoft.com/en-us/rest/api/searchservice/test-analyzer, it showed the whole string was not altered at all.
Any suggestions to check it further?