Exemplo n.º 1
0
        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);
 }
Exemplo n.º 3
0
 public FuzzyDateQueryDescriptor <T> Rewrite(RewriteMultiTerm rewrite)
 {
     ((IFuzzyQuery)this).Rewrite = rewrite;
     return(this);
 }
Exemplo n.º 4
0
 public WildcardQueryDescriptor <T> Rewrite(RewriteMultiTerm rewrite)
 {
     ((IWildcardQuery)this).Rewrite = rewrite;
     return(this);
 }
Exemplo n.º 5
0
 public PrefixQueryDescriptor <T> Rewrite(RewriteMultiTerm rewrite)
 {
     ((IPrefixQuery)this).Rewrite = rewrite;
     return(this);
 }
Exemplo n.º 6
0
 public MatchQueryDescriptor <T> Rewrite(RewriteMultiTerm rewrite)
 {
     rewrite.ThrowIfNull("rewrite");
     this._Rewrite = rewrite;
     return(this);
 }
Exemplo n.º 7
0
 public QueryStringQueryDescriptor <T> Rewrite(RewriteMultiTerm rewriteMultiTerm)
 {
     ((IQueryStringQuery)this).Rewrite = rewriteMultiTerm;
     return(this);
 }
Exemplo n.º 8
0
 public QueryStringDescriptor <T> Rewrite(RewriteMultiTerm rewriteMultiTerm)
 {
     this._Rewrite = rewriteMultiTerm;
     return(this);
 }
Exemplo n.º 9
0
 public MultiMatchQueryDescriptor <T> FuzzyRewrite(RewriteMultiTerm rewrite) => Assign(a => a.FuzzyRewrite = rewrite);
Exemplo n.º 10
0
 public MatchQueryDescriptor <T> Rewrite(RewriteMultiTerm rewrite)
 {
     ((IMatchQuery)this).Rewrite = rewrite;
     return(this);
 }
Exemplo n.º 11
0
		public FuzzyNumericQueryDescriptor<T> Rewrite(RewriteMultiTerm rewrite)
		{
			((IFuzzyQuery)this).Rewrite = rewrite;
			return this;
		}