internal MultiTermQueryRewrite(RewriteMultiTerm rewrite, int?size = null)
        {
            switch (rewrite)
            {
            case RewriteMultiTerm.ConstantScore:
            case RewriteMultiTerm.ScoringBoolean:
            case RewriteMultiTerm.ConstantScoreBoolean:
                _value = rewrite.ToEnumValue();
                break;

            case RewriteMultiTerm.TopTermsN:
            case RewriteMultiTerm.TopTermsBoostN:
            case RewriteMultiTerm.TopTermsBlendedFreqsN:
                if (size == null)
                {
                    throw new ArgumentException($"{nameof(size)} must be specified with {nameof(RewriteMultiTerm)}.{rewrite}");
                }

                var rewriteType = rewrite.ToEnumValue();
                rewriteType = rewriteType.Substring(0, rewriteType.Length - 1);
                _value      = rewriteType + size;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(rewrite));
            }

            Rewrite = rewrite;
            Size    = size;
        }
 public MultiMatchQueryDescriptor <T> Rewrite(RewriteMultiTerm rewrite)
 {
     this._Rewrite = rewrite;
     return(this);
 }
Exemple #3
0
 public FuzzyDateQueryDescriptor <T> Rewrite(RewriteMultiTerm rewrite)
 {
     ((IFuzzyQuery)this).Rewrite = rewrite;
     return(this);
 }
 public WildcardQueryDescriptor <T> Rewrite(RewriteMultiTerm rewrite)
 {
     ((IWildcardQuery)this).Rewrite = rewrite;
     return(this);
 }
Exemple #5
0
 public PrefixQueryDescriptor <T> Rewrite(RewriteMultiTerm rewrite)
 {
     ((IPrefixQuery)this).Rewrite = rewrite;
     return(this);
 }
Exemple #6
0
 public MatchQueryDescriptor <T> Rewrite(RewriteMultiTerm rewrite)
 {
     rewrite.ThrowIfNull("rewrite");
     this._Rewrite = rewrite;
     return(this);
 }
Exemple #7
0
 public QueryStringQueryDescriptor <T> Rewrite(RewriteMultiTerm rewriteMultiTerm)
 {
     ((IQueryStringQuery)this).Rewrite = rewriteMultiTerm;
     return(this);
 }
Exemple #8
0
 public QueryStringDescriptor <T> Rewrite(RewriteMultiTerm rewriteMultiTerm)
 {
     this._Rewrite = rewriteMultiTerm;
     return(this);
 }
Exemple #9
0
 public MultiMatchQueryDescriptor <T> FuzzyRewrite(RewriteMultiTerm rewrite) => Assign(a => a.FuzzyRewrite = rewrite);
Exemple #10
0
 public MatchQueryDescriptor <T> Rewrite(RewriteMultiTerm rewrite)
 {
     ((IMatchQuery)this).Rewrite = rewrite;
     return(this);
 }
Exemple #11
0
		public FuzzyNumericQueryDescriptor<T> Rewrite(RewriteMultiTerm rewrite)
		{
			((IFuzzyQuery)this).Rewrite = rewrite;
			return this;
		}