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");
        }
        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}");
        }
        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}");
        }
        internal Task<ConnectionStatus> InfoDispatchAsync(ElasticSearchPathInfo<InfoQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.GET:
                    //GET /
                    return this.Raw.InfoGetAsync(u => pathInfo.QueryString);

                case PathInfoHttpMethod.HEAD:
                    //HEAD /
                    return this.Raw.InfoHeadAsync(u => pathInfo.QueryString);

            }
            throw new DispatchException("Could not dispatch IElasticClient.Info() into any of the following paths: \r\n - /");
        }
        internal ConnectionStatus DeleteDispatch(ElasticSearchPathInfo<DeleteQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.DELETE:
                    //DELETE /{index}/{type}/{id}
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
                        return this.Raw.Delete(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.Delete() into any of the following paths: \r\n - /{index}/{type}/{id}");
        }
        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");
        }
        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}");
        }
        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}");
        }
        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.º 10
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.º 11
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");
        }
Exemplo n.º 12
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.º 13
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.º 14
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.º 15
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.º 16
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.º 17
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.º 18
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.º 19
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.º 20
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.º 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");
        }
Exemplo n.º 22
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.º 23
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.º 24
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.º 25
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.º 26
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.º 27
0
        internal Task<ConnectionStatus> IndicesDeleteMappingDispatchAsync(ElasticSearchPathInfo<DeleteMappingQueryString> pathInfo )
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.DELETE:
                    //DELETE /{index}/{type}/_mapping
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
                        return this.Raw.IndicesDeleteMappingAsync(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.º 28
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");
        }
Exemplo n.º 29
0
        internal ConnectionStatus IndicesDeleteWarmerDispatch(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.IndicesDeleteWarmer(pathInfo.Index,pathInfo.Type,pathInfo.Name,u => pathInfo.QueryString);
                    //DELETE /{index}/_warmer/{name}
                    if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
                        return this.Raw.IndicesDeleteWarmer(pathInfo.Index,pathInfo.Name,u => pathInfo.QueryString);
                    //DELETE /{index}/_warmer
                    if (!pathInfo.Index.IsNullOrEmpty())
                        return this.Raw.IndicesDeleteWarmer(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.º 30
0
        internal Task<ConnectionStatus> IndicesUpdateAliasesDispatchAsync(ElasticSearchPathInfo<AliasQueryString> pathInfo , object body)
        {
            switch(pathInfo.HttpMethod)
            {
                case PathInfoHttpMethod.POST:
                    //POST /_aliases
                    if (body != null)
                        return this.Raw.IndicesUpdateAliasesPostAsync(body,u => pathInfo.QueryString);
                    break;

            }
            throw new DispatchException("Could not dispatch IElasticClient.IndicesUpdateAliases() into any of the following paths: \r\n - /_aliases");
        }