Пример #1
0
        /// <summary>
        /// Shortcut to .Query(q=>q.QueryString(qs=>qs.Query("string"))
        /// Does a match_all if the userInput string is null or empty;
        /// </summary>
        public SearchDescriptor <T> QueryString(string userInput)
        {
            var q = new QueryDescriptor <T>();

            if (userInput.IsNullOrEmpty())
            {
                q.MatchAll();
            }
            else
            {
                q.QueryString(qs => qs.Query(userInput));
            }
            this._Query = q;
            return(this);
        }
        /// <summary>
        /// Shortcut to .Query(q=>q.QueryString(qs=>qs.Query("string"))
        /// Does a match_all if the userInput string is null or empty;
        /// </summary>
        public PercolateCountDescriptor <T> QueryString(string userInput)
        {
            var            q = new QueryDescriptor <T>();
            QueryContainer bq;

            if (userInput.IsNullOrEmpty())
            {
                bq = q.MatchAll();
            }
            else
            {
                bq = q.QueryString(qs => qs.Query(userInput));
            }
            Self.Query = bq;
            return(this);
        }