Exemplo n.º 1
0
        internal Task<ConnectionStatus> BulkDispatchAsync(ElasticsearchPathInfo<BulkQueryString> pathInfo , object body)
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.POST:
                    //POST /{index}/{type}/_bulk
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
                        return this.Raw.BulkPostAsync(pathInfo.Index,pathInfo.Type,body,u => pathInfo.QueryString);
                    //POST /{index}/_bulk
                    if (!pathInfo.Index.IsNullOrEmpty() && body != null)
                        return this.Raw.BulkPostAsync(pathInfo.Index,body,u => pathInfo.QueryString);
                    //POST /_bulk
                    if (body != null)
                        return this.Raw.BulkPostAsync(body,u => pathInfo.QueryString);
                    break;

                case PathInfoHttpMethod.PUT:
                    //PUT /{index}/{type}/_bulk
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
                        return this.Raw.BulkPutAsync(pathInfo.Index,pathInfo.Type,body,u => pathInfo.QueryString);
                    //PUT /{index}/_bulk
                    if (!pathInfo.Index.IsNullOrEmpty() && body != null)
                        return this.Raw.BulkPutAsync(pathInfo.Index,body,u => pathInfo.QueryString);
                    //PUT /_bulk
                    if (body != null)
                        return this.Raw.BulkPutAsync(body,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.Bulk() into any of the following paths: \r\n - /_bulk\r\n - /{index}/_bulk\r\n - /{index}/{type}/_bulk");
        }
Exemplo n.º 2
0
        internal ConnectionStatus ClearScrollDispatch(ElasticsearchPathInfo<ClearScrollQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.DELETE:
                    //DELETE /_search/scroll/{scroll_id}
                    if (!pathInfo.ScrollId.IsNullOrEmpty())
                        return this.Raw.ClearScrollDelete(pathInfo.ScrollId,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.ClearScroll() into any of the following paths: \r\n - /_search/scroll/{scroll_id}");
        }
Exemplo n.º 3
0
        internal Task<ConnectionStatus> ClusterStateDispatchAsync(ElasticsearchPathInfo<ClusterStateQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.GET:
                    //GET /_cluster/state
                    return this.Raw.ClusterStateGetAsync(u => pathInfo.QueryString);

            }
            throw new DispatchException("Could not dispatch IElasticClient.ClusterState() into any of the following paths: \r\n - /_cluster/state");
        }
Exemplo n.º 4
0
        internal Task<ConnectionStatus> ClusterNodeShutdownDispatchAsync(ElasticsearchPathInfo<ClusterNodeShutdownQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.POST:
                    //POST /_cluster/nodes/{node_id}/_shutdown
                    if (!pathInfo.NodeId.IsNullOrEmpty())
                        return this.Raw.ClusterNodeShutdownPostAsync(pathInfo.NodeId,u => pathInfo.QueryString);
                    //POST /_shutdown
                    return this.Raw.ClusterNodeShutdownPostAsync(u => pathInfo.QueryString);

            }
            throw new DispatchException("Could not dispatch IElasticClient.ClusterNodeShutdown() into any of the following paths: \r\n - /_shutdown\r\n - /_cluster/nodes/_shutdown\r\n - /_cluster/nodes/{node_id}/_shutdown");
        }
Exemplo n.º 5
0
        internal ConnectionStatus ClusterPutSettingsDispatch(ElasticsearchPathInfo<ClusterPutSettingsQueryString> pathInfo , object body)
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.PUT:
                    //PUT /_cluster/settings
                    if (body != null)
                        return this.Raw.ClusterPutSettings(body,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.ClusterPutSettings() into any of the following paths: \r\n - /_cluster/settings");
        }
 public static void Update(ElasticsearchPathInfo <DeleteSnapshotRequestParameters> pathInfo, IDeleteSnapshotRequest request)
 {
     pathInfo.HttpMethod = PathInfoHttpMethod.DELETE;
 }
