public MinimumShouldMatch(MinimumShouldMatchBase all)
        {
            if (all == null)
                throw new ArgumentNullException("all", "MinimumShouldMatch all value must be populated in this constructor.");

            All = all;
        }
        public MinimumShouldMatch(MinimumShouldMatchBase lowFrequency, MinimumShouldMatchBase highFrequency)
        {
            if (lowFrequency == null && highFrequency == null)
                throw new ArgumentNullException("frequency", "MinimumShouldMatch high or low frequency value must be populated in this constructor.");

            LowFrequency = lowFrequency;
            HighFrequency = highFrequency;
        }
Example #3
0
        /// <summary>
        /// Create a terms query.
        /// </summary>
        /// <param name="field">The field to search in.</param>
        /// <param name="values">The values to find.</param>
        public TermsQuery(string field, IEnumerable<object> values)
        {
            if (string.IsNullOrWhiteSpace(field))
                throw new ArgumentNullException("field", "TermsQuery requires a field.");
            if (values == null || values.All(x => x == null))
                throw new ArgumentNullException("values", "TermsQuery requires at least one value.");

            Field = field;
            Values = values.Where(x => x != null);
            MinimumShouldMatch = TermsSerializer._MINIMUM_SHOULD_MATCH_DEFAULT;
        }
Example #4
0
 internal BoolFilter()
 {
     Cache = BoolSerializer._CACHE_DEFAULT;
     MinimumShouldMatch = BoolSerializer._MINIMUM_SHOULD_MATCH_DEFAULT;
     DisableCoords = BoolSerializer._DISABLE_COORDS_DEFAULT;
 }