Implements a word fetcher for use with the in-memory index.
Наследование: IWordFetcher
Пример #1
0
        /// <summary>
        /// Performs a search in the index.
        /// </summary>
        /// <param name="parameters">The search parameters.</param>
        /// <returns>The results.</returns>
        /// <exception cref="ArgumentNullException">If <paramref name="parameters"/> is <c>null</c>.</exception>
        public SearchResultCollection Search(SearchParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            using (IWordFetcher fetcher = new InMemoryIndexWordFetcher(catalog))
            {
                if (parameters.DocumentTypeTags == null)
                {
                    return(Tools.SearchInternal(parameters.Query, null, false, parameters.Options, fetcher));
                }
                return(Tools.SearchInternal(parameters.Query, parameters.DocumentTypeTags, true, parameters.Options, fetcher));
            }
        }
Пример #2
0
        /// <summary>
        /// Performs a search in the index.
        /// </summary>
        /// <param name="parameters">The search parameters.</param>
        /// <returns>The results.</returns>
        /// <exception cref="ArgumentNullException">If <paramref name="parameters"/> is <c>null</c>.</exception>
        public SearchResultCollection Search(SearchParameters parameters)
        {
            if(parameters == null) throw new ArgumentNullException("parameters");

            using(IWordFetcher fetcher = new InMemoryIndexWordFetcher(catalog)) {
                if(parameters.DocumentTypeTags == null) {
                    return Tools.SearchInternal(parameters.Query, null, false, parameters.Options, fetcher);
                }
                else {
                    return Tools.SearchInternal(parameters.Query, parameters.DocumentTypeTags, true, parameters.Options, fetcher);
                }
            }
        }