private static string MoveTextFromQueryString(IAnalyzeRequest d)
		{
			IRequest<AnalyzeRequestParameters> request = d;
			var text = request.RequestParameters.GetQueryStringValue<string[]>("text");
			request.RequestParameters.RemoveQueryString("text");
			return string.Join(",", text);
		}
        private static string MoveTextFromQueryString(IAnalyzeRequest d)
        {
            IRequest <AnalyzeRequestParameters> request = d;
            var text = request.RequestParameters.GetQueryStringValue <string[]>("text");

            request.RequestParameters.RemoveQueryString("text");
            return(string.Join(",", text));
        }
 /// <inheritdoc />
 public Task <IAnalyzeResponse> AnalyzeAsync(IAnalyzeRequest analyzeRequest)
 {
     return(this.DispatchAsync <IAnalyzeRequest, AnalyzeRequestParameters, AnalyzeResponse, IAnalyzeResponse>(
                analyzeRequest,
                (p, d) =>
     {
         IRequest <AnalyzeRequestParameters> request = d;
         var text = request.RequestParameters.GetQueryStringValue <string>("text");
         request.RequestParameters.RemoveQueryString("text");
         return this.RawDispatch.IndicesAnalyzeDispatchAsync <AnalyzeResponse>(p, text);
     }
                ));
 }
		/// <inheritdoc />
		public Task<IAnalyzeResponse> AnalyzeAsync(IAnalyzeRequest analyzeRequest)
		{
			return this.DispatchAsync<IAnalyzeRequest, AnalyzeRequestParameters, AnalyzeResponse, IAnalyzeResponse>(
				analyzeRequest,
				(p, d) =>
				{
					IRequest<AnalyzeRequestParameters> request = d;
					var text = request.RequestParameters.GetQueryStringValue<string>("text");
					request.RequestParameters.RemoveQueryString("text");
					return this.RawDispatch.IndicesAnalyzeDispatchAsync<AnalyzeResponse>(p, text);
				}
			);
		}
Esempio n. 5
0
 /// <inheritdoc />
 public IAnalyzeResponse Analyze(IAnalyzeRequest analyzeRequest)
 {
     return(this.Dispatch <IAnalyzeRequest, AnalyzeRequestParameters, AnalyzeResponse>(
                analyzeRequest,
                (p, d) =>
     {
         IRequest <AnalyzeRequestParameters> request = d;
         var text = request.RequestParameters.GetQueryStringValue <string>("text");
         request.RequestParameters.RemoveQueryString("text");
         text.ThrowIfNullOrEmpty("No text specified to analyze");
         return this.RawDispatch.IndicesAnalyzeDispatch <AnalyzeResponse>(p, text);
     }
                ));
 }
		/// <inheritdoc />
		public IAnalyzeResponse Analyze(IAnalyzeRequest analyzeRequest)
		{
			return this.Dispatch<IAnalyzeRequest, AnalyzeRequestParameters, AnalyzeResponse>(
				analyzeRequest,
				(p, d) =>
				{
					IRequest<AnalyzeRequestParameters> request = d;
					var text = request.RequestParameters.GetQueryStringValue<string>("text");
					request.RequestParameters.RemoveQueryString("text");
					text.ThrowIfNullOrEmpty("No text specified to analyze");
					return this.RawDispatch.IndicesAnalyzeDispatch<AnalyzeResponse>(p, text);
				}
			);
		}
 /// <inheritdoc/>
 public Task <IAnalyzeResponse> AnalyzeAsync(IAnalyzeRequest request, CancellationToken cancellationToken = default(CancellationToken)) =>
 this.Dispatcher.DispatchAsync <IAnalyzeRequest, AnalyzeRequestParameters, AnalyzeResponse, IAnalyzeResponse>(
     request,
     cancellationToken,
     (p, d, c) => this.LowLevelDispatch.IndicesAnalyzeDispatchAsync <AnalyzeResponse>(p, MoveTextFromQueryString(request), c)
     );