Exemplo n.º 7
0
        internal Task<ConnectionStatus> ScrollDispatchAsync(ElasticsearchPathInfo<ScrollQueryString> pathInfo , object body)
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.GET:
                    //GET /_search/scroll/{scroll_id}
                    if (!pathInfo.ScrollId.IsNullOrEmpty())
                        return this.Raw.ScrollGetAsync(pathInfo.ScrollId,u => pathInfo.QueryString);
                    //GET /_search/scroll
                    return this.Raw.ScrollGetAsync(u => pathInfo.QueryString);

                case PathInfoHttpMethod.POST:
                    //POST /_search/scroll/{scroll_id}
                    if (!pathInfo.ScrollId.IsNullOrEmpty() && body != null)
                        return this.Raw.ScrollPostAsync(pathInfo.ScrollId,body,u => pathInfo.QueryString);
                    //POST /_search/scroll
                    if (body != null)
                        return this.Raw.ScrollPostAsync(body,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.Scroll() into any of the following paths: \r\n - /_search/scroll\r\n - /_search/scroll/{scroll_id}");
        }
Exemplo n.º 8
0
        internal Task<ConnectionStatus> GetSourceDispatchAsync(ElasticsearchPathInfo<GetSourceQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.GET:
                    //GET /{index}/{type}/{id}/_source
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
                        return this.Raw.GetSourceAsync(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.GetSource() into any of the following paths: \r\n - /{index}/{type}/{id}/_source");
        }
Exemplo n.º 9
0
        internal Task<ConnectionStatus> IndicesCloseDispatchAsync(ElasticsearchPathInfo<CloseIndexQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.POST:
                    //POST /{index}/_close
                    if (!pathInfo.Index.IsNullOrEmpty())
                        return this.Raw.IndicesClosePostAsync(pathInfo.Index,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.IndicesClose() into any of the following paths: \r\n - /{index}/_close");
        }
Exemplo n.º 10
0
 protected abstract void UpdatePathInfo(IConnectionSettingsValues settings, ElasticsearchPathInfo <TParameters> pathInfo);
 public static void Update(ElasticsearchPathInfo <DocumentExistsRequestParameters> pathInfo, IDocumentExistsRequest request)
 {
     pathInfo.HttpMethod = PathInfoHttpMethod.HEAD;
 }
Exemplo n.º 12
0
 protected virtual void SetRouteParameters(
     IConnectionSettingsValues settings,
     ElasticsearchPathInfo <TParameters> pathInfo)
 {
 }
Exemplo n.º 13
0
 protected virtual void ValidatePathInfo(ElasticsearchPathInfo <TParameters> pathInfo)
 {
 }
Exemplo n.º 14
0
 public static void Update(ElasticsearchPathInfo <RefreshRequestParameters> pathInfo, IRefreshRequest request)
 {
     pathInfo.HttpMethod = PathInfoHttpMethod.POST;
 }
Exemplo n.º 15
0
 protected override void UpdatePathInfo(IConnectionSettingsValues settings, ElasticsearchPathInfo <MultiSearchRequestParameters> pathInfo)
 {
     pathInfo.HttpMethod = PathInfoHttpMethod.POST;
 }
 protected override void UpdatePathInfo(IConnectionSettingsValues settings, ElasticsearchPathInfo <DeleteSnapshotRequestParameters> pathInfo)
 {
     DeleteSnapshotPathInfo.Update(pathInfo, this);
 }
Exemplo n.º 17
0
        internal Task<ConnectionStatus> DeleteByQueryDispatchAsync(ElasticsearchPathInfo<DeleteByQueryQueryString> pathInfo , object body)
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.DELETE:
                    //DELETE /{index}/{type}/_query
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
                        return this.Raw.DeleteByQueryAsync(pathInfo.Index,pathInfo.Type,body,u => pathInfo.QueryString);
                    //DELETE /{index}/_query
                    if (!pathInfo.Index.IsNullOrEmpty() && body != null)
                        return this.Raw.DeleteByQueryAsync(pathInfo.Index,body,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.DeleteByQuery() into any of the following paths: \r\n - /{index}/_query\r\n - /{index}/{type}/_query");
        }
 protected override void UpdatePathInfo(IConnectionSettingsValues settings, ElasticsearchPathInfo <DocumentExistsRequestParameters> pathInfo)
 {
     DocumentExistsPathInfo.Update(pathInfo, this);
 }
Exemplo n.º 19
0
        internal Task<ConnectionStatus> ExistsDispatchAsync(ElasticsearchPathInfo<ExistsQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.HEAD:
                    //HEAD /{index}/{type}/{id}
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
                        return this.Raw.ExistsHeadAsync(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.Exists() into any of the following paths: \r\n - /{index}/{type}/{id}");
        }
Exemplo n.º 20
0
        internal ConnectionStatus IndicesDeleteMappingDispatch(ElasticsearchPathInfo<DeleteMappingQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.DELETE:
                    //DELETE /{index}/{type}/_mapping
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
                        return this.Raw.IndicesDeleteMapping(pathInfo.Index,pathInfo.Type,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.IndicesDeleteMapping() into any of the following paths: \r\n - /{index}/{type}/_mapping\r\n - /{index}/{type}");
        }
Exemplo n.º 21
0
        internal Task<ConnectionStatus> IndicesAnalyzeDispatchAsync(ElasticsearchPathInfo<AnalyzeQueryString> pathInfo , object body)
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.GET:
                    //GET /{index}/_analyze
                    if (!pathInfo.Index.IsNullOrEmpty())
                        return this.Raw.IndicesAnalyzeGetAsync(pathInfo.Index,u => pathInfo.QueryString);
                    //GET /_analyze
                    return this.Raw.IndicesAnalyzeGetAsync(u => pathInfo.QueryString);

                case PathInfoHttpMethod.POST:
                    //POST /{index}/_analyze
                    if (!pathInfo.Index.IsNullOrEmpty() && body != null)
                        return this.Raw.IndicesAnalyzePostAsync(pathInfo.Index,body,u => pathInfo.QueryString);
                    //POST /_analyze
                    if (body != null)
                        return this.Raw.IndicesAnalyzePostAsync(body,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.IndicesAnalyze() into any of the following paths: \r\n - /_analyze\r\n - /{index}/_analyze");
        }
 protected override void SetRouteParameters(IConnectionSettingsValues settings, ElasticsearchPathInfo <TParameters> pathInfo)
 {
     FixedIndexTypePathRouteParameters.SetRouteParameters(this, settings, pathInfo);
 }
Exemplo n.º 23
0
 public static void Update <T>(ElasticsearchPathInfo <PercolateRequestParameters> pathInfo, IPercolateRequest <T> request)
     where T : class
 {
     pathInfo.Id         = request.Id;
     pathInfo.HttpMethod = PathInfoHttpMethod.POST;
 }
 protected override void SetRouteParameters(IConnectionSettingsValues settings, ElasticsearchPathInfo <TParameters> pathInfo)
 {
     RepositorySnapshotPathRouteParameters.SetRouteParameters(this, settings, pathInfo);
 }
Exemplo n.º 25
0
        internal Task<ConnectionStatus> IndicesDeleteWarmerDispatchAsync(ElasticsearchPathInfo<DeleteWarmerQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.DELETE:
                    //DELETE /{index}/{type}/_warmer/{name}
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
                        return this.Raw.IndicesDeleteWarmerAsync(pathInfo.Index,pathInfo.Type,pathInfo.Name,u => pathInfo.QueryString);
                    //DELETE /{index}/_warmer/{name}
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
                        return this.Raw.IndicesDeleteWarmerAsync(pathInfo.Index,pathInfo.Name,u => pathInfo.QueryString);
                    //DELETE /{index}/_warmer
                    if (!pathInfo.Index.IsNullOrEmpty())
                        return this.Raw.IndicesDeleteWarmerAsync(pathInfo.Index,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.IndicesDeleteWarmer() into any of the following paths: \r\n - /{index}/_warmer\r\n - /{index}/_warmer/{name}\r\n - /{index}/{type}/_warmer/{name}");
        }
Exemplo n.º 26
0
 protected override void UpdatePathInfo(IConnectionSettingsValues settings, ElasticsearchPathInfo <IndicesStatsRequestParameters> pathInfo)
 {
     IndicesStatsPathInfo.Update(settings, pathInfo, this);
 }
Exemplo n.º 27
0
        internal Task<ConnectionStatus> PingDispatchAsync(ElasticsearchPathInfo<PingQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.HEAD:
                    //HEAD /
                    return this.Raw.PingHeadAsync(u => pathInfo.QueryString);

            }
            throw new DispatchException("Could not dispatch IElasticClient.Ping() into any of the following paths: \r\n - /");
        }
Exemplo n.º 28
0
 public static void Update(IConnectionSettingsValues settings, ElasticsearchPathInfo <TermvectorRequestParameters> pathInfo)
 {
     pathInfo.HttpMethod = PathInfoHttpMethod.GET;
 }
Exemplo n.º 29
0
        internal ConnectionStatus SuggestDispatch(ElasticsearchPathInfo<SuggestQueryString> pathInfo , object body)
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.POST:
                    //POST /{index}/_suggest
                    if (!pathInfo.Index.IsNullOrEmpty() && body != null)
                        return this.Raw.SuggestPost(pathInfo.Index,body,u => pathInfo.QueryString);
                    //POST /_suggest
                    if (body != null)
                        return this.Raw.SuggestPost(body,u => pathInfo.QueryString);
                    break;

                case PathInfoHttpMethod.GET:
                    //GET /{index}/_suggest
                    if (!pathInfo.Index.IsNullOrEmpty())
                        return this.Raw.SuggestGet(pathInfo.Index,u => pathInfo.QueryString);
                    //GET /_suggest
                    return this.Raw.SuggestGet(u => pathInfo.QueryString);

            }
            throw new DispatchException("Could not dispatch IElasticClient.Suggest() into any of the following paths: \r\n - /_suggest\r\n - /{index}/_suggest");
        }
Exemplo n.º 30
0
 protected override void UpdatePathInfo(IConnectionSettingsValues settings, ElasticsearchPathInfo <TermvectorRequestParameters> pathInfo)
 {
     TermvectorPathInfo.Update(settings, pathInfo);
 }
Exemplo n.º 31
0
        internal Task<ConnectionStatus> ClusterNodeStatsDispatchAsync(ElasticsearchPathInfo<ClusterNodeStatsQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.GET:
                    //GET /_cluster/nodes/{node_id}/stats
                    if (!pathInfo.NodeId.IsNullOrEmpty())
                        return this.Raw.ClusterNodeStatsGetAsync(pathInfo.NodeId,u => pathInfo.QueryString);
                    //GET /_cluster/nodes/stats
                    return this.Raw.ClusterNodeStatsGetAsync(u => pathInfo.QueryString);

            }
            throw new DispatchException("Could not dispatch IElasticClient.ClusterNodeStats() into any of the following paths: \r\n - /_cluster/nodes/stats\r\n - /_cluster/nodes/{node_id}/stats\r\n - /_nodes/stats\r\n - /_nodes/{node_id}/stats");
        }
Exemplo n.º 32
0
 protected override void UpdatePathInfo(IConnectionSettingsValues settings, ElasticsearchPathInfo <GetMappingRequestParameters> pathInfo)
 {
     GetMappingPathInfo.Update(pathInfo, this);
 }
Exemplo n.º 33
0
        internal Task<ConnectionStatus> ClusterRerouteDispatchAsync(ElasticsearchPathInfo<ClusterRerouteQueryString> pathInfo , object body)
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.POST:
                    //POST /_cluster/reroute
                    if (body != null)
                        return this.Raw.ClusterReroutePostAsync(body,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.ClusterReroute() into any of the following paths: \r\n - /_cluster/reroute");
        }
Exemplo n.º 34
0
 public static void Update(ElasticsearchPathInfo <OpenIndexRequestParameters> pathInfo, IOpenIndexRequest request)
 {
     pathInfo.HttpMethod = PathInfoHttpMethod.POST;
 }
Exemplo n.º 35
0
        internal Task<ConnectionStatus> CountDispatchAsync(ElasticsearchPathInfo<CountQueryString> pathInfo , object body)
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.POST:
                    //POST /{index}/{type}/_count
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
                        return this.Raw.CountPostAsync(pathInfo.Index,pathInfo.Type,body,u => pathInfo.QueryString);
                    //POST /{index}/_count
                    if (!pathInfo.Index.IsNullOrEmpty() && body != null)
                        return this.Raw.CountPostAsync(pathInfo.Index,body,u => pathInfo.QueryString);
                    //POST /_count
                    if (body != null)
                        return this.Raw.CountPostAsync(body,u => pathInfo.QueryString);
                    break;

                case PathInfoHttpMethod.GET:
                    //GET /{index}/{type}/_count
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
                        return this.Raw.CountGetAsync(pathInfo.Index,pathInfo.Type,u => pathInfo.QueryString);
                    //GET /{index}/_count
                    if (!pathInfo.Index.IsNullOrEmpty())
                        return this.Raw.CountGetAsync(pathInfo.Index,u => pathInfo.QueryString);
                    //GET /_count
                    return this.Raw.CountGetAsync(u => pathInfo.QueryString);

            }
            throw new DispatchException("Could not dispatch IElasticClient.Count() into any of the following paths: \r\n - /_count\r\n - /{index}/_count\r\n - /{index}/{type}/_count");
        }
