示例#1
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="SearchV2Arg" /> class.</para>
        /// </summary>
        /// <param name="query">The string to search for. May match across multiple fields
        /// based on the request arguments. Query string may be rewritten to improve relevance
        /// of results.</param>
        /// <param name="options">Options for more targeted search results.</param>
        /// <param name="matchFieldOptions">Options for search results match fields.</param>
        /// <param name="includeHighlights">Deprecated and moved this option to
        /// SearchMatchFieldOptions.</param>
        public SearchV2Arg(string query,
                           SearchOptions options = null,
                           SearchMatchFieldOptions matchFieldOptions = null,
                           bool includeHighlights = false)
        {
            if (query == null)
            {
                throw new sys.ArgumentNullException("query");
            }

            this.Query             = query;
            this.Options           = options;
            this.MatchFieldOptions = matchFieldOptions;
            this.IncludeHighlights = includeHighlights;
        }
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="SearchV2Arg" /> class.</para>
        /// </summary>
        /// <param name="query">The string to search for. May match across multiple fields
        /// based on the request arguments. Query string may be rewritten to improve relevance
        /// of results.</param>
        /// <param name="options">Options for more targeted search results.</param>
        /// <param name="matchFieldOptions">Options for search results match fields.</param>
        /// <param name="includeHighlights">Deprecated and moved this option to
        /// SearchMatchFieldOptions.</param>
        public SearchV2Arg(string query,
                           SearchOptions options = null,
                           SearchMatchFieldOptions matchFieldOptions = null,
                           bool?includeHighlights = null)
        {
            if (query == null)
            {
                throw new sys.ArgumentNullException("query");
            }
            if (query.Length > 1000)
            {
                throw new sys.ArgumentOutOfRangeException("query", "Length should be at most 1000");
            }

            this.Query             = query;
            this.Options           = options;
            this.MatchFieldOptions = matchFieldOptions;
            this.IncludeHighlights = includeHighlights;
        }