/// <summary>
        /// Filters documents that have fields that match any of the provided terms (not analyzed).
        /// </summary>
        public FilterContainer Terms(string field, IEnumerable <string> terms, TermsExecution?Execution = null)
        {
            ITermsFilter filter = new TermsFilterDescriptor();

            filter.Field = field;
            filter.Terms = terms ?? Enumerable.Empty <string>();
            return(this.New(filter, f => f.Terms = filter));
        }
        /// <summary>
        /// Filters documents that have fields that match any of the provided terms (not analyzed).
        /// </summary>
        public FilterContainer Terms(Expression <Func <T, object> > fieldDescriptor, IEnumerable <string> terms, TermsExecution?Execution = null)
        {
            ITermsFilter filter = new TermsFilterDescriptor();

            filter.Field = fieldDescriptor;
            filter.Terms = terms;
            return(this.New(filter, f => f.Terms = filter));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Filters documents that have fields that match any of the provided terms (not analyzed).
        /// </summary>
        public FilterContainer Terms <K>(Expression <Func <T, IEnumerable <K> > > fieldDescriptor, IEnumerable <K> terms, TermsExecution?Execution = null)
        {
            ITermsFilter filter = new TermsFilterDescriptor();

            filter.Field     = fieldDescriptor;
            filter.Terms     = (terms != null) ? terms.Cast <object>() : null;
            filter.Execution = Execution;
            return(this.New(filter, f => f.Terms = filter));
        }