Exemplo n.º 36
0
 protected override void UpdatePathInfo(IConnectionSettingsValues settings, ElasticsearchPathInfo <OpenIndexRequestParameters> pathInfo)
 {
     OpenIndexPathInfo.Update(pathInfo, this);
 }
Exemplo n.º 37
0
 public static void Update(ElasticsearchPathInfo <GetTemplateRequestParameters> pathInfo, IGetTemplateRequest request)
 {
     pathInfo.HttpMethod = PathInfoHttpMethod.GET;
 }
Exemplo n.º 38
0
 public static void Update(ElasticsearchPathInfo <ClearCacheRequestParameters> pathInfo, IClearCacheRequest request)
 {
     pathInfo.HttpMethod = PathInfoHttpMethod.POST;
 }
Exemplo n.º 39
0
        internal Task<ConnectionStatus> ExplainDispatchAsync(ElasticsearchPathInfo<ExplainQueryString> pathInfo , object body)
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.GET:
                    //GET /{index}/{type}/{id}/_explain
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
                        return this.Raw.ExplainGetAsync(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.QueryString);
                    break;

                case PathInfoHttpMethod.POST:
                    //POST /{index}/{type}/{id}/_explain
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
                        return this.Raw.ExplainPostAsync(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.Explain() into any of the following paths: \r\n - /{index}/{type}/{id}/_explain");
        }
