Пример #1
0
        private static Expression <Func <ISearchContent, string> > HighlightExpressionGetter(HitSpecification spec)
        {
            var highlightSpec = new HighlightSpec
            {
                FragmentSize      = spec.ExcerptLength,
                NumberOfFragments = 1,
                PreTag            = spec.PreTagForAllHighlights,
                PostTag           = spec.PostTagForAllHighlights
            };

            return(doc => !string.IsNullOrWhiteSpace(doc.SearchAttachmentText) ?
                   doc.SearchAttachmentText.AsHighlighted(highlightSpec) : doc.SearchAttachment.AsHighlighted(highlightSpec));
        }
 public static string AsHighlighted(this XhtmlString xhtmlString, HighlightSpec highlightSpec)
 {
     throw new ClientException("The AsHighlighted method should only be used in projection expressions");
 }