예제 #1
0
        /// <summary>
        /// Shorthand for a match_all query without having to specify .Query(q=>q.MatchAll())
        /// </summary>
        public SearchDescriptor <T> MatchAll()
        {
            var q = new QueryDescriptor <T>();

            q.MatchAll();
            this._Query = q;
            return(this);
        }
예제 #2
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);
        }