Exemplo n.º 40
0
 protected override void UpdatePathInfo(IConnectionSettingsValues settings, ElasticsearchPathInfo <ClearCacheRequestParameters> pathInfo)
 {
     ClearCachePathInfo.Update(pathInfo, this);
 }
Exemplo n.º 41
0
        internal ConnectionStatus IndexDispatch(ElasticsearchPathInfo<IndexQueryString> pathInfo , object body)
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.POST:
                    //POST /{index}/{type}/{id}
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
                        return this.Raw.IndexPost(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.QueryString);
                    //POST /{index}/{type}
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
                        return this.Raw.IndexPost(pathInfo.Index,pathInfo.Type,body,u => pathInfo.QueryString);
                    break;

                case PathInfoHttpMethod.PUT:
                    //PUT /{index}/{type}/{id}
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
                        return this.Raw.IndexPut(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.QueryString);
                    //PUT /{index}/{type}
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
                        return this.Raw.IndexPut(pathInfo.Index,pathInfo.Type,body,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.Index() into any of the following paths: \r\n - /{index}/{type}\r\n - /{index}/{type}/{id}");
        }
Exemplo n.º 42
0
        internal Task<ConnectionStatus> InfoDispatchAsync(ElasticsearchPathInfo<InfoQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.GET:
                    //GET /
                    return this.Raw.InfoGetAsync(u => pathInfo.QueryString);

            }
            throw new DispatchException("Could not dispatch IElasticClient.Info() into any of the following paths: \r\n - /");
        }
