locked
Search highlighting works differently on fields with special characters RRS feed

  • Question

  • For short texts like titles we would like to use text from @search.highlights if it is there.

    However highlight results are very different depending on characters in the title.

    For example if we search for "lorem", this is what highlights are returned for different titles:

    "I am an article ? lorem" -> "<em>lorem</em>"

    "I am an article lorem" -> "I am an article <em>lorem</em>"

    Why is it so different depending on one character in the middle? Same happens with "." or "!".

    Is it possible to get full field value with all highlighs on it? 

    Monday, August 5, 2019 1:41 PM

All replies

  • Those likely fall under the special character restrictions and will need to be escaped. You could also look into a custom analyzer as well if you have many use cases that would fall into the special character or restricted character areas.
    Tuesday, August 6, 2019 8:54 AM
  • Thanks, but this is not related to escaping as we are not searching by special characters.

    We expect highlight results to be with special characters if field have special characters. 

    Tuesday, August 6, 2019 9:39 AM
  • Thanks for the update. We would like to work closer with you on this matter. Can you please reach out to us at azcommunity@microsoft.com with your subscription ID and the URL of this post? We look forward to your reply.

    Tuesday, August 6, 2019 11:06 PM