/// <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)); }
/// <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)); }