Contains search parameters.
		/// <summary>
		/// Performs a search in the index.
		/// </summary>
		/// <param name="parameters">The search parameters.</param>
		/// <returns>The results.</returns>
		public SearchResultCollection Search(SearchParameters parameters) {
			if(parameters == null) throw new ArgumentNullException("parameters");

			using(IWordFetcher fetcher = connector.GetWordFetcher()) {
				if(parameters.DocumentTypeTags == null) {
					return ScrewTurn.Wiki.SearchEngine.Tools.SearchInternal(parameters.Query, null, false, parameters.Options, fetcher);
				}
				else {
					return ScrewTurn.Wiki.SearchEngine.Tools.SearchInternal(parameters.Query, parameters.DocumentTypeTags, true, parameters.Options, fetcher);
				}
			}
		}
        /// <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 PerformSearch(SearchParameters parameters)
        {
            if(parameters == null) throw new ArgumentNullException("parameters");

            lock(this) {
                return index.Search(parameters);
            }
        }
Example #3
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);
                }
            }
        }