Exemplo n.º 43
0
        internal Task<ConnectionStatus> IndicesClearCacheDispatchAsync(ElasticsearchPathInfo<ClearCacheQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.POST:
                    //POST /{index}/_cache/clear
                    if (!pathInfo.Index.IsNullOrEmpty())
                        return this.Raw.IndicesClearCachePostAsync(pathInfo.Index,u => pathInfo.QueryString);
                    //POST /_cache/clear
                    return this.Raw.IndicesClearCachePostAsync(u => pathInfo.QueryString);

                case PathInfoHttpMethod.GET:
                    //GET /{index}/_cache/clear
                    if (!pathInfo.Index.IsNullOrEmpty())
                        return this.Raw.IndicesClearCacheGetAsync(pathInfo.Index,u => pathInfo.QueryString);
                    //GET /_cache/clear
                    return this.Raw.IndicesClearCacheGetAsync(u => pathInfo.QueryString);

            }
            throw new DispatchException("Could not dispatch IElasticClient.IndicesClearCache() into any of the following paths: \r\n - /_cache/clear\r\n - /{index}/_cache/clear");
        }
Exemplo n.º 44
0
        internal ConnectionStatus MltDispatch(ElasticsearchPathInfo<MoreLikeThisQueryString> pathInfo , object body)
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.GET:
                    //GET /{index}/{type}/{id}/_mlt
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
                        return this.Raw.MltGet(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.QueryString);
                    break;

                case PathInfoHttpMethod.POST:
                    //POST /{index}/{type}/{id}/_mlt
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
                        return this.Raw.MltPost(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.Mlt() into any of the following paths: \r\n - /{index}/{type}/{id}/_mlt");
        }
