matched highlight excerpt

Vote:
 

Hi,

I have a problem when I used the Unified Search, when I search for some query strings, the Excerpt for a searchData have duplicated text.  For example, when I search for string "a" it could show "this is the article.....is the <em>a</em>rticle". How to solve it. Thank you.

#221239
Apr 15, 2020 14:48
Vote:
 

Hi Sun,  Please try with disabling HTML encoding?

var hitSpec = new HitSpecification 
{ 
HighlightExcerpt = true, 
EncodeTitle = false, 
EncodeExcerpt = false 
};
#221251
Apr 15, 2020 18:16
Sun Zeyang - Apr 15, 2020 21:24
Oh , you saved me the day!!! It worked perfectly!!! I had been working around with many solutions, however this one "EncodeExcerpt = false" worked finally! However I have no idea the background history why it would have duplicated text for the Excerpt! Anyway, it worked!
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.