Example #1
0
        /// <summary>
        /// Filters documents that have fields containing terms with a specified prefix
        /// (not analyzed). Similar to phrase query, except that it acts as a filter.
        /// </summary>
        public FilterContainer Prefix(string field, string prefix)
        {
            IPrefixFilter filter = new PrefixFilterDescriptor();

            filter.Field  = field;
            filter.Prefix = prefix;
            return(this.New(filter, f => f.Prefix = filter));
        }
Example #2
0
        /// <summary>
        /// Filters documents that have fields containing terms with a specified prefix
        /// (not analyzed). Similar to phrase query, except that it acts as a filter.
        /// </summary>
        public FilterContainer Prefix(Expression <Func <T, object> > fieldDescriptor, string prefix)
        {
            IPrefixFilter filter = new PrefixFilterDescriptor();

            filter.Field  = fieldDescriptor;
            filter.Prefix = prefix;
            return(this.New(filter, f => f.Prefix = filter));
        }