Exemplo n.º 45
0
        internal Task<ConnectionStatus> IndicesCreateDispatchAsync(ElasticsearchPathInfo<CreateIndexQueryString> pathInfo , object body)
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.PUT:
                    //PUT /{index}
                    if (!pathInfo.Index.IsNullOrEmpty() && body != null)
                        return this.Raw.IndicesCreatePutAsync(pathInfo.Index,body,u => pathInfo.QueryString);
                    break;

                case PathInfoHttpMethod.POST:
                    //POST /{index}
                    if (!pathInfo.Index.IsNullOrEmpty() && body != null)
                        return this.Raw.IndicesCreatePostAsync(pathInfo.Index,body,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.IndicesCreate() into any of the following paths: \r\n - /{index}");
        }
Exemplo n.º 46
0
        internal ConnectionStatus MsearchDispatch(ElasticsearchPathInfo<MultiSearchQueryString> pathInfo , object body)
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.GET:
                    //GET /{index}/{type}/_msearch
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
                        return this.Raw.MsearchGet(pathInfo.Index,pathInfo.Type,u => pathInfo.QueryString);
                    //GET /{index}/_msearch
                    if (!pathInfo.Index.IsNullOrEmpty())
                        return this.Raw.MsearchGet(pathInfo.Index,u => pathInfo.QueryString);
                    //GET /_msearch
                    return this.Raw.MsearchGet(u => pathInfo.QueryString);

                case PathInfoHttpMethod.POST:
                    //POST /{index}/{type}/_msearch
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
                        return this.Raw.MsearchPost(pathInfo.Index,pathInfo.Type,body,u => pathInfo.QueryString);
                    //POST /{index}/_msearch
                    if (!pathInfo.Index.IsNullOrEmpty() && body != null)
                        return this.Raw.MsearchPost(pathInfo.Index,body,u => pathInfo.QueryString);
                    //POST /_msearch
                    if (body != null)
                        return this.Raw.MsearchPost(body,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.Msearch() into any of the following paths: \r\n - /_msearch\r\n - /{index}/_msearch\r\n - /{index}/{type}/_msearch");
        }
Exemplo n.º 47
0
        internal Task<ConnectionStatus> IndicesDeleteDispatchAsync(ElasticsearchPathInfo<DeleteIndexQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.DELETE:
                    //DELETE /{index}
                    if (!pathInfo.Index.IsNullOrEmpty())
                        return this.Raw.IndicesDeleteAsync(pathInfo.Index,u => pathInfo.QueryString);
                    //DELETE /
                    return this.Raw.IndicesDeleteAsync(u => pathInfo.QueryString);

            }
            throw new DispatchException("Could not dispatch IElasticClient.IndicesDelete() into any of the following paths: \r\n - /\r\n - /{index}");
        }
Exemplo n.º 48
0
        internal ConnectionStatus PercolateDispatch(ElasticsearchPathInfo<PercolateQueryString> pathInfo , object body)
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.GET:
                    //GET /{index}/{type}/_percolate
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
                        return this.Raw.PercolateGet(pathInfo.Index,pathInfo.Type,u => pathInfo.QueryString);
                    break;

                case PathInfoHttpMethod.POST:
                    //POST /{index}/{type}/_percolate
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
                        return this.Raw.PercolatePost(pathInfo.Index,pathInfo.Type,body,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.Percolate() into any of the following paths: \r\n - /{index}/{type}/_percolate");
        }
Exemplo n.º 49
0
        internal Task<ConnectionStatus> IndicesDeleteTemplateDispatchAsync(ElasticsearchPathInfo<DeleteTemplateQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.DELETE:
                    //DELETE /_template/{name}
                    if (!pathInfo.Name.IsNullOrEmpty())
                        return this.Raw.IndicesDeleteTemplateAsync(pathInfo.Name,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.IndicesDeleteTemplate() into any of the following paths: \r\n - /_template/{name}");
        }
Exemplo n.º 50
0
        internal Task<ConnectionStatus> ClusterNodeInfoDispatchAsync(ElasticsearchPathInfo<ClusterNodeInfoQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.GET:
                    //GET /_cluster/nodes/{node_id}
                    if (!pathInfo.NodeId.IsNullOrEmpty())
                        return this.Raw.ClusterNodeInfoGetAsync(pathInfo.NodeId,u => pathInfo.QueryString);
                    //GET /_cluster/nodes
                    return this.Raw.ClusterNodeInfoGetAsync(u => pathInfo.QueryString);

            }
            throw new DispatchException("Could not dispatch IElasticClient.ClusterNodeInfo() into any of the following paths: \r\n - /_cluster/nodes\r\n - /_cluster/nodes/{node_id}\r\n - /_nodes\r\n - /_nodes/{node_id}\r\n - /_nodes/settings\r\n - /_nodes/{node_id}/settings\r\n - /_nodes/os\r\n - /_nodes/{node_id}/os\r\n - /_nodes/process\r\n - /_nodes/{node_id}/process\r\n - /_nodes/jvm\r\n - /_nodes/{node_id}/jvm\r\n - /_nodes/thread_pool\r\n - /_nodes/{node_id}/thread_pool\r\n - /_nodes/network\r\n - /_nodes/{node_id}/network\r\n - /_nodes/transport\r\n - /_nodes/{node_id}/transport\r\n - /_nodes/http\r\n - /_nodes/{node_id}/http\r\n - /_nodes/plugin\r\n - /_nodes/{node_id}/plugin");
        }
Exemplo n.º 51
0
        internal Task<ConnectionStatus> IndicesExistsAliasDispatchAsync(ElasticsearchPathInfo<IndicesExistsAliasQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.HEAD:
                    //HEAD /{index}/_alias/{name}
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
                        return this.Raw.IndicesExistsAliasHeadAsync(pathInfo.Index,pathInfo.Name,u => pathInfo.QueryString);
                    //HEAD /_alias/{name}
                    if (!pathInfo.Name.IsNullOrEmpty())
                        return this.Raw.IndicesExistsAliasHeadAsync(pathInfo.Name,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.IndicesExistsAlias() into any of the following paths: \r\n - /_alias/{name}\r\n - /{index}/_alias/{name}");
        }
 protected override void UpdatePathInfo(IConnectionSettingsValues settings, ElasticsearchPathInfo <MultiTermVectorsRequestParameters> pathInfo)
 {
 }