Ejemplo n.º 1
0
        IResourceHighlighter IFaqHighlighterFactory.Create(ResourceHighlighterKind kind, FaqSearchCriteria criteria, HighlighterConfiguration configuration)
        {
            if (kind == ResourceHighlighterKind.Null || criteria == null)
            {
                return(new NullResourceHighlighter());
            }

            var searchQuery  = criteria.GetSearchQuery(null);
            var contentQuery = new QueryBuilder(_defaultQueryAnalyzer).GetContentQuery(searchQuery);

            return(new FaqHighlighter(contentQuery, _defaultContentAnalyzer, configuration));
        }
Ejemplo n.º 2
0
        FaqSearchExecution IExecuteFaqSearchCommand.Search(FaqSearchCriteria criteria, Range range)
        {
            ResourceSearchResults results;
            var service = _serviceManager.Create();

            try
            {
                results = service.Search(criteria.GetSearchQuery(range), true);
            }
            catch (Exception)
            {
                _serviceManager.Abort(service);
                throw;
            }
            _serviceManager.Close(service);

            return(new FaqSearchExecution
            {
                Criteria = criteria,
                Results = results
            });
        }