Esempio n. 8
0
 /// <inheritdoc/>
 public Task <IAnalyzeResponse> AnalyzeAsync(IAnalyzeRequest request) =>
 this.Dispatcher.DispatchAsync <IAnalyzeRequest, AnalyzeRequestParameters, AnalyzeResponse, IAnalyzeResponse>(
     request,
     (p, d) => this.LowLevelDispatch.IndicesAnalyzeDispatchAsync <AnalyzeResponse>(p, MoveTextFromQueryString(request))
     );
 /// <inheritdoc/>
 public IAnalyzeResponse Analyze(IAnalyzeRequest request) =>
 this.Dispatcher.Dispatch <IAnalyzeRequest, AnalyzeRequestParameters, AnalyzeResponse>(
     request,
     (p, d) => this.LowLevelDispatch.IndicesAnalyzeDispatch <AnalyzeResponse>(p, MoveTextFromQueryString(request))
     );
 /// <inheritdoc/>
 public Task <IAnalyzeResponse> AnalyzeAsync(IAnalyzeRequest request, CancellationToken cancellationToken = default(CancellationToken)) =>
 this.Dispatcher.DispatchAsync <IAnalyzeRequest, AnalyzeRequestParameters, AnalyzeResponse, IAnalyzeResponse>(
     request,
     cancellationToken,
     this.LowLevelDispatch.IndicesAnalyzeDispatchAsync <AnalyzeResponse>
     );
Esempio n. 11
0
 public static void Update(ElasticsearchPathInfo <AnalyzeRequestParameters> pathInfo, IAnalyzeRequest request)
 {
     pathInfo.HttpMethod = PathInfoHttpMethod.POST;
 }
 /// <inheritdoc />
 public Task <AnalyzeResponse> AnalyzeAsync(IAnalyzeRequest request, CancellationToken ct = default) =>
 DoRequestAsync <IAnalyzeRequest, AnalyzeResponse>(request, request.RequestParameters, ct);
 /// <inheritdoc/>
 public IAnalyzeResponse Analyze(IAnalyzeRequest request) =>
 this.Dispatcher.Dispatch <IAnalyzeRequest, AnalyzeRequestParameters, AnalyzeResponse>(
     request,
     this.LowLevelDispatch.IndicesAnalyzeDispatch <AnalyzeResponse>
     );
		/// <inheritdoc/>
		public Task<IAnalyzeResponse> AnalyzeAsync(IAnalyzeRequest request) => 
			this.Dispatcher.DispatchAsync<IAnalyzeRequest, AnalyzeRequestParameters, AnalyzeResponse, IAnalyzeResponse>(
				request,
				(p, d) => this.LowLevelDispatch.IndicesAnalyzeDispatchAsync<AnalyzeResponse>(p, MoveTextFromQueryString(request))
			);
Esempio n. 15
0
 public static AnalyzeResponse Analyze(this IElasticClient client, IAnalyzeRequest request)
 => client.Indices.Analyze(request);
Esempio n. 16
0
 public static Task <AnalyzeResponse> AnalyzeAsync(this IElasticClient client, IAnalyzeRequest request, CancellationToken ct = default)
 => client.Indices.AnalyzeAsync(request, ct);
		/// <inheritdoc/>
		public IAnalyzeResponse Analyze(IAnalyzeRequest request) =>
			this.Dispatcher.Dispatch<IAnalyzeRequest, AnalyzeRequestParameters, AnalyzeResponse>(
				request,
				this.LowLevelDispatch.IndicesAnalyzeDispatch<AnalyzeResponse>
			);
		/// <inheritdoc/>
		public Task<IAnalyzeResponse> AnalyzeAsync(IAnalyzeRequest request, CancellationToken cancellationToken = default(CancellationToken)) =>
			this.Dispatcher.DispatchAsync<IAnalyzeRequest, AnalyzeRequestParameters, AnalyzeResponse, IAnalyzeResponse>(
				request,
				cancellationToken,
				this.LowLevelDispatch.IndicesAnalyzeDispatchAsync<AnalyzeResponse>
			);
 /// <inheritdoc />
 public AnalyzeResponse Analyze(IAnalyzeRequest request) =>
 DoRequest <IAnalyzeRequest, AnalyzeResponse>(request, request.RequestParameters);
		/// <inheritdoc/>
		public IAnalyzeResponse Analyze(IAnalyzeRequest request) => 
			this.Dispatcher.Dispatch<IAnalyzeRequest, AnalyzeRequestParameters, AnalyzeResponse>(
				request,
				(p, d) => this.LowLevelDispatch.IndicesAnalyzeDispatch<AnalyzeResponse>(p, MoveTextFromQueryString(request))
			);