0
votes

I have a following code,

filter="search.ismatch('Paris\-l''Hopital*', 'DestinationAddress/City', 'full', 'all')" 

This filter should give me the record that has City with the name Paris-l'Hopital. Please note i am escaping the single quote in the middle of the search term with another single quote. Hiphen is escaped using backslash. Moreover the city field uses Microsoft Analyzer.

While i can see the record exists in the search index i cannot understand why this filter doesnt return the record i am expecting. Any input will be highly appreciated.

References https://docs.microsoft.com/en-us/azure/search/search-query-odata-full-text-search-functions https://docs.microsoft.com/en-us/azure/search/query-simple-syntax

Thank you

2

2 Answers

2
votes

By default it considers hyphen as a stopword. You need to change the default analyzer to not break into different words when it finds the '-'.

0
votes

Normally, I would suggest considering a language-specific analyzer if you have content in a specific language. For addresses, this is tricky since you probably have to support all types of addresses. Have you tried using one of the French analyzers? It would probably do better at tokenizing typical French content.