From 8875f4e8616c6a3560e75be14a37790827ea47c4 Mon Sep 17 00:00:00 2001 From: Mpdreamz Date: Mon, 26 Sep 2016 15:27:36 +0200 Subject: [PATCH] removed deleted file from csproj deprecate _ttl/_timestamp and remove them from our tests as per elastic/elasticsearch#18980 so that migrated 2.x indices do not have their code altered (just yet) explicit 5.x spec generation fix failing nodes test because is removed as per elastic/elasticsearch#19218 fixed failing integration tests due to lang no longer defaulting to groovy elastic/elasticsearch#19960 fields => stored fields, updated failing cathelp tests due to endpoint changing suggest response is now generic and gets _source returned in accordance with elastic/elasticsearch#19536 histogram key double not long source filtering include and exclude are now plural script fields tests did not explicitly specify groovy search's StoredFields still sent get task api tests wreaked havoc on the readonly tests scripted metric did not specify lang set script.max_compilations_per_minute on node fix top hits not setting groovy explicitly multi search now response 404 properly multitermvector tests making sure it took more then 0 is no longer reliable beta1 is too fast :) foreach put pipeline processors is no longer an array as per elastic/elasticsearch#19402 revert field=>stored_fields rename on update request remove propery name with dot failure assertion integration test, no longer valid since elastic/elasticsearch#19899 use existing elasticsearch node in test framework could still spawn a new java process revert field=>stored_fields rename on update request get pipeline api is now dictionary based as per elastic/elasticsearch#19685 xpack beta1 related fixes reindex tests not setting all waithandles and taking 3 minutes for no good reason missing fieldsecurity class fix post integration test failures unit test failures add back run as tests now that we send the right header in the beta1 world --- .../Descriptors/SearchDescriptorOverrides.cs | 2 +- .../Descriptors/UpdateDescriptorOverrides.cs | 2 +- src/CodeGeneration/ApiGenerator/Program.cs | 2 +- .../RestSpecification/Core/bulk.json | 14 +- .../RestSpecification/Core/cat.indices.json | 6 + .../RestSpecification/Core/cat.templates.json | 45 + .../Core/cluster.health.json | 8 +- .../Core/delete_by_query.json | 8 +- .../RestSpecification/Core/explain.json | 4 +- .../RestSpecification/Core/get.json | 4 +- .../RestSpecification/Core/index.json | 2 +- .../RestSpecification/Core/indices.flush.json | 2 +- .../Core/indices.upgrade.json | 2 +- .../RestSpecification/Core/mget.json | 4 +- .../RestSpecification/Core/root.html | 1574 +++++------------ .../Core/search_template.json | 8 + .../RestSpecification/Core/update.json | 12 + .../Core/update_by_query.json | 10 +- .../ApiGenerator/last_downloaded_version.txt | 2 +- .../Connection/HttpConnection.cs | 2 +- .../Domain/Enums.Generated.cs | 26 +- .../RequestParameters.Generated.cs | 120 +- .../ElasticLowLevelClient.Generated.cs | 56 +- .../IElasticLowLevelClient.Generated.cs | 56 +- src/Nest/Aggregations/AggregationsHelper.cs | 3 +- .../Bucket/Histogram/HistogramBucket.cs | 4 +- src/Nest/Cluster/NodesInfo/NodeInfo.cs | 3 - .../Bulk/BulkOperation/BulkOperationBase.cs | 10 +- .../Bulk/BulkOperation/IBulkOperation.cs | 4 +- .../MultiGet/Request/IMultiGetOperation.cs | 6 +- .../MultiGet/Request/MultiGetOperation.cs | 14 +- .../Multiple/MultiGet/Response/MultiGetHit.cs | 7 +- .../MultiTermVectorOperation.cs | 12 +- .../Multiple/Reindex/ReindexObservable.cs | 2 - src/Nest/Document/Single/Get/GetResponse.cs | 4 + .../Ingest/GetPipeline/GetPipelineResponse.cs | 17 +- .../Ingest/Processors/ForeachProcessor.cs | 12 +- .../SimulatePipelineResponse.cs | 6 - src/Nest/Nest.csproj | 1 + .../MultiSearchResponseJsonConverter.cs | 6 +- src/Nest/Search/Search/Hits/Hit.cs | 7 +- src/Nest/Search/Search/SearchRequest.cs | 16 +- src/Nest/Search/Search/SearchResponse.cs | 4 +- .../Search/SourceFiltering/SourceFilter.cs | 32 +- .../SourceFilterJsonConverter.cs | 4 +- .../CompletionSuggester.cs | 11 - src/Nest/Search/Suggesters/Suggest.cs | 4 +- .../Suggest/ElasticClient-Suggest.cs | 31 +- .../Suggesters/Suggest/SuggestResponse.cs | 21 +- .../Suggest/SuggestResponseJsonConverter.cs | 27 +- src/Nest/Search/Suggesters/SuggestOption.cs | 31 +- src/Nest/XPack/Security/Role/FieldSecurity.cs | 40 + .../Role/PutRole/IndicesPrivileges.cs | 19 +- src/Nest/_Generated/_Descriptors.generated.cs | 166 +- .../_Generated/_LowLevelDispatch.generated.cs | 26 +- .../_RequestParametersExtensions.Generated.cs | 60 +- src/Nest/_Generated/_Requests.generated.cs | 140 +- .../Filter/FilterAggregationUsageTests.cs | 9 +- .../Terms/TermsAggregationUsageTests.cs | 7 +- .../Average/AverageAggregationUsageTests.cs | 5 +- .../PercentileRanksAggregationUsageTests.cs | 9 +- .../PercentilesAggregationUsageTests.cs | 7 +- .../ScriptedMetricAggregationUsageTests.cs | 26 +- .../TopHits/TopHitsAggregationUsageTests.cs | 14 +- .../BucketScriptAggregationUsageTests.cs | 7 +- .../BucketSelectorAggregationUsageTests.cs | 9 +- src/Tests/Cat/CatHelp/CatHelpApiTests.cs | 2 +- .../CatThreadPool/CatThreadpoolApiTests.cs | 2 +- .../Inference/PropertyInference.doc.cs | 39 - .../ClusterStats/ClusterStatsApiTests.cs | 1 - .../Cluster/NodesInfo/NodesInfoApiTests.cs | 1 - .../TaskManagement/GetTask/GetTaskApiTests.cs | 11 +- .../Multiple/BulkAll/BulkAllApiTests.cs | 4 +- .../Multiple/MultiGet/MultiGetApiTests.cs | 3 - .../MultiTermVectorsApiTests.cs | 1 - .../Multiple/Reindex/ReindexApiTests.cs | 8 +- .../ReindexOnServerApiTests.cs | 49 +- .../ReindexRethrottleApiTests.cs | 6 +- .../UpdateByQuery/UpdateByQueryApiTests.cs | 20 +- .../Single/Attachment/AttachmentApiTests.cs | 4 +- src/Tests/Document/Single/Get/GetApiTests.cs | 9 +- .../Single/Index/IndexIngestApiTests.cs | 4 +- .../Index/IndexIngestAttachmentApiTests.cs | 4 +- .../Single/Index/IndexIngestGeoIpApiTests.cs | 4 +- .../EndpointTests/Clusters/WritableCluster.cs | 3 + .../Process/ElasticsearchConsoleOut.cs | 2 + .../Process/ElasticsearchNode.cs | 3 +- .../Framework/Xunit/ForEachAsyncExtensions.cs | 2 +- .../Framework/Xunit/TestAssemblyRunner.cs | 7 +- src/Tests/Ingest/PipelineCrudTests.cs | 27 +- .../Ingest/PutPipeline/PutPipelineApiTests.cs | 18 +- .../Modules/Scripting/ScriptingCrudTests.cs | 4 +- src/Tests/Reproduce/GithubIssue2173.cs | 2 +- .../MultiSearch/MultiSearchInvalidApiTests.cs | 3 +- src/Tests/Search/Request/FieldsUsageTests.cs | 6 +- .../Search/Request/ScriptFieldsUsageTests.cs | 51 +- src/Tests/Search/Request/SortUsageTests.cs | 5 +- .../Request/SourceFilteringUsageTests.cs | 20 +- src/Tests/Search/Request/SuggestUsageTests.cs | 11 +- src/Tests/Search/Search/SearchApiTests.cs | 6 +- .../SearchTemplate/SearchTemplateCrudTests.cs | 5 +- .../Search/Suggesters/SuggestApiTests.cs | 24 +- .../Security/Role/PutRole/PutRoleApiTests.cs | 18 +- .../XPack/Security/Role/RoleCrudTests.cs | 32 +- .../Security/User/PutUser/PutUserApiTests.cs | 9 +- src/Tests/tests.yaml | 2 +- 106 files changed, 1568 insertions(+), 1678 deletions(-) create mode 100644 src/CodeGeneration/ApiGenerator/RestSpecification/Core/cat.templates.json create mode 100644 src/Nest/XPack/Security/Role/FieldSecurity.cs diff --git a/src/CodeGeneration/ApiGenerator/Overrides/Descriptors/SearchDescriptorOverrides.cs b/src/CodeGeneration/ApiGenerator/Overrides/Descriptors/SearchDescriptorOverrides.cs index 5649a9d0d8a..d945ff32a2e 100644 --- a/src/CodeGeneration/ApiGenerator/Overrides/Descriptors/SearchDescriptorOverrides.cs +++ b/src/CodeGeneration/ApiGenerator/Overrides/Descriptors/SearchDescriptorOverrides.cs @@ -15,7 +15,7 @@ public class SearchDescriptorOverrides : DescriptorOverridesBase "explain", "version", "q", //we dont support GET searches - "fields", + "stored_fields", "indices_boost", "source", "sort", diff --git a/src/CodeGeneration/ApiGenerator/Overrides/Descriptors/UpdateDescriptorOverrides.cs b/src/CodeGeneration/ApiGenerator/Overrides/Descriptors/UpdateDescriptorOverrides.cs index afbb56b00fe..6e11e796349 100644 --- a/src/CodeGeneration/ApiGenerator/Overrides/Descriptors/UpdateDescriptorOverrides.cs +++ b/src/CodeGeneration/ApiGenerator/Overrides/Descriptors/UpdateDescriptorOverrides.cs @@ -7,7 +7,7 @@ public class UpdateDescriptorOverrides : DescriptorOverridesBase { public override IEnumerable SkipQueryStringParams => new [] { - "fields" + "fields", "_source_include", "_source_exclude" }; } } diff --git a/src/CodeGeneration/ApiGenerator/Program.cs b/src/CodeGeneration/ApiGenerator/Program.cs index f706e769907..6816f8b9fdc 100644 --- a/src/CodeGeneration/ApiGenerator/Program.cs +++ b/src/CodeGeneration/ApiGenerator/Program.cs @@ -10,7 +10,7 @@ public static class Program static void Main(string[] args) { bool redownloadCoreSpecification = false; - string downloadBranch = "master"; + string downloadBranch = "5.x"; var answer = "invalid"; while (answer != "y" && answer != "n" && answer != "") diff --git a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/bulk.json b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/bulk.json index 27d951fa41b..2ff171bf528 100644 --- a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/bulk.json +++ b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/bulk.json @@ -39,7 +39,19 @@ }, "fields": { "type": "list", - "description" : "Default comma-separated list of fields to return in the response for updates" + "description" : "Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request" + }, + "_source": { + "type" : "list", + "description" : "True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request" + }, + "_source_exclude": { + "type" : "list", + "description" : "Default list of fields to exclude from the returned _source field, can be overridden on each sub-request" + }, + "_source_include": { + "type" : "list", + "description" : "Default list of fields to extract and return from the _source field, can be overridden on each sub-request" }, "pipeline" : { "type" : "string", diff --git a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/cat.indices.json b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/cat.indices.json index 7858fc2ee9e..03b67fd14c2 100644 --- a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/cat.indices.json +++ b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/cat.indices.json @@ -33,6 +33,12 @@ "type": "list", "description" : "Comma-separated list of column names to display" }, + "health": { + "type" : "enum", + "options" : ["green","yellow","red"], + "default" : null, + "description" : "A health status (\"green\", \"yellow\", or \"red\" to filter only indices matching the specified health status" + }, "help": { "type": "boolean", "description": "Return help information", diff --git a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/cat.templates.json b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/cat.templates.json new file mode 100644 index 00000000000..f8aaa72723a --- /dev/null +++ b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/cat.templates.json @@ -0,0 +1,45 @@ +{ + "cat.templates": { + "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html", + "methods": ["GET"], + "url": { + "path": "/_cat/templates", + "paths": ["/_cat/templates", "/_cat/templates/{name}"], + "parts": { + "name": { + "type" : "string", + "description" : "A pattern that returned template names must match" + } + }, + "params": { + "format": { + "type" : "string", + "description" : "a short version of the Accept header, e.g. json, yaml" + }, + "local": { + "type" : "boolean", + "description" : "Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout": { + "type" : "time", + "description" : "Explicit operation timeout for connection to master node" + }, + "h": { + "type": "list", + "description" : "Comma-separated list of column names to display" + }, + "help": { + "type": "boolean", + "description": "Return help information", + "default": false + }, + "v": { + "type": "boolean", + "description": "Verbose mode. Display column headers", + "default": false + } + } + }, + "body": null + } +} diff --git a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/cluster.health.json b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/cluster.health.json index c00f8635773..f1a6a98217c 100644 --- a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/cluster.health.json +++ b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/cluster.health.json @@ -31,7 +31,7 @@ "description" : "Explicit operation timeout" }, "wait_for_active_shards": { - "type" : "number", + "type" : "string", "description" : "Wait until the specified number of shards is active" }, "wait_for_nodes": { @@ -43,9 +43,9 @@ "options" : ["immediate", "urgent", "high", "normal", "low", "languid"], "description" : "Wait until all currently queued events with the given priorty are processed" }, - "wait_for_relocating_shards": { - "type" : "number", - "description" : "Wait until the specified number of relocating shards is finished" + "wait_for_no_relocating_shards": { + "type" : "boolean", + "description" : "Whether to wait until there are no relocating shards in the cluster" }, "wait_for_status": { "type" : "enum", diff --git a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/delete_by_query.json b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/delete_by_query.json index f8743e1d1ba..a734f7b1bac 100644 --- a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/delete_by_query.json +++ b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/delete_by_query.json @@ -40,13 +40,13 @@ "type" : "boolean", "description" : "Specify whether to return detailed information about score computation as part of a hit" }, - "fields": { + "stored_fields": { "type" : "list", - "description" : "A comma-separated list of fields to return as part of a hit" + "description" : "A comma-separated list of stored fields to return as part of a hit" }, - "fielddata_fields": { + "docvalue_fields": { "type" : "list", - "description" : "A comma-separated list of fields to return as the field data representation of a field for each hit" + "description" : "A comma-separated list of fields to return as the docvalue representation of a field for each hit" }, "from": { "type" : "number", diff --git a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/explain.json b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/explain.json index 30b5deff1d3..328794ffdd0 100644 --- a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/explain.json +++ b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/explain.json @@ -41,9 +41,9 @@ "type" : "string", "description" : "The default field for query string query (default: _all)" }, - "fields": { + "stored_fields": { "type": "list", - "description" : "A comma-separated list of fields to return in the response" + "description" : "A comma-separated list of stored fields to return in the response" }, "lenient": { "type" : "boolean", diff --git a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/get.json b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/get.json index e0e5170f9c3..8aba39e7710 100644 --- a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/get.json +++ b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/get.json @@ -23,9 +23,9 @@ } }, "params": { - "fields": { + "stored_fields": { "type": "list", - "description" : "A comma-separated list of fields to return in the response" + "description" : "A comma-separated list of stored fields to return in the response" }, "parent": { "type" : "string", diff --git a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/index.json b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/index.json index b46e3fcf116..677219addee 100644 --- a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/index.json +++ b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/index.json @@ -39,7 +39,7 @@ "refresh": { "type" : "enum", "options": ["true", "false", "wait_for"], - "description" : "If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes." + "description" : "If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes." }, "routing": { "type" : "string", diff --git a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/indices.flush.json b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/indices.flush.json index d47619c73a1..77d9e037163 100644 --- a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/indices.flush.json +++ b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/indices.flush.json @@ -18,7 +18,7 @@ }, "wait_if_ongoing": { "type" : "boolean", - "description" : "If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is false and will cause an exception to be thrown on the shard level if another flush operation is already running." + "description" : "If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running." }, "ignore_unavailable": { "type" : "boolean", diff --git a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/indices.upgrade.json b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/indices.upgrade.json index 0e5e4ffd244..66111456719 100644 --- a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/indices.upgrade.json +++ b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/indices.upgrade.json @@ -29,7 +29,7 @@ "wait_for_completion": { "type" : "boolean", "description" : "Specify whether the request should block until the all segments are upgraded (default: false)" - }, + }, "only_ancient_segments": { "type" : "boolean", "description" : "If true, only ancient (an older Lucene major release) segments will be upgraded" diff --git a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/mget.json b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/mget.json index 1639f3619b3..1f1f5adf75e 100644 --- a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/mget.json +++ b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/mget.json @@ -16,9 +16,9 @@ } }, "params": { - "fields": { + "stored_fields": { "type": "list", - "description" : "A comma-separated list of fields to return in the response" + "description" : "A comma-separated list of stored fields to return in the response" }, "preference": { "type" : "string", diff --git a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/root.html b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/root.html index bb421a81146..d19304fbf5a 100644 --- a/src/CodeGeneration/ApiGenerator/RestSpecification/Core/root.html +++ b/src/CodeGeneration/ApiGenerator/RestSpecification/Core/root.html @@ -8,22 +8,22 @@ - - + + - + - + - + - elasticsearch/rest-api-spec/src/main/resources/rest-api-spec/api at master · elastic/elasticsearch · GitHub + elasticsearch/rest-api-spec/src/main/resources/rest-api-spec/api at 5.x · elastic/elasticsearch · GitHub @@ -46,7 +46,7 @@ - + @@ -56,7 +56,7 @@ - + @@ -69,16 +69,16 @@ - + - - + + - + @@ -86,10 +86,10 @@ - + - + @@ -127,7 +127,7 @@