We have a azure web application where in there is one search box, when we enter text with double quotes like "App Service" it list records with "App service" however it also includes records having special characters in between the words like "App/Service". We want the search engine to return records that match the search phrase exactly (don't include records having special characters in between the search terms).
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- running headless chrome in an microsoft azure web
- Docker task in Azure devops won't accept "$(pw
In your case the
standard
analyzer breaks the term App/Service into two individual terms app and service at indexing time. That's why the phrase "App Service" matches the document with App/Service - both versions look the same to the search engine.If the term App/Service constitutes the entirety of the content of a field, you can index the content of that field as a single token using the
keyword
analyzer. Learn more here: Custom Analyzers in Azure Search.The
keyword
analyzer won't be a good option if the term App/Service occurs as a part of a sentence. In that case you can replace the/
character with another character that thestandard
tokenizer doesn't split on, for example:_
. Use themappping
character token filter for that:The following post will help you understand how lexical analyzers are applied at search and indexing time: How to practially use a keywordanalyzer in azure-search?
In this scenario, you want to index the entire content of a field as a single token. Take a look at Custom Analyzers in Azure Search, and the
keyword
analyzer in particular.