From 96ebb5c3376dc5309e27e41890ab041f2bceeec6 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 25 Mar 2020 16:38:40 +0100 Subject: [PATCH 01/38] init work. 221 vs 231 failing fixed get/index tests CompatRestIT. test {yaml=get/21_stored_fields_with_types/Stored fields} CompatRestIT. test {yaml=get/71_source_filtering_with_types/Source filtering} CompatRestIT. test {yaml=index/70_mix_typeless_typeful/Index call that introduces new field mappings} CompatRestIT. test {yaml=index/70_mix_typeless_typeful/Index with typeless API on an index that has types} however the last one from get is still failing CompatRestIT. test {yaml=get/100_mix_typeless_typeful/GET with typeless API on an index that has --- .../elasticsearch/rest/BaseRestHandler.java | 7 ++++ .../elasticsearch/rest/RestController.java | 17 +++------ .../org/elasticsearch/rest/RestRequest.java | 19 ++++------ .../admin/indices/RestCreateIndexAction.java | 35 ++++++++++++++++++- 4 files changed, 52 insertions(+), 26 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/rest/BaseRestHandler.java b/server/src/main/java/org/elasticsearch/rest/BaseRestHandler.java index 101c3182fbb62..4e87f3acec2a5 100644 --- a/server/src/main/java/org/elasticsearch/rest/BaseRestHandler.java +++ b/server/src/main/java/org/elasticsearch/rest/BaseRestHandler.java @@ -51,6 +51,13 @@ */ public abstract class BaseRestHandler implements RestHandler { + /** + * Parameter that controls whether certain REST apis should include type names in their requests or responses. + * Note: Support for this parameter will be removed after the transition period to typeless APIs. + */ + public static final String INCLUDE_TYPE_NAME_PARAMETER = "include_type_name"; + public static final boolean DEFAULT_INCLUDE_TYPE_NAME_POLICY = false; + public static final Setting MULTI_ALLOW_EXPLICIT_INDEX = Setting.boolSetting("rest.action.multi.allow_explicit_index", true, Property.NodeScope); diff --git a/server/src/main/java/org/elasticsearch/rest/RestController.java b/server/src/main/java/org/elasticsearch/rest/RestController.java index 1f97f8556319f..9d6773afddd59 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestController.java +++ b/server/src/main/java/org/elasticsearch/rest/RestController.java @@ -45,24 +45,15 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Supplier; import java.util.function.UnaryOperator; import java.util.stream.Collectors; import static org.elasticsearch.rest.BytesRestResponse.TEXT_CONTENT_TYPE; -import static org.elasticsearch.rest.CompatibleConstants.COMPATIBLE_PARAMS_KEY; import static org.elasticsearch.rest.CompatibleConstants.COMPATIBLE_VERSION; -import static org.elasticsearch.rest.RestStatus.BAD_REQUEST; -import static org.elasticsearch.rest.RestStatus.INTERNAL_SERVER_ERROR; -import static org.elasticsearch.rest.RestStatus.METHOD_NOT_ALLOWED; -import static org.elasticsearch.rest.RestStatus.NOT_ACCEPTABLE; -import static org.elasticsearch.rest.RestStatus.OK; +import static org.elasticsearch.rest.RestStatus.*; public class RestController implements HttpServerTransport.Dispatcher { @@ -333,7 +324,7 @@ private void tryAllHandlers(final RestRequest request, final RestChannel channel } else { if(handler.compatibilityRequired() == false //regular (not removed) handlers are always dispatched //handlers that were registered compatible, require request to be compatible - || isCompatible(request)) { + || request.isCompatible(CompatibleConstants.COMPATIBLE_VERSION)) { dispatchRequest(request, channel, handler); } else { handleBadRequest(uri, requestMethod, channel); @@ -350,7 +341,7 @@ private void tryAllHandlers(final RestRequest request, final RestChannel channel } private boolean isCompatible(ToXContent.Params params) { - String param = params.param(COMPATIBLE_PARAMS_KEY); + String param = params.param(CompatibleConstants.COMPATIBLE_PARAMS_KEY); return COMPATIBLE_VERSION.equals(param); } diff --git a/server/src/main/java/org/elasticsearch/rest/RestRequest.java b/server/src/main/java/org/elasticsearch/rest/RestRequest.java index 63ebe4bf6e185..f2871d6ad9525 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestRequest.java +++ b/server/src/main/java/org/elasticsearch/rest/RestRequest.java @@ -30,23 +30,13 @@ import org.elasticsearch.common.collect.Tuple; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.common.xcontent.*; import org.elasticsearch.http.HttpChannel; import org.elasticsearch.http.HttpRequest; import java.io.IOException; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.concurrent.atomic.AtomicLong; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -194,6 +184,11 @@ public static RestRequest requestWithoutParameters(NamedXContentRegistry xConten requestIdGenerator.incrementAndGet()); } + public boolean isCompatible(String compatibleVersion) { + String param = param(CompatibleConstants.COMPATIBLE_PARAMS_KEY); + return compatibleVersion.equals(param); + } + public enum Method { GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH, TRACE, CONNECT } diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java index 3519fe48f6a8a..d6af4fa872b83 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java @@ -19,6 +19,7 @@ package org.elasticsearch.rest.action.admin.indices; +import org.elasticsearch.Version; import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.client.node.NodeClient; @@ -30,6 +31,7 @@ import org.elasticsearch.rest.action.RestToXContentListener; import java.io.IOException; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -57,7 +59,13 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC if (request.hasContent()) { Map sourceAsMap = XContentHelper.convertToMap(request.requiredContent(), false, request.getXContentType()).v2(); - sourceAsMap = prepareMappings(sourceAsMap); + if(isV7Compatible(request)){ + request.param(INCLUDE_TYPE_NAME_PARAMETER);//just consume, it is not replaced with _doc + sourceAsMap = prepareMappingsV7(sourceAsMap, request); + }else { + sourceAsMap = prepareMappings(sourceAsMap); + } + createIndexRequest.source(sourceAsMap, LoggingDeprecationHandler.INSTANCE); } @@ -67,6 +75,9 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC return channel -> client.admin().indices().create(createIndexRequest, new RestToXContentListener<>(channel)); } + private boolean isV7Compatible(RestRequest request) { + return request.isCompatible(""+ Version.V_7_0_0.major); + } static Map prepareMappings(Map source) { if (source.containsKey("mappings") == false @@ -85,4 +96,26 @@ static Map prepareMappings(Map source) { newSource.put("mappings", singletonMap(MapperService.SINGLE_MAPPING_NAME, mappings)); return newSource; } + + static Map prepareMappingsV7(Map source, RestRequest request) { + final boolean includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, + DEFAULT_INCLUDE_TYPE_NAME_POLICY); + + @SuppressWarnings("unchecked") + Map mappings = (Map) source.get("mappings"); + + if (includeTypeName && mappings.size() == 1) { + //no matter what the type was, replace it with _doc + Map newSource = new HashMap<>(); + + String typeName = mappings.keySet().iterator().next(); + @SuppressWarnings("unchecked") + Map typedMappings = (Map) mappings.get(typeName); + + newSource.put("mappings", Collections.singletonMap(MapperService.SINGLE_MAPPING_NAME, typedMappings)); + return newSource; + }else{ + return prepareMappings(source); + } + } } From 2e922bf77ab08d48a8c2c48f8073b082275cbf10 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Fri, 27 Mar 2020 14:57:42 +0100 Subject: [PATCH 02/38] allow registering multiple rest actions under the same path --- ...icsearch.plugins.spi.NamedXContentProvider | 6 + .../forbidden/rest-high-level-signatures.txt | 36 + .../security/delegate_pki/README.asciidoc | 35 + .../security/delegate_pki/openssl_config.cnf | 185 +++ .../security/delegate_pki/testClient.crt | 21 + .../security/delegate_pki/testClient.key | 27 + .../delegate_pki/testIntermediateCA.crt | 24 + .../delegate_pki/testIntermediateCA.key | 27 + .../security/delegate_pki/testRootCA.crt | 24 + .../security/delegate_pki/testRootCA.key | 27 + ...icsearch.plugins.spi.NamedXContentProvider | 1 + ...icsearch.plugins.spi.NamedXContentProvider | 1 + ...icsearch.plugins.spi.NamedXContentProvider | 1 + .../rest/compat/RestCompatPlugin.java | 4 +- .../version7/RestCreateIndexActionV7.java | 125 ++ .../rest/compat/version7/RestGetActionV7.java | 4 +- .../compat/version7/RestIndexActionV7.java | 12 +- .../resources/rest-api-spec/api/_common.json | 31 + .../resources/rest-api-spec/api/bulk.json | 98 ++ .../rest-api-spec/api/cat.aliases.json | 71 + .../rest-api-spec/api/cat.allocation.json | 80 + .../rest-api-spec/api/cat.count.json | 55 + .../rest-api-spec/api/cat.fielddata.json | 76 + .../rest-api-spec/api/cat.health.json | 61 + .../resources/rest-api-spec/api/cat.help.json | 30 + .../rest-api-spec/api/cat.indices.json | 125 ++ .../rest-api-spec/api/cat.master.json | 51 + .../rest-api-spec/api/cat.nodeattrs.json | 51 + .../rest-api-spec/api/cat.nodes.json | 89 ++ .../rest-api-spec/api/cat.pending_tasks.json | 64 + .../rest-api-spec/api/cat.plugins.json | 51 + .../rest-api-spec/api/cat.recovery.json | 99 ++ .../rest-api-spec/api/cat.repositories.json | 52 + .../rest-api-spec/api/cat.segments.json | 72 + .../rest-api-spec/api/cat.shards.json | 93 ++ .../rest-api-spec/api/cat.snapshots.json | 77 + .../rest-api-spec/api/cat.tasks.json | 72 + .../rest-api-spec/api/cat.templates.json | 63 + .../rest-api-spec/api/cat.thread_pool.json | 75 + .../rest-api-spec/api/clear_scroll.json | 40 + .../api/cluster.allocation_explain.json | 33 + .../cluster.delete_component_template.json | 35 + .../api/cluster.get_component_template.json | 41 + .../api/cluster.get_settings.json | 38 + .../rest-api-spec/api/cluster.health.json | 105 ++ .../api/cluster.pending_tasks.json | 29 + .../api/cluster.put_component_template.json | 45 + .../api/cluster.put_settings.json | 37 + .../api/cluster.remote_info.json | 20 + .../rest-api-spec/api/cluster.reroute.json | 57 + .../rest-api-spec/api/cluster.state.json | 109 ++ .../rest-api-spec/api/cluster.stats.json | 41 + .../resources/rest-api-spec/api/count.json | 129 ++ .../resources/rest-api-spec/api/create.json | 100 ++ .../resources/rest-api-spec/api/delete.json | 99 ++ .../rest-api-spec/api/delete_by_query.json | 201 +++ .../api/delete_by_query_rethrottle.json | 32 + .../rest-api-spec/api/delete_script.json | 35 + .../resources/rest-api-spec/api/exists.json | 102 ++ .../rest-api-spec/api/exists_source.json | 98 ++ .../resources/rest-api-spec/api/explain.json | 114 ++ .../rest-api-spec/api/field_caps.json | 64 + .../resources/rest-api-spec/api/get.json | 102 ++ .../rest-api-spec/api/get_script.json | 31 + .../rest-api-spec/api/get_script_context.json | 19 + .../api/get_script_languages.json | 19 + .../rest-api-spec/api/get_source.json | 98 ++ .../resources/rest-api-spec/api/index.json | 149 ++ .../rest-api-spec/api/indices.analyze.json | 42 + .../api/indices.clear_cache.json | 73 + .../rest-api-spec/api/indices.clone.json | 47 + .../rest-api-spec/api/indices.close.json | 59 + .../rest-api-spec/api/indices.create.json | 46 + .../api/indices.create_data_stream.json | 31 + .../rest-api-spec/api/indices.delete.json | 55 + .../api/indices.delete_alias.json | 55 + .../api/indices.delete_data_stream.json | 26 + .../api/indices.delete_template.json | 35 + .../rest-api-spec/api/indices.exists.json | 60 + .../api/indices.exists_alias.json | 67 + .../api/indices.exists_template.json | 39 + .../api/indices.exists_type.json | 55 + .../rest-api-spec/api/indices.flush.json | 63 + .../api/indices.flush_synced.json | 54 + .../rest-api-spec/api/indices.forcemerge.json | 65 + .../rest-api-spec/api/indices.get.json | 68 + .../rest-api-spec/api/indices.get_alias.json | 85 ++ .../api/indices.get_data_streams.json | 33 + .../api/indices.get_field_mapping.json | 121 ++ .../api/indices.get_mapping.json | 103 ++ .../api/indices.get_settings.json | 101 ++ .../api/indices.get_template.json | 49 + .../api/indices.get_upgrade.json | 53 + .../rest-api-spec/api/indices.open.json | 59 + .../rest-api-spec/api/indices.put_alias.json | 61 + .../api/indices.put_mapping.json | 205 +++ .../api/indices.put_settings.json | 73 + .../api/indices.put_template.json | 49 + .../rest-api-spec/api/indices.recovery.json | 43 + .../rest-api-spec/api/indices.refresh.json | 55 + .../rest-api-spec/api/indices.rollover.json | 66 + .../rest-api-spec/api/indices.segments.json | 58 + .../api/indices.shard_stores.json | 63 + .../rest-api-spec/api/indices.shrink.json | 51 + .../rest-api-spec/api/indices.split.json | 51 + .../rest-api-spec/api/indices.stats.json | 154 ++ .../api/indices.update_aliases.json | 33 + .../rest-api-spec/api/indices.upgrade.json | 61 + .../api/indices.validate_query.json | 121 ++ .../resources/rest-api-spec/api/info.json | 20 + .../api/ingest.delete_pipeline.json | 35 + .../api/ingest.get_pipeline.json | 37 + .../api/ingest.processor_grok.json | 20 + .../api/ingest.put_pipeline.json | 39 + .../rest-api-spec/api/ingest.simulate.json | 44 + .../resources/rest-api-spec/api/mget.json | 93 ++ .../resources/rest-api-spec/api/msearch.json | 95 ++ .../rest-api-spec/api/msearch_template.json | 86 ++ .../rest-api-spec/api/mtermvectors.json | 117 ++ .../rest-api-spec/api/nodes.hot_threads.json | 143 ++ .../rest-api-spec/api/nodes.info.json | 91 ++ .../api/nodes.reload_secure_settings.json | 37 + .../rest-api-spec/api/nodes.stats.json | 224 +++ .../rest-api-spec/api/nodes.usage.json | 73 + .../resources/rest-api-spec/api/ping.json | 20 + .../rest-api-spec/api/put_script.json | 61 + .../rest-api-spec/api/rank_eval.json | 67 + .../resources/rest-api-spec/api/reindex.json | 62 + .../rest-api-spec/api/reindex_rethrottle.json | 32 + .../api/render_search_template.json | 36 + .../api/scripts_painless_execute.json | 24 + .../resources/rest-api-spec/api/scroll.json | 56 + .../resources/rest-api-spec/api/search.json | 252 ++++ .../rest-api-spec/api/search_shards.json | 67 + .../rest-api-spec/api/search_template.json | 125 ++ .../api/snapshot.cleanup_repository.json | 36 + .../rest-api-spec/api/snapshot.create.json | 45 + .../api/snapshot.create_repository.json | 44 + .../rest-api-spec/api/snapshot.delete.json | 35 + .../api/snapshot.delete_repository.json | 35 + .../rest-api-spec/api/snapshot.get.json | 43 + .../api/snapshot.get_repository.json | 41 + .../rest-api-spec/api/snapshot.restore.json | 44 + .../rest-api-spec/api/snapshot.status.json | 57 + .../api/snapshot.verify_repository.json | 35 + .../rest-api-spec/api/tasks.cancel.json | 45 + .../rest-api-spec/api/tasks.get.json | 35 + .../rest-api-spec/api/tasks.list.json | 55 + .../rest-api-spec/api/termvectors.json | 148 ++ .../resources/rest-api-spec/api/update.json | 109 ++ .../rest-api-spec/api/update_by_query.json | 217 +++ .../api/update_by_query_rethrottle.json | 32 + .../rest-api-spec/test/README.asciidoc | 387 +++++ .../rest-api-spec/test/bulk/10_basic.yml | 124 ++ .../test/bulk/11_basic_with_types.yml | 120 ++ .../test/bulk/20_list_of_strings.yml | 21 + .../bulk/21_list_of_strings_with_types.yml | 17 + .../rest-api-spec/test/bulk/30_big_string.yml | 21 + .../test/bulk/31_big_string_with_types.yml | 17 + .../rest-api-spec/test/bulk/40_source.yml | 75 + .../test/bulk/41_source_with_types.yml | 76 + .../rest-api-spec/test/bulk/50_refresh.yml | 60 + .../test/bulk/51_refresh_with_types.yml | 48 + .../rest-api-spec/test/bulk/60_deprecated.yml | 26 + .../test/bulk/70_mix_typeless_typeful.yml | 35 + .../rest-api-spec/test/bulk/80_cas.yml | 42 + .../test/bulk/81_cas_with_types.yml | 45 + .../test/cat.aliases/10_basic.yml | 489 ++++++ .../test/cat.aliases/20_headers.yml | 24 + .../test/cat.aliases/30_json.yml | 21 + .../test/cat.aliases/40_hidden.yml | 147 ++ .../test/cat.allocation/10_basic.yml | 230 +++ .../rest-api-spec/test/cat.count/10_basic.yml | 73 + .../test/cat.fielddata/10_basic.yml | 78 + .../test/cat.health/10_basic.yml | 79 + .../test/cat.indices/10_basic.yml | 275 ++++ .../test/cat.indices/20_hidden.yml | 240 +++ .../test/cat.nodeattrs/10_basic.yml | 70 + .../rest-api-spec/test/cat.nodes/10_basic.yml | 108 ++ .../test/cat.plugins/10_basic.yml | 14 + .../test/cat.recovery/10_basic.yml | 134 ++ .../test/cat.repositories/10_basic.yml | 83 + .../test/cat.segments/10_basic.yml | 167 +++ .../test/cat.shards/10_basic.yml | 209 +++ .../test/cat.snapshots/10_basic.yml | 79 + .../rest-api-spec/test/cat.tasks/10_basic.yml | 19 + .../test/cat.templates/10_basic.yml | 257 ++++ .../test/cat.thread_pool/10_basic.yml | 80 + .../cluster.allocation_explain/10_basic.yml | 91 ++ .../cluster.component_template/10_basic.yml | 47 + .../test/cluster.health/10_basic.yml | 281 ++++ .../cluster.health/20_request_timeout.yml | 37 + .../cluster.health/30_indices_options.yml | 79 + .../test/cluster.pending_tasks/10_basic.yml | 14 + .../test/cluster.put_settings/10_basic.yml | 71 + .../test/cluster.remote_info/10_info.yml | 6 + .../test/cluster.reroute/10_basic.yml | 4 + .../test/cluster.reroute/11_explain.yml | 57 + .../cluster.reroute/20_response_filtering.yml | 14 + .../test/cluster.state/10_basic.yml | 19 + .../test/cluster.state/20_filtering.yml | 182 +++ .../cluster.state/30_expand_wildcards.yml | 92 ++ .../test/cluster.stats/10_basic.yml | 145 ++ .../rest-api-spec/test/count/10_basic.yml | 61 + .../test/count/11_basic_with_types.yml | 66 + .../test/count/20_query_string.yml | 58 + .../rest-api-spec/test/create/10_with_id.yml | 31 + .../test/create/11_with_id_with_types.yml | 33 + .../test/create/15_without_id.yml | 10 + .../test/create/15_without_id_with_types.yml | 8 + .../test/create/35_external_version.yml | 30 + .../create/36_external_version_with_types.yml | 30 + .../rest-api-spec/test/create/40_routing.yml | 42 + .../test/create/41_routing_with_types.yml | 43 + .../rest-api-spec/test/create/60_refresh.yml | 86 ++ .../test/create/61_refresh_with_types.yml | 82 + .../rest-api-spec/test/create/70_nested.yml | 41 + .../test/create/71_nested_with_types.yml | 42 + .../rest-api-spec/test/create/TODO.txt | 3 + .../rest-api-spec/test/delete/10_basic.yml | 21 + .../test/delete/11_shard_header.yml | 38 + .../rest-api-spec/test/delete/12_result.yml | 27 + .../test/delete/13_basic_with_types.yml | 19 + .../delete/14_shard_header_with_types.yml | 36 + .../test/delete/15_result_with_types.yml | 26 + .../rest-api-spec/test/delete/20_cas.yml | 31 + .../test/delete/21_cas_with_types.yml | 30 + .../test/delete/25_external_version.yml | 33 + .../test/delete/26_external_gte_version.yml | 52 + .../delete/27_external_version_with_types.yml | 32 + .../28_external_gte_version_with_types.yml | 53 + .../rest-api-spec/test/delete/30_routing.yml | 33 + .../test/delete/31_routing_with_types.yml | 32 + .../rest-api-spec/test/delete/50_refresh.yml | 154 ++ .../test/delete/51_refresh_with_types.yml | 148 ++ .../rest-api-spec/test/delete/60_missing.yml | 25 + .../test/delete/61_missing_with_types.yml | 19 + .../test/delete/70_mix_typeless_typeful.yml | 43 + .../rest-api-spec/test/delete/TODO.txt | 5 + .../rest-api-spec/test/exists/10_basic.yml | 35 + .../test/exists/11_basic_with_types.yml | 36 + .../rest-api-spec/test/exists/40_routing.yml | 41 + .../test/exists/41_routing_with_types.yml | 41 + .../test/exists/60_realtime_refresh.yml | 49 + .../exists/61_realtime_refresh_with_types.yml | 50 + .../rest-api-spec/test/exists/70_defaults.yml | 18 + .../test/exists/71_defaults_with_types.yml | 17 + .../rest-api-spec/test/exists/TODO.txt | 3 + .../rest-api-spec/test/explain/10_basic.yml | 65 + .../test/explain/11_basic_with_types.yml | 66 + .../test/explain/20_source_filtering.yml | 47 + .../21_source_filtering_with_types.yml | 44 + .../test/explain/30_query_string.yml | 67 + .../explain/31_query_string_with_types.yml | 71 + .../test/explain/40_mix_typeless_typeful.yml | 57 + .../rest-api-spec/test/explain/TODO.txt | 6 + .../test/field_caps/10_basic.yml | 325 ++++ .../rest-api-spec/test/field_caps/20_meta.yml | 65 + .../test/get/100_mix_typeless_typeful.yml | 47 + .../rest-api-spec/test/get/10_basic.yml | 22 + .../test/get/11_basic_with_types.yml | 31 + .../test/get/15_default_values.yml | 22 + .../test/get/16_default_values_with_types.yml | 21 + .../test/get/20_stored_fields.yml | 57 + .../test/get/21_stored_fields_with_types.yml | 60 + .../rest-api-spec/test/get/40_routing.yml | 44 + .../test/get/41_routing_with_types.yml | 43 + .../test/get/50_with_headers.yml | 25 + .../test/get/51_with_headers_with_types.yml | 26 + .../test/get/60_realtime_refresh.yml | 49 + .../get/61_realtime_refresh_with_types.yml | 49 + .../test/get/70_source_filtering.yml | 68 + .../get/71_source_filtering_with_types.yml | 69 + .../rest-api-spec/test/get/80_missing.yml | 23 + .../test/get/81_missing_with_types.yml | 19 + .../rest-api-spec/test/get/90_versions.yml | 83 + .../test/get/91_versions_with_types.yml | 89 ++ .../resources/rest-api-spec/test/get/TODO.txt | 3 + .../test/get_source/10_basic.yml | 26 + .../test/get_source/11_basic_with_types.yml | 17 + .../test/get_source/15_default_values.yml | 20 + .../16_default_values_with_types.yml | 16 + .../test/get_source/40_routing.yml | 42 + .../test/get_source/41_routing_with_types.yml | 42 + .../test/get_source/60_realtime_refresh.yml | 48 + .../61_realtime_refresh_with_types.yml | 49 + .../test/get_source/70_source_filtering.yml | 30 + .../71_source_filtering_with_types.yml | 27 + .../test/get_source/80_missing.yml | 27 + .../test/get_source/81_missing_with_types.yml | 19 + .../test/get_source/85_source_missing.yml | 38 + .../86_source_missing_with_types.yml | 39 + .../rest-api-spec/test/get_source/TODO.txt | 3 + .../rest-api-spec/test/index/10_with_id.yml | 35 + .../test/index/11_with_id_with_types.yml | 34 + .../rest-api-spec/test/index/12_result.yml | 22 + .../test/index/13_result_with_types.yml | 21 + .../test/index/15_without_id.yml | 28 + .../test/index/16_without_id_with_types.yml | 26 + .../rest-api-spec/test/index/20_optype.yml | 30 + .../test/index/21_optype_with_types.yml | 29 + .../rest-api-spec/test/index/30_cas.yml | 50 + .../test/index/35_external_version.yml | 54 + .../test/index/36_external_gte_version.yml | 55 + .../index/37_external_version_with_types.yml | 55 + .../38_external_gte_version_with_types.yml | 56 + .../rest-api-spec/test/index/40_routing.yml | 43 + .../test/index/41_routing_with_types.yml | 43 + .../rest-api-spec/test/index/60_refresh.yml | 93 ++ .../test/index/61_refresh_with_types.yml | 83 + .../test/index/70_mix_typeless_typeful.yml | 102 ++ .../rest-api-spec/test/index/TODO.txt | 3 + .../test/indices.analyze/10_analyze.yml | 75 + .../test/indices.analyze/20_analyze_limit.yml | 52 + .../test/indices.clear_cache/10_basic.yml | 20 + .../test/indices.clone/10_basic.yml | 111 ++ .../test/indices.clone/20_source_mapping.yml | 65 + .../test/indices.clone/30_copy_settings.yml | 61 + .../test/indices.create/10_basic.yml | 173 +++ .../indices.create/11_basic_with_types.yml | 143 ++ .../20_mix_typeless_typeful.yml | 140 ++ .../test/indices.data_stream/10_basic.yml | 33 + .../test/indices.delete/10_basic.yml | 100 ++ .../test/indices.delete_alias/10_basic.yml | 33 + .../indices.delete_alias/all_path_options.yml | 224 +++ .../test/indices.exists/10_basic.yml | 25 + .../indices.exists/20_read_only_index.yml | 30 + .../test/indices.exists_alias/10_basic.yml | 45 + .../test/indices.exists_template/10_basic.yml | 40 + .../test/indices.flush/10_basic.yml | 89 ++ .../test/indices.forcemerge/10_basic.yml | 31 + .../test/indices.get/10_basic.yml | 167 +++ .../test/indices.get/11_basic_with_types.yml | 78 + .../test/indices.get_alias/10_basic.yml | 324 ++++ .../test/indices.get_alias/20_empty.yml | 19 + .../test/indices.get_alias/30_wildcards.yml | 140 ++ .../indices.get_field_mapping/10_basic.yml | 54 + .../11_basic_with_types.yml | 83 + .../20_missing_field.yml | 21 + .../21_missing_field_with_types.yml | 23 + .../30_missing_type.yml | 22 + .../40_missing_index.yml | 10 + .../50_field_wildcards.yml | 133 ++ .../51_field_wildcards_with_types.yml | 144 ++ .../60_mix_typeless_typeful.yml | 21 + .../test/indices.get_mapping/10_basic.yml | 88 ++ .../11_basic_with_types.yml | 158 ++ .../indices.get_mapping/20_missing_type.yml | 106 ++ .../indices.get_mapping/30_missing_index.yml | 35 + .../test/indices.get_mapping/40_aliases.yml | 25 + .../50_wildcard_expansion.yml | 135 ++ .../test/indices.get_mapping/60_empty.yml | 18 + .../61_empty_with_types.yml | 20 + .../70_mix_typeless_typeful.yml | 23 + .../test/indices.get_settings/10_basic.yml | 173 +++ .../test/indices.get_settings/20_aliases.yml | 26 + .../test/indices.get_settings/30_defaults.yml | 28 + .../test/indices.get_template/10_basic.yml | 85 ++ .../11_basic_with_types.yml | 48 + .../indices.get_template/20_get_missing.yml | 13 + .../test/indices.open/10_basic.yml | 121 ++ .../test/indices.open/20_multiple_indices.yml | 104 ++ .../test/indices.put_alias/10_basic.yml | 82 + .../indices.put_alias/all_path_options.yml | 116 ++ .../test/indices.put_mapping/10_basic.yml | 129 ++ .../11_basic_with_types.yml | 74 + .../20_mix_typeless_typeful.yml | 83 + .../indices.put_mapping/all_path_options.yml | 165 ++ .../all_path_options_with_types.yml | 227 +++ .../test/indices.put_settings/10_basic.yml | 123 ++ .../test/indices.put_settings/11_reset.yml | 25 + .../indices.put_settings/all_path_options.yml | 113 ++ .../test/indices.put_template/10_basic.yml | 261 ++++ .../11_basic_with_types.yml | 74 + .../test/indices.recovery/10_basic.yml | 157 ++ .../test/indices.refresh/10_basic.yml | 58 + .../test/indices.rollover/10_basic.yml | 155 ++ .../indices.rollover/20_max_doc_condition.yml | 57 + .../30_max_size_condition.yml | 60 + .../test/indices.rollover/40_mapping.yml | 72 + .../41_mapping_with_types.yml | 47 + .../test/indices.segments/10_basic.yml | 74 + .../test/indices.shard_stores/10_basic.yml | 82 + .../test/indices.shrink/10_basic.yml | 83 + .../test/indices.shrink/20_source_mapping.yml | 74 + .../test/indices.shrink/30_copy_settings.yml | 105 ++ .../test/indices.sort/10_basic.yml | 158 ++ .../test/indices.split/10_basic.yml | 223 +++ .../test/indices.split/20_source_mapping.yml | 68 + .../test/indices.split/30_copy_settings.yml | 108 ++ .../test/indices.stats/10_index.yml | 116 ++ .../test/indices.stats/11_metric.yml | 164 ++ .../test/indices.stats/12_level.yml | 68 + .../test/indices.stats/13_fields.yml | 328 ++++ .../test/indices.stats/14_groups.yml | 78 + .../test/indices.stats/15_types.yml | 81 + .../test/indices.stats/20_translog.yml | 280 ++++ .../test/indices.stats/30_segments.yml | 63 + .../indices.stats/40_updates_on_refresh.yml | 67 + .../test/indices.update_aliases/10_basic.yml | 168 +++ .../indices.update_aliases/20_routing.yml | 135 ++ ...30_remove_index_and_replace_with_alias.yml | 35 + .../test/indices.upgrade/10_basic.yml | 72 + .../test/indices.validate_query/10_basic.yml | 88 ++ .../20_query_string.yml | 50 + .../rest-api-spec/test/info/10_info.yml | 9 + .../test/info/20_lucene_version.yml | 7 + .../rest-api-spec/test/ingest/10_basic.yml | 154 ++ .../rest-api-spec/test/mget/10_basic.yml | 42 + .../test/mget/11_default_index_type.yml | 44 + .../test/mget/12_non_existent_index.yml | 33 + .../test/mget/13_missing_metadata.yml | 49 + .../mget/14_alias_to_multiple_indices.yml | 45 + .../rest-api-spec/test/mget/15_ids.yml | 73 + .../test/mget/16_basic_with_types.yml | 45 + .../test/mget/17_default_index.yml | 40 + .../mget/18_non_existent_index_with_types.yml | 30 + .../mget/19_missing_metadata_with_types.yml | 47 + .../test/mget/20_stored_fields.yml | 115 ++ ...1_alias_to_multiple_indices_with_types.yml | 42 + .../test/mget/22_ids_with_types.yml | 72 + .../test/mget/23_stored_fields_with_types.yml | 120 ++ .../rest-api-spec/test/mget/40_routing.yml | 45 + .../test/mget/41_routing_with_types.yml | 44 + .../test/mget/60_realtime_refresh.yml | 52 + .../mget/61_realtime_refresh_with_types.yml | 53 + .../test/mget/70_source_filtering.yml | 121 ++ .../mget/71_source_filtering_with_types.yml | 119 ++ .../rest-api-spec/test/mget/80_deprecated.yml | 35 + .../test/mget/80_deprecated_with_types.yml | 38 + .../rest-api-spec/test/mget/TODO.txt | 3 + .../rest-api-spec/test/mlt/10_basic.yml | 42 + .../rest-api-spec/test/mlt/20_docs.yml | 57 + .../rest-api-spec/test/mlt/30_unlike.yml | 53 + .../rest-api-spec/test/msearch/10_basic.yml | 152 ++ .../rest-api-spec/test/msearch/11_status.yml | 20 + .../test/msearch/12_basic_with_types.yml | 97 ++ .../test/msearch/20_typed_keys.yml | 112 ++ .../test/mtermvectors/10_basic.yml | 57 + .../test/mtermvectors/11_basic_with_types.yml | 86 ++ .../test/mtermvectors/20_deprecated.yml | 53 + .../mtermvectors/21_deprecated_with_types.yml | 53 + .../mtermvectors/30_mix_typeless_typeful.yml | 33 + .../test/nodes.info/10_basic.yml | 13 + .../test/nodes.info/20_transport.yml | 16 + .../test/nodes.info/30_settings.yml | 22 + .../nodes.reload_secure_settings/10_basic.yml | 8 + .../test/nodes.stats/10_basic.yml | 36 + .../test/nodes.stats/11_indices_metrics.yml | 227 +++ .../nodes.stats/20_response_filtering.yml | 202 +++ .../test/nodes.stats/30_discovery.yml | 42 + .../rest-api-spec/test/ping/10_ping.yml | 5 + .../rest-api-spec/test/range/10_basic.yml | 449 ++++++ .../test/scripts/20_get_script_context.yml | 10 + .../test/scripts/25_get_script_languages.yml | 9 + .../rest-api-spec/test/scroll/10_basic.yml | 345 +++++ .../rest-api-spec/test/scroll/11_clear.yml | 121 ++ .../rest-api-spec/test/scroll/12_slices.yml | 147 ++ .../test/scroll/20_keep_alive.yml | 71 + .../search.aggregation/100_avg_metric.yml | 177 +++ .../test/search.aggregation/10_histogram.yml | 492 ++++++ .../search.aggregation/110_max_metric.yml | 177 +++ .../search.aggregation/120_min_metric.yml | 177 +++ .../search.aggregation/130_sum_metric.yml | 177 +++ .../140_value_count_metric.yml | 176 +++ .../search.aggregation/150_stats_metric.yml | 195 +++ .../160_extended_stats_metric.yml | 295 ++++ .../170_cardinality_metric.yml | 214 +++ .../180_percentiles_tdigest_metric.yml | 371 +++++ .../190_percentiles_hdr_metric.yml | 450 ++++++ .../200_top_hits_metric.yml | 111 ++ .../test/search.aggregation/20_terms.yml | 771 ++++++++++ .../search.aggregation/220_filters_bucket.yml | 274 ++++ .../test/search.aggregation/230_composite.yml | 1032 +++++++++++++ .../search.aggregation/240_max_buckets.yml | 121 ++ .../test/search.aggregation/250_moving_fn.yml | 82 + .../search.aggregation/260_weighted_avg.yml | 69 + .../270_median_absolute_deviation_metric.yml | 145 ++ .../search.aggregation/280_geohash_grid.yml | 62 + .../search.aggregation/280_rare_terms.yml | 362 +++++ .../search.aggregation/290_geotile_grid.yml | 65 + .../test/search.aggregation/300_pipeline.yml | 100 ++ .../test/search.aggregation/30_sig_terms.yml | 154 ++ .../310_date_agg_per_day_of_week.yml | 44 + .../test/search.aggregation/40_range.yml | 337 +++++ .../test/search.aggregation/50_filter.yml | 156 ++ .../51_filter_with_types.yml | 60 + .../70_adjacency_matrix.yml | 58 + .../test/search.aggregation/80_typed_keys.yml | 237 +++ .../test/search.aggregation/90_sig_text.yml | 151 ++ .../test/search.highlight/10_unified.yml | 35 + .../test/search.highlight/20_fvh.yml | 45 + .../30_max_analyzed_offset.yml | 81 + .../search.highlight/40_keyword_ignore.yml | 64 + .../test/search.inner_hits/10_basic.yml | 94 ++ .../test/search/100_stored_fields.yml | 44 + .../test/search/10_source_filtering.yml | 201 +++ .../test/search/110_field_collapsing.yml | 469 ++++++ .../search/115_multiple_field_collapsing.yml | 144 ++ .../test/search/120_batch_reduce_size.yml | 60 + .../search/140_pre_filter_search_shards.yml | 157 ++ .../search/150_rewrite_on_coordinator.yml | 78 + .../test/search/160_exists_query.yml | 1336 +++++++++++++++++ .../test/search/170_terms_query.yml | 58 + .../search/171_terms_query_with_types.yml | 63 + .../search/180_locale_dependent_mapping.yml | 41 + .../test/search/190_index_prefix_search.yml | 104 ++ .../test/search/200_ignore_malformed.yml | 93 ++ .../test/search/200_index_phrase_search.yml | 67 + .../test/search/20_default_values.yml | 89 ++ .../test/search/210_rescore_explain.yml | 41 + .../test/search/220_total_hits_object.yml | 176 +++ .../test/search/230_interval_query.yml | 450 ++++++ .../test/search/240_date_nanos.yml | 164 ++ .../test/search/250_distance_feature.yml | 87 ++ .../test/search/300_sequence_numbers.yml | 64 + .../rest-api-spec/test/search/30_limits.yml | 150 ++ .../test/search/310_match_bool_prefix.yml | 363 +++++ .../test/search/320_disallow_queries.yml | 147 ++ .../test/search/330_distributed_sort.yml | 130 ++ .../test/search/40_indices_boost.yml | 187 +++ .../test/search/60_query_string.yml | 63 + .../test/search/70_response_filtering.yml | 153 ++ .../test/search/80_indices_options.yml | 71 + .../test/search/90_search_after.yml | 99 ++ .../rest-api-spec/test/search/issue4895.yml | 33 + .../rest-api-spec/test/search/issue9606.yml | 43 + .../test/search_shards/10_basic.yml | 101 ++ .../test/snapshot.create/10_basic.yml | 119 ++ .../test/snapshot.get/10_basic.yml | 193 +++ .../test/snapshot.get_repository/10_basic.yml | 65 + .../test/snapshot.restore/10_basic.yml | 59 + .../test/snapshot.status/10_basic.yml | 62 + .../rest-api-spec/test/suggest/10_basic.yml | 25 + .../test/suggest/20_completion.yml | 329 ++++ .../rest-api-spec/test/suggest/30_context.yml | 403 +++++ .../test/suggest/40_typed_keys.yml | 57 + .../50_completion_with_multi_fields.yml | 290 ++++ .../test/tasks.cancel/10_basic.yml | 7 + .../rest-api-spec/test/tasks.get/10_basic.yml | 8 + .../test/tasks.list/10_basic.yml | 38 + .../test/termvectors/10_basic.yml | 36 + .../test/termvectors/11_basic_with_types.yml | 36 + .../test/termvectors/20_issue7121.yml | 44 + .../termvectors/21_issue7121_with_types.yml | 42 + .../test/termvectors/30_realtime.yml | 42 + .../termvectors/31_realtime_with_types.yml | 40 + .../termvectors/50_mix_typeless_typeful.yml | 46 + .../rest-api-spec/test/update/10_doc.yml | 40 + .../test/update/11_shard_header.yml | 41 + .../rest-api-spec/test/update/12_result.yml | 51 + .../test/update/13_legacy_doc.yml | 36 + .../update/14_shard_header_with_types.yml | 39 + .../test/update/15_result_with_types.yml | 52 + .../rest-api-spec/test/update/16_noop.yml | 43 + .../test/update/20_doc_upsert.yml | 40 + .../test/update/21_doc_upsert_with_types.yml | 41 + .../test/update/22_doc_as_upsert.yml | 40 + .../update/24_doc_as_upsert_with_types.yml | 41 + .../test/update/35_if_seq_no.yml | 64 + .../rest-api-spec/test/update/40_routing.yml | 58 + .../test/update/41_routing_with_types.yml | 58 + .../rest-api-spec/test/update/60_refresh.yml | 123 ++ .../test/update/61_refresh_with_types.yml | 115 ++ .../test/update/80_source_filtering.yml | 21 + .../update/81_source_filtering_with_types.yml | 19 + .../test/update/85_fields_meta.yml | 31 + .../test/update/86_fields_meta_with_types.yml | 33 + .../rest-api-spec/test/update/90_error.yml | 13 + .../test/update/90_mix_typeless_typeful.yml | 86 ++ .../rest-api-spec/test/update/TODO.txt | 5 + .../elasticsearch/rest/BaseRestHandler.java | 7 - .../elasticsearch/rest/MethodHandlers.java | 23 +- .../elasticsearch/rest/RestController.java | 21 +- .../org/elasticsearch/rest/RestHandler.java | 5 +- .../admin/indices/RestCreateIndexAction.java | 35 +- .../rest/RestControllerTests.java | 6 +- .../resources/ilm-history-ilm-policy.json | 18 + .../out/production/resources/ilm-history.json | 85 ++ .../resources/logstash-management.json | 50 + .../resources/monitoring-alerts-7.json | 60 + .../resources/monitoring-beats.json | 719 +++++++++ .../production/resources/monitoring-es.json | 1156 ++++++++++++++ .../resources/monitoring-kibana.json | 232 +++ .../resources/monitoring-logstash.json | 412 +++++ .../core/ml/annotations_index_mappings.json | 36 + .../results_index_mappings.json | 478 ++++++ .../results_index_template.json | 20 + .../state_index_template.json | 23 + .../xpack/core/ml/config_index_mappings.json | 371 +++++ .../xpack/core/ml/config_index_template.json | 15 + .../core/ml/inference_index_template.json | 75 + .../xpack/core/ml/meta_index_template.json | 47 + .../core/ml/notifications_index_template.json | 47 + .../xpack/core/ml/size_based_ilm_policy.json | 11 + .../xpack/core/ml/stats_index_mappings.json | 132 ++ .../xpack/core/ml/stats_index_template.json | 17 + .../idp/saml-service-provider-template.json | 99 ++ .../resources/security-index-template-7.json | 289 ++++ .../security-tokens-index-template-7.json | 108 ++ .../resources/slm-history-ilm-policy.json | 18 + .../out/production/resources/slm-history.json | 61 + .../resources/triggered-watches.json | 41 + .../resources/watch-history-10.json | 567 +++++++ .../resources/watch-history-ilm-policy.json | 10 + .../resources/watch-history-no-ilm-10.json | 616 ++++++++ .../resources/watch-history-no-ilm.json | 617 ++++++++ .../production/resources/watch-history.json | 568 +++++++ .../out/production/resources/watches.json | 63 + ...asticsearch.painless.spi.PainlessExtension | 1 + .../xpack/eql/plugin/eql_whitelist.txt | 59 + .../security/rest/SecurityRestFilter.java | 4 +- 612 files changed, 55841 insertions(+), 73 deletions(-) create mode 100644 client/rest-high-level/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider create mode 100644 client/rest-high-level/out/production/resources/forbidden/rest-high-level-signatures.txt create mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/README.asciidoc create mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/openssl_config.cnf create mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.crt create mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.key create mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.crt create mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.key create mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.crt create mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.key create mode 100644 modules/aggs-matrix-stats/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider create mode 100644 modules/parent-join/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider create mode 100644 modules/rank-eval/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider create mode 100644 modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/_common.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/bulk.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.aliases.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.allocation.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.count.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.fielddata.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.health.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.help.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.indices.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.master.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodeattrs.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodes.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.pending_tasks.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.plugins.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.recovery.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.repositories.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.segments.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.shards.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.snapshots.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.tasks.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.templates.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.thread_pool.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/clear_scroll.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.allocation_explain.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.delete_component_template.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_component_template.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_settings.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.health.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.pending_tasks.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_component_template.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_settings.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.remote_info.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.reroute.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.state.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.stats.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/count.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/create.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/delete.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query_rethrottle.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/delete_script.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/exists.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/exists_source.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/explain.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/field_caps.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/get.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/get_script.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/get_script_context.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/get_script_languages.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/get_source.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/index.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.analyze.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.clear_cache.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.clone.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.close.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.create.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.create_data_stream.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_alias.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_data_stream.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_template.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_alias.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_template.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_type.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush_synced.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.forcemerge.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_alias.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_data_streams.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_field_mapping.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_mapping.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_settings.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_template.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_upgrade.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.open.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_alias.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_mapping.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_settings.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_template.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.recovery.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.refresh.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.rollover.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.segments.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.shard_stores.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.shrink.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.split.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.stats.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.update_aliases.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.upgrade.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.validate_query.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/info.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/ingest.delete_pipeline.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/ingest.get_pipeline.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/ingest.processor_grok.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/ingest.put_pipeline.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/ingest.simulate.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/mget.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/msearch.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/msearch_template.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/mtermvectors.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/nodes.hot_threads.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/nodes.info.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/nodes.reload_secure_settings.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/nodes.stats.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/nodes.usage.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/ping.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/put_script.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/rank_eval.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/reindex.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/reindex_rethrottle.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/render_search_template.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/scripts_painless_execute.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/scroll.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/search.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/search_shards.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/search_template.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.cleanup_repository.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create_repository.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete_repository.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get_repository.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.restore.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.status.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.verify_repository.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/tasks.cancel.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/tasks.get.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/tasks.list.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/termvectors.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/update.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query_rethrottle.json create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/README.asciidoc create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/11_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/20_list_of_strings.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/21_list_of_strings_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/30_big_string.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/31_big_string_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/40_source.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/41_source_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/50_refresh.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/51_refresh_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/60_deprecated.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/70_mix_typeless_typeful.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/80_cas.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/81_cas_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/20_headers.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/30_json.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/40_hidden.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.allocation/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.count/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.fielddata/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.health/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/20_hidden.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodeattrs/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodes/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.plugins/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.recovery/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.repositories/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.segments/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.shards/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.snapshots/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.tasks/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.templates/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.thread_pool/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.allocation_explain/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.component_template/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/20_request_timeout.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/30_indices_options.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.pending_tasks/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.put_settings/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.remote_info/10_info.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/11_explain.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/20_response_filtering.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/20_filtering.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/30_expand_wildcards.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.stats/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/count/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/count/11_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/count/20_query_string.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/10_with_id.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/11_with_id_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/35_external_version.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/36_external_version_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/40_routing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/41_routing_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/60_refresh.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/61_refresh_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/70_nested.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/71_nested_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/TODO.txt create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/11_shard_header.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/12_result.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/13_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/14_shard_header_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/15_result_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/20_cas.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/21_cas_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/25_external_version.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/26_external_gte_version.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/27_external_version_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/28_external_gte_version_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/30_routing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/31_routing_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/50_refresh.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/51_refresh_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/60_missing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/61_missing_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/70_mix_typeless_typeful.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/TODO.txt create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/11_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/40_routing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/41_routing_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/60_realtime_refresh.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/61_realtime_refresh_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/70_defaults.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/71_defaults_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/TODO.txt create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/11_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/20_source_filtering.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/21_source_filtering_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/30_query_string.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/31_query_string_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/40_mix_typeless_typeful.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/TODO.txt create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/20_meta.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/100_mix_typeless_typeful.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/11_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/15_default_values.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/16_default_values_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/20_stored_fields.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/21_stored_fields_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/40_routing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/41_routing_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/50_with_headers.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/51_with_headers_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/60_realtime_refresh.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/61_realtime_refresh_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/70_source_filtering.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/71_source_filtering_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/80_missing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/81_missing_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/90_versions.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/91_versions_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/TODO.txt create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/11_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/15_default_values.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/16_default_values_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/40_routing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/41_routing_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/60_realtime_refresh.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/61_realtime_refresh_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/70_source_filtering.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/71_source_filtering_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/80_missing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/81_missing_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/85_source_missing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/86_source_missing_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/TODO.txt create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/10_with_id.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/11_with_id_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/12_result.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/13_result_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/15_without_id.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/16_without_id_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/20_optype.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/21_optype_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/30_cas.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/35_external_version.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/36_external_gte_version.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/37_external_version_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/38_external_gte_version_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/40_routing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/41_routing_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/60_refresh.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/61_refresh_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/70_mix_typeless_typeful.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/TODO.txt create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/10_analyze.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/20_analyze_limit.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.clear_cache/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/11_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/20_mix_typeless_typeful.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.data_stream/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/20_read_only_index.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_alias/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_template/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.flush/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.forcemerge/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/11_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/20_empty.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/30_wildcards.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/11_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/20_missing_field.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/21_missing_field_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/30_missing_type.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/40_missing_index.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/50_field_wildcards.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/51_field_wildcards_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/60_mix_typeless_typeful.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/11_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/20_missing_type.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/30_missing_index.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/40_aliases.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/50_wildcard_expansion.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/60_empty.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/61_empty_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/70_mix_typeless_typeful.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/20_aliases.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/11_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/20_get_missing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/20_multiple_indices.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/11_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/20_mix_typeless_typeful.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/11_reset.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/all_path_options.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/11_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.recovery/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.refresh/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/30_max_size_condition.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/40_mapping.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/41_mapping_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.segments/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.shard_stores/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.sort/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/20_source_mapping.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/30_copy_settings.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/10_index.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/11_metric.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/12_level.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/13_fields.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/14_groups.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/15_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/20_translog.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/30_segments.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/40_updates_on_refresh.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/20_routing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/30_remove_index_and_replace_with_alias.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.upgrade/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/20_query_string.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/info/10_info.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/info/20_lucene_version.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/ingest/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/11_default_index_type.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/12_non_existent_index.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/13_missing_metadata.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/14_alias_to_multiple_indices.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/15_ids.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/16_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/17_default_index.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/18_non_existent_index_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/19_missing_metadata_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/20_stored_fields.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/21_alias_to_multiple_indices_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/22_ids_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/23_stored_fields_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/40_routing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/41_routing_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/60_realtime_refresh.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/61_realtime_refresh_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/70_source_filtering.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/71_source_filtering_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/TODO.txt create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mlt/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mlt/20_docs.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mlt/30_unlike.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/msearch/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/msearch/11_status.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/msearch/12_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/msearch/20_typed_keys.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/11_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/20_deprecated.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/21_deprecated_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/30_mix_typeless_typeful.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/20_transport.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/30_settings.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.reload_secure_settings/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/20_response_filtering.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/30_discovery.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/ping/10_ping.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/range/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/scripts/20_get_script_context.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/scripts/25_get_script_languages.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/scroll/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/scroll/11_clear.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/scroll/12_slices.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/scroll/20_keep_alive.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/100_avg_metric.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/10_histogram.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/110_max_metric.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/120_min_metric.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/130_sum_metric.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/140_value_count_metric.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/150_stats_metric.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/160_extended_stats_metric.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/170_cardinality_metric.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/180_percentiles_tdigest_metric.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/190_percentiles_hdr_metric.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/200_top_hits_metric.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/20_terms.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/220_filters_bucket.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/230_composite.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/250_moving_fn.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/260_weighted_avg.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/270_median_absolute_deviation_metric.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_geohash_grid.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_rare_terms.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/290_geotile_grid.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/300_pipeline.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/30_sig_terms.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/310_date_agg_per_day_of_week.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/40_range.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/50_filter.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/51_filter_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/70_adjacency_matrix.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/80_typed_keys.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/90_sig_text.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/10_unified.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/20_fvh.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/30_max_analyzed_offset.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/40_keyword_ignore.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.inner_hits/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/100_stored_fields.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/10_source_filtering.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/110_field_collapsing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/115_multiple_field_collapsing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/120_batch_reduce_size.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/140_pre_filter_search_shards.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/150_rewrite_on_coordinator.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/160_exists_query.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/170_terms_query.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/171_terms_query_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/190_index_prefix_search.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/200_ignore_malformed.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/200_index_phrase_search.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/20_default_values.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/210_rescore_explain.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/220_total_hits_object.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/230_interval_query.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/240_date_nanos.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/250_distance_feature.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/300_sequence_numbers.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/30_limits.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/310_match_bool_prefix.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/320_disallow_queries.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/330_distributed_sort.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/40_indices_boost.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/60_query_string.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/70_response_filtering.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/80_indices_options.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/90_search_after.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/issue4895.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/issue9606.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search_shards/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.create/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get_repository/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.restore/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.status/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/suggest/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/suggest/20_completion.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/suggest/30_context.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/suggest/40_typed_keys.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/suggest/50_completion_with_multi_fields.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/tasks.cancel/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/tasks.get/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/tasks.list/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/10_basic.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/11_basic_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/20_issue7121.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/21_issue7121_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/30_realtime.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/31_realtime_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/50_mix_typeless_typeful.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/10_doc.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/11_shard_header.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/12_result.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/13_legacy_doc.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/14_shard_header_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/15_result_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/16_noop.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/20_doc_upsert.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/21_doc_upsert_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/22_doc_as_upsert.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/24_doc_as_upsert_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/35_if_seq_no.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/40_routing.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/41_routing_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/60_refresh.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/61_refresh_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/80_source_filtering.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/81_source_filtering_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/85_fields_meta.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/86_fields_meta_with_types.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/90_error.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/90_mix_typeless_typeful.yml create mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/TODO.txt create mode 100644 x-pack/plugin/core/out/production/resources/ilm-history-ilm-policy.json create mode 100644 x-pack/plugin/core/out/production/resources/ilm-history.json create mode 100644 x-pack/plugin/core/out/production/resources/logstash-management.json create mode 100644 x-pack/plugin/core/out/production/resources/monitoring-alerts-7.json create mode 100644 x-pack/plugin/core/out/production/resources/monitoring-beats.json create mode 100644 x-pack/plugin/core/out/production/resources/monitoring-es.json create mode 100644 x-pack/plugin/core/out/production/resources/monitoring-kibana.json create mode 100644 x-pack/plugin/core/out/production/resources/monitoring-logstash.json create mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/annotations_index_mappings.json create mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_mappings.json create mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_template.json create mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/state_index_template.json create mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_mappings.json create mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_template.json create mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/inference_index_template.json create mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/meta_index_template.json create mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/notifications_index_template.json create mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/size_based_ilm_policy.json create mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_mappings.json create mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_template.json create mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/idp/saml-service-provider-template.json create mode 100644 x-pack/plugin/core/out/production/resources/security-index-template-7.json create mode 100644 x-pack/plugin/core/out/production/resources/security-tokens-index-template-7.json create mode 100644 x-pack/plugin/core/out/production/resources/slm-history-ilm-policy.json create mode 100644 x-pack/plugin/core/out/production/resources/slm-history.json create mode 100644 x-pack/plugin/core/out/production/resources/triggered-watches.json create mode 100644 x-pack/plugin/core/out/production/resources/watch-history-10.json create mode 100644 x-pack/plugin/core/out/production/resources/watch-history-ilm-policy.json create mode 100644 x-pack/plugin/core/out/production/resources/watch-history-no-ilm-10.json create mode 100644 x-pack/plugin/core/out/production/resources/watch-history-no-ilm.json create mode 100644 x-pack/plugin/core/out/production/resources/watch-history.json create mode 100644 x-pack/plugin/core/out/production/resources/watches.json create mode 100644 x-pack/plugin/eql/out/production/resources/META-INF/services/org.elasticsearch.painless.spi.PainlessExtension create mode 100644 x-pack/plugin/eql/out/production/resources/org/elasticsearch/xpack/eql/plugin/eql_whitelist.txt diff --git a/client/rest-high-level/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider b/client/rest-high-level/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider new file mode 100644 index 0000000000000..45d9e3da90817 --- /dev/null +++ b/client/rest-high-level/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider @@ -0,0 +1,6 @@ +org.elasticsearch.client.indexlifecycle.IndexLifecycleNamedXContentProvider +org.elasticsearch.client.ml.dataframe.MlDataFrameAnalysisNamedXContentProvider +org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider +org.elasticsearch.client.ml.dataframe.stats.AnalysisStatsNamedXContentProvider +org.elasticsearch.client.ml.inference.MlInferenceNamedXContentProvider +org.elasticsearch.client.transform.TransformNamedXContentProvider diff --git a/client/rest-high-level/out/production/resources/forbidden/rest-high-level-signatures.txt b/client/rest-high-level/out/production/resources/forbidden/rest-high-level-signatures.txt new file mode 100644 index 0000000000000..b9224ffe64971 --- /dev/null +++ b/client/rest-high-level/out/production/resources/forbidden/rest-high-level-signatures.txt @@ -0,0 +1,36 @@ +# Licensed to Elasticsearch under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on +# an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +@defaultMessage Use Request#createContentType(XContentType) to be sure to pass the right MIME type +org.apache.http.entity.ContentType#create(java.lang.String) +org.apache.http.entity.ContentType#create(java.lang.String,java.lang.String) +org.apache.http.entity.ContentType#create(java.lang.String,java.nio.charset.Charset) +org.apache.http.entity.ContentType#create(java.lang.String,org.apache.http.NameValuePair[]) + +@defaultMessage ES's logging infrastructure uses log4j2 which we don't want to force on high level rest client users +org.elasticsearch.common.logging.DeprecationLogger +org.elasticsearch.common.logging.LogConfigurator +org.elasticsearch.common.logging.LoggerMessageFormat +org.elasticsearch.common.logging.Loggers +org.elasticsearch.common.logging.NodeNamePatternConverter +org.elasticsearch.common.logging.PrefixLogger + +@defaultMessage We can't rely on log4j2 being on the classpath so don't log deprecations! +org.elasticsearch.common.xcontent.LoggingDeprecationHandler + +@defaultMessage Use Nonblocking org.apache.http.nio.entity.NByteArrayEntity +org.apache.http.entity.ByteArrayEntity +org.apache.http.entity.StringEntity diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/README.asciidoc b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/README.asciidoc new file mode 100644 index 0000000000000..3230bdde7e2ce --- /dev/null +++ b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/README.asciidoc @@ -0,0 +1,35 @@ += Certificate Chain details +This document details the steps used to create the certificate chain in this directory. +The chain has a length of 3: the Root CA, the Intermediate CA and the Client Certificate. +All openssl commands use the same configuration file, albeit different sections of it. +The OpenSSL Configuration file is located in this directory as `openssl_config.cnf`. + +== Instructions on generating self-signed Root CA +The self-signed Root CA, 'testRootCA.crt', and its associated private key in this directory +have been generated using the following openssl commands. + +[source,shell] +----------------------------------------------------------------------------------------------------------- +openssl genrsa -out testRootCA.key 2048 +openssl req -x509 -new -key testRootCA.key -days 1460 -subj "/CN=Elasticsearch Test Root CA/OU=elasticsearch/O=org" -out testRootCA.crt -config ./openssl_config.cnf +----------------------------------------------------------------------------------------------------------- + +== Instructions on generating the Intermediate CA +The `testIntermediateCA.crt` CA certificate is "issued" by the `testRootCA.crt`. + +[source,shell] +----------------------------------------------------------------------------------------------------------- +openssl genrsa -out testIntermediateCA.key 2048 +openssl req -new -key testIntermediateCA.key -subj "/CN=Elasticsearch Test Intermediate CA/OU=Elasticsearch/O=org" -out testIntermediateCA.csr -config ./openssl_config.cnf +openssl x509 -req -in testIntermediateCA.csr -CA testRootCA.crt -CAkey testRootCA.key -CAcreateserial -out testIntermediateCA.crt -days 1460 -sha256 -extensions v3_ca -extfile ./openssl_config.cnf +----------------------------------------------------------------------------------------------------------- + +== Instructions on generating the Client Certificate +The `testClient.crt` end entity certificate is "issued" by the `testIntermediateCA.crt`. + +[source,shell] +----------------------------------------------------------------------------------------------------------- +openssl genrsa -out testClient.key 2048 +openssl req -new -key testClient.key -subj "/CN=Elasticsearch Test Client/OU=Elasticsearch/O=org" -out testClient.csr -config ./openssl_config.cnf +openssl x509 -req -in testClient.csr -CA testIntermediateCA.crt -CAkey testIntermediateCA.key -CAcreateserial -out testClient.crt -days 1460 -sha256 -extensions usr_cert -extfile ./openssl_config.cnf +----------------------------------------------------------------------------------------------------------- diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/openssl_config.cnf b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/openssl_config.cnf new file mode 100644 index 0000000000000..64ff556f35219 --- /dev/null +++ b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/openssl_config.cnf @@ -0,0 +1,185 @@ +#################################################################### +# CA Definition +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +# Per the above, this is where we define CA values +[ CA_default ] + +# By default we use "user certificate" extensions when signing +x509_extensions = usr_cert # The extentions to add to the cert + +# Honor extensions requested of us +copy_extensions = copy + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +#crl_extensions = crl_ext +default_days = 1460 # how long to certify for +default_md = sha256 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_anything + +#################################################################### +# The default policy for the CA when signing requests, requires some +# resemblence to the CA cert +# +[ policy_match ] +countryName = match # Must be the same as the CA +stateOrProvinceName = match # Must be the same as the CA +organizationName = match # Must be the same as the CA +organizationalUnitName = optional # not required +commonName = supplied # must be there, whatever it is +emailAddress = optional # not required + +#################################################################### +# An alternative policy not referred to anywhere in this file. Can +# be used by specifying '-policy policy_anything' to ca(8). +# +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +# This is where we define how to generate CSRs +[ req ] +default_bits = 2048 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name # where to get DN for reqs +attributes = req_attributes # req attributes +x509_extensions = v3_ca # The extentions to add to self signed certs +req_extensions = v3_req # The extensions to add to req's + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + + +#################################################################### +# Per "req" section, this is where we define DN info +[ req_distinguished_name ] + +0.organizationName = Organization Name (company) +0.organizationName_default = org + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = elasticsearch + +commonName = Common Name (hostname, IP, or your name) +commonName_default = Elasticsearch Test Certificate +commonName_max = 64 + +#################################################################### +# We don't want these, but the section must exist +[ req_attributes ] +#challengePassword = A challenge password +#challengePassword_min = 4 +#challengePassword_max = 20 +#unstructuredName = An optional company name + + +#################################################################### +# Extensions for when we sign normal certs (specified as default) +[ usr_cert ] + +# User certs aren't CAs, by definition +basicConstraints=CA:false + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. +# This is OK for an SSL server. +#nsCertType = server +# For an object signing certificate this would be used. +#nsCertType = objsign +# For normal client use this is typical +#nsCertType = client, email +# and for everything including object signing: +#nsCertType = client, email, objsign +# This is typical in keyUsage for a client certificate. +#keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +#subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +#subjectAltName=email:move + + +#################################################################### +# Extension for requests +[ v3_req ] +basicConstraints = CA:FALSE + +# PKIX recommendation. +subjectKeyIdentifier = hash + +subjectAltName = @alt_names + +#################################################################### +# An alternative section of extensions, not referred to anywhere +# else in the config. We'll use this via '-extensions v3_ca' when +# using ca(8) to sign another CA. +# +[ v3_ca ] + +# PKIX recommendation. +subjectKeyIdentifier=hash +authorityKeyIdentifier = keyid,issuer + +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +#subjectAltName=email:move +# Copy issuer details +#issuerAltName=issuer:copy + +subjectAltName = @alt_names + +[ alt_names ] +DNS.1 = localhost +DNS.2 = localhost.localdomain +DNS.3 = localhost4 +DNS.4 = localhost4.localdomain4 +DNS.5 = localhost6 +DNS.6 = localhost6.localdomain6 +IP.1 = 127.0.0.1 +IP.2 = ::1 diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.crt b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.crt new file mode 100644 index 0000000000000..45efce91ef33a --- /dev/null +++ b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDbTCCAlWgAwIBAgIJAIxTS7Qdho9jMA0GCSqGSIb3DQEBCwUAMFMxKzApBgNV +BAMTIkVsYXN0aWNzZWFyY2ggVGVzdCBJbnRlcm1lZGlhdGUgQ0ExFjAUBgNVBAsT +DUVsYXN0aWNzZWFyY2gxDDAKBgNVBAoTA29yZzAeFw0xOTA3MTkxMzMzNDFaFw0y +MzA3MTgxMzMzNDFaMEoxIjAgBgNVBAMTGUVsYXN0aWNzZWFyY2ggVGVzdCBDbGll +bnQxFjAUBgNVBAsTDUVsYXN0aWNzZWFyY2gxDDAKBgNVBAoTA29yZzCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBANHgMX2aX8t0nj4sGLNuKISmmXIYCj9R +wRqS7L03l9Nng7kOKnhHu/nXDt7zMRJyHj+q6FAt5khlavYSVCQyrDybRuA5z31g +OdqXerrjs2OXS5HSHNvoDAnHFsaYX/5geMewVTtc/vqpd7Ph/QtaKfmG2FK0JNQo +0k24tcgCIcyMtBh6BA70yGBM0OT8GdOgd/d/mA7mRhaxIUMNYQzRYRsp4hMnnWoO +TkR5Q8KSO3MKw9dPSpPe8EnwtJE10S3s5aXmgytru/xQqrFycPBNj4KbKVmqMP0G +60CzXik5pr2LNvOFz3Qb6sYJtqeZF+JKgGWdaTC89m63+TEnUHqk0lcCAwEAAaNN +MEswCQYDVR0TBAIwADAdBgNVHQ4EFgQU/+aAD6Q4mFq1vpHorC25/OY5zjcwHwYD +VR0jBBgwFoAU8siFCiMiYZZm/95qFC75AG/LRE0wDQYJKoZIhvcNAQELBQADggEB +AIRpCgDLpvXcgDHUk10uhxev21mlIbU+VP46ANnCuj0UELhTrdTuWvO1PAI4z+Wb +DUxryQfOOXO9R6D0dE5yR56L/J7d+KayW34zU7yRDZM7+rXpocdQ1Ex8mjP9HJ/B +f56YZTBQJpXeDrKow4FvtkI3bcIMkqmbG16LHQXeG3RS4ds4S4wCnE2nA6vIn9y+ +4R999q6y1VSBORrYULcDWxS54plHLEdiMr1vVallg82AGobS9GMcTL2U4Nx5IYZG +7sbTk3LrDxVpVg/S2wLofEdOEwqCeHug/iOihNLJBabEW6z4TDLJAVW5KCY1Dfhk +YlBfHn7vxKkfKoCUK/yLWWI= +-----END CERTIFICATE----- diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.key b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.key new file mode 100644 index 0000000000000..186e6f86745f1 --- /dev/null +++ b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA0eAxfZpfy3SePiwYs24ohKaZchgKP1HBGpLsvTeX02eDuQ4q +eEe7+dcO3vMxEnIeP6roUC3mSGVq9hJUJDKsPJtG4DnPfWA52pd6uuOzY5dLkdIc +2+gMCccWxphf/mB4x7BVO1z++ql3s+H9C1op+YbYUrQk1CjSTbi1yAIhzIy0GHoE +DvTIYEzQ5PwZ06B393+YDuZGFrEhQw1hDNFhGyniEyedag5ORHlDwpI7cwrD109K +k97wSfC0kTXRLezlpeaDK2u7/FCqsXJw8E2PgpspWaow/QbrQLNeKTmmvYs284XP +dBvqxgm2p5kX4kqAZZ1pMLz2brf5MSdQeqTSVwIDAQABAoIBAQDAjP767Ioc4LZZ +9h0HafaUlUDMs4+bPkd7OPcoNnv+AceRHZULW0zz0EIdfGM2OCrWYNfYz/Op0hpK +/s/hkfgBdriU+ZUKwyDxEu8Pzd6EbYdwlqPRgdihk92qgJv5hsro8jeQSibJFHf1 +Ok3tf2BpRTTs08fCOl2P3vowMPyPa5Ho9bf4lzP8IsR2BZvoaev3za9ZWR6ZDzE6 +EWkBBNgIU4aPn1IJ6dz2+rVtN6+xXET0eYSBEac3xMQaPWLEX0EDBYPW1d+mUva/ +3lJvTrs3g8oyiTyVu0l9Yxdgox1mtgmrqqwxJ6XuouzImuXMMDXaz0K/E/+u2yPF +V6kRvWuJAoGBAPOnEgBC3ezl+x+47cgbwpy97uZhZmV9HkMrSH9DKDwC+t57TdGX +ypt2S/IS/vbPupFv0aHaWmJ6SN/HyTN4znwuulV3kE8mEpQzIPbluWfgQzT6ukJe ++YFI/+IXwIRBLA7khtfo01LGHSmLTENsnd/aoRySY3K6zJz36Ys3vFdjAoGBANyC +7rF5YjPdgsAgOT7EboNGkc8UuW/Sh3xRp0c4Y+PBenf60yA5XkRJLYR4sZDjWTr0 +aKBY7Y8r+59U+bBrwUuhhoW08JZ/SBWja05+4DhH0ToA3vtbPv9lRyQfkF1DdBkn +XpyM2vaJE5M454acwnKJ81AyoueYtZ8pD3Q7c219AoGAJ+F1wdMwDgGKvCOB0Boz +HYK9IrpYj04OcQIZqLLuV/xI4befAiptQEr5nVLcprtTl1CNKIfb+Xh4iyBhX2pr +qcngN/MNDNd3fQhtYdwyH72GYpqTeB+hiTbQo0ot+bfNJVbkd1ylkkvZJB6nyfVy +VdysOEgBvRq0OREfCemCi28CgYEAoF1EE6NQDKICTZDhsMkQCb5PmcbbmPwFdh63 +xW64DlGNrCWoVt4BtS12wck4cUM1iE9oq3wgv6df5Z7ZuziSKVt9xk0xTnGgTcQ7 +7KkOjT+FZGZvw2K3bOsNkrK1vW2pyAU+pCE3uGU17DJNBjOIod27Kk649C61ntsw +lvoJVs0CgYBLr9pzBRPyD5/lM9hm2EI7ITa+fVcu3V3bJfXENHKzpb0lB2fhl0PI +swpiU8RUEKWyjBuHsdQdxg7AgFi/7s+SX7KLo4cudDRd73iiXYdNGB7R0/MAG8Jl +/lMXn14noS4trA8fNGGg/2fANTBtLTbOX9i4s7clAo8ETywQ33owug== +-----END RSA PRIVATE KEY----- diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.crt b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.crt new file mode 100644 index 0000000000000..7d8781b888901 --- /dev/null +++ b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.crt @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIIEBTCCAu2gAwIBAgIJAIx9twpbtGkCMA0GCSqGSIb3DQEBCwUAMEsxIzAhBgNV +BAMTGkVsYXN0aWNzZWFyY2ggVGVzdCBSb290IENBMRYwFAYDVQQLEw1lbGFzdGlj +c2VhcmNoMQwwCgYDVQQKEwNvcmcwHhcNMTkwNzE5MTMzMjM0WhcNMjMwNzE4MTMz +MjM0WjBTMSswKQYDVQQDEyJFbGFzdGljc2VhcmNoIFRlc3QgSW50ZXJtZWRpYXRl +IENBMRYwFAYDVQQLEw1FbGFzdGljc2VhcmNoMQwwCgYDVQQKEwNvcmcwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCnJ2KTJZnQzOt0uUf+5oLNcvDLnnWY +LzXZpOOX666Almwx+PVkDxkiGSe0QB9RWJqHSrsP1ryGIeCIzGMOctLt6QA7Peee +HdrKqOQgN620nDSd2EZ3s0Iddh1Ns/lfTtBJCP/03suaktm7j8EYKAyOlTIUhiKm +sTFlxPUSKjbtR4wR1ljnKN8X+j/ghr9mWhQrMR9rsGFObU8DQFho2Ti90C4HoMNU +dy4j+2G3VVpaq4he4/4CbPrWQQ3dKGpzVAngIuAv4eQ/y88EHAFwutxQZWAew4Va +5y3O112acSb9oC7g0NHQcBnos/WIChF5ki8V3LFnxN7jYvUUk9YxfA8hAgMBAAGj +geMwgeAwHQYDVR0OBBYEFPLIhQojImGWZv/eahQu+QBvy0RNMB8GA1UdIwQYMBaA +FM4SyNzpz82ihQ160zrLUVaWfI+1MAwGA1UdEwQFMAMBAf8wgY8GA1UdEQSBhzCB +hIIJbG9jYWxob3N0ghVsb2NhbGhvc3QubG9jYWxkb21haW6CCmxvY2FsaG9zdDSC +F2xvY2FsaG9zdDQubG9jYWxkb21haW40ggpsb2NhbGhvc3Q2ghdsb2NhbGhvc3Q2 +LmxvY2FsZG9tYWluNocEfwAAAYcQAAAAAAAAAAAAAAAAAAAAATANBgkqhkiG9w0B +AQsFAAOCAQEAMkh4nUi2yt5TX+ryBWaaA4/2ZOsxSeec5E1EjemPMUWGzFipV1YY +k/mpv51E+BbPgtmGMG8Win/PETKYuX8D+zPauFEmJmyJmm5B4mr1406RWERqNDql +36sOw89G0mDT/wIB4tkNdh830ml+d75aRVVB4X5pFAE8ZzI3g4OW4YxT3ZfUEhDl +QeGVatobvIaX8KpNSevjFAFuQzSgj61VXI+2+UIRV4tJP2xEqu5ISuArHcGhvNlS +bU3vZ80tTCa0tHyJrVqaqtQ23MDBzYPj6wJ/pvBQWAgZKnC3qJgXlJ9des117I1g +J98AXCDGu5LBW/p2C9VpSktpnfzsX4NHqg== +-----END CERTIFICATE----- diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.key b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.key new file mode 100644 index 0000000000000..5147725f4486a --- /dev/null +++ b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEogIBAAKCAQEApydikyWZ0MzrdLlH/uaCzXLwy551mC812aTjl+uugJZsMfj1 +ZA8ZIhkntEAfUViah0q7D9a8hiHgiMxjDnLS7ekAOz3nnh3ayqjkIDettJw0ndhG +d7NCHXYdTbP5X07QSQj/9N7LmpLZu4/BGCgMjpUyFIYiprExZcT1Eio27UeMEdZY +5yjfF/o/4Ia/ZloUKzEfa7BhTm1PA0BYaNk4vdAuB6DDVHcuI/tht1VaWquIXuP+ +Amz61kEN3Shqc1QJ4CLgL+HkP8vPBBwBcLrcUGVgHsOFWuctztddmnEm/aAu4NDR +0HAZ6LP1iAoReZIvFdyxZ8Te42L1FJPWMXwPIQIDAQABAoIBABp4z1C0dL6vpV5v +9Wn2AaMd3+qvZro6R9H3HiAyMAmnSO1FGz/EcFuJFlOikBMm8BobCLMCdAreFJw1 +mj5wit0ouGOpcyQEYGEWDELZ7oWa825IESjl18OosA1dQlIIvk3Cwh56pk4NkbP1 +mUQFG6/9CthbQeOaTlNqtNEypE5Bc+JGbQaUhRP6tF+Rxnpys2nIJt/Vp9khw0Du +K7Z6astunhfPDwLFGwHhflc6re1B+mxpLKTDHCcydJo2Kuh/LuuEtPkE5Ar4LwQk +D+/61iZHC4B8/4IkBlAsgCJ1B18L6JdTbSYeVlepkSkJML5t6z+cvt5VcObF7F8X +pPZn+kECgYEA2NaB0eshWNnHTMRv+sE92DCv0M7uV1eKtaopxOElAKJ/J2gpqcTh +GzdTVRg1M2LgVNk97ViL5bsXaVStRe085m8oA0bI9WbIoQRUFp40dRFRUjl+4TN0 +pdxXL4VmQMWuwlO6p8/JY8sInnHVCT+2z8lek8P3bdtTQZV9OZQTn0kCgYEAxVe8 +obJdnUSXuRDWg588TW35PNqOTJcerIU6eRKwafvCcrhMoX62Xbv6y6kKXndW/JuW +AbfSNiAOV+HGUbf8Xc54Xzk2mouoJA0S0tJ040jqOkFOaKIxYQudTU8y9bTXNsAk +oX3wOhlt2q9xffAK1gYffP5XPXnYnsb8qaMIeRkCgYBM9yaxOgJmJTbGmtscaEbp +W66sMScMPXhwruuQhFG7/fGgLSrMpaM5I9QiWitYB/qUY1/FxS4y5suSiYnPTjvV +lxLexttBr6/65yxpstHv06vHwby1dqwqyyDvLyxyRTiYpVuVgP18vG5cvw7c746W +BmXZkS9cAQN2Pfdq3pJwcQKBgEbCZd2owg5hCPIPyosZbpro4uRiDYIC8bm0b7n3 +7I+j+R3/XWLOt382pv+dlh03N1aORyRIkDReHCaAywaELRZJsTmbnyudBeYfVe+I +DOduPqYywnWcKo58hqOw0Tnu5Pg5vyi0qo16jrxKCiy5BHmnamT8IbXmWbjc6r28 +uo4JAoGAfAPvPJ2fV5vpzr4LPoVyaSiFj414D+5XYxX6CWpdTryelpP2Rs1VfJ1a +7EusUtWs26pAKwttDY4yoTvog7rrskgtXzisaoNMDbH/PfsoqjMnnIgakvKmHpUM +l6E1ecWFExEg5v6yvmxFC7JIUzIYOoysWu3X44G8rQ+vDQNRFZQ= +-----END RSA PRIVATE KEY----- diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.crt b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.crt new file mode 100644 index 0000000000000..50ba7a21727a6 --- /dev/null +++ b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.crt @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID/TCCAuWgAwIBAgIJAIAPVUXOUQDNMA0GCSqGSIb3DQEBCwUAMEsxIzAhBgNV +BAMTGkVsYXN0aWNzZWFyY2ggVGVzdCBSb290IENBMRYwFAYDVQQLEw1lbGFzdGlj +c2VhcmNoMQwwCgYDVQQKEwNvcmcwHhcNMTkwNzE5MTMzMjIwWhcNMjMwNzE4MTMz +MjIwWjBLMSMwIQYDVQQDExpFbGFzdGljc2VhcmNoIFRlc3QgUm9vdCBDQTEWMBQG +A1UECxMNZWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAzIgn8r2kirt90id0uoi6YEGBPx+XDzthLbLsN+M0 +nXhj40OVcGPiww+cre14bJr0M6MG4CvFjRJc92RoVrE8+7XOKt0bgiHeVM+b0LEh +wVMH9koararPVMo0CjCMN4ChHMOWKBPUNZswvk+pFC+QbTcfgQLycqh+lTB1O6l3 +hPnmunEqhLIj9ke3FwA326igdb+16EbKYVL2c5unNoC5ZMc5Z9bnn4/GNXptkHhy ++SvG7IZKW2pAzei3Df/n47ZhJfQKERUCe9eO7b/ZmTEzAzYj9xucE5lYcpkOZd6g +IMU3vXe4FeD/BM4sOLkKTtMejiElEecxw8cLI9Nji/0y1wIDAQABo4HjMIHgMB0G +A1UdDgQWBBTOEsjc6c/NooUNetM6y1FWlnyPtTAfBgNVHSMEGDAWgBTOEsjc6c/N +ooUNetM6y1FWlnyPtTAMBgNVHRMEBTADAQH/MIGPBgNVHREEgYcwgYSCCWxvY2Fs +aG9zdIIVbG9jYWxob3N0LmxvY2FsZG9tYWluggpsb2NhbGhvc3Q0ghdsb2NhbGhv +c3Q0LmxvY2FsZG9tYWluNIIKbG9jYWxob3N0NoIXbG9jYWxob3N0Ni5sb2NhbGRv +bWFpbjaHBH8AAAGHEAAAAAAAAAAAAAAAAAAAAAEwDQYJKoZIhvcNAQELBQADggEB +ACHjwoDJILv77sQ5QN6SoAp6GYqiC9/doDIzDFCd/WP7G8EbaosHM6jM7NbrlK3g +PNTzuY1pLPoI3YJSO4Al/UfzEffaYSbZC2QZG9F6fUSWhvR+nxzPSXWkjzIInv1j +pPMgnUl6oJaUbsSR/evtvWNSxrM3LewkRTOoktkXM6SjTUHjdP6ikrkrarrWZgzr +K30BqGL6kDSv9LkyXe6RSgQDtQe51Yut+lKGCcy8AoEwG/3cjb7XnrWcFsJXjYbf +4m3QsS8yHU/O/xgyvVHOfki+uGVepzSjdzDMLE1GBkju05NR2eJZ8omj/QiJa0+z +1d/AOKExvWvo1yQ28ORcwo4= +-----END CERTIFICATE----- diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.key b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.key new file mode 100644 index 0000000000000..148bbd52bd76f --- /dev/null +++ b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAzIgn8r2kirt90id0uoi6YEGBPx+XDzthLbLsN+M0nXhj40OV +cGPiww+cre14bJr0M6MG4CvFjRJc92RoVrE8+7XOKt0bgiHeVM+b0LEhwVMH9koa +rarPVMo0CjCMN4ChHMOWKBPUNZswvk+pFC+QbTcfgQLycqh+lTB1O6l3hPnmunEq +hLIj9ke3FwA326igdb+16EbKYVL2c5unNoC5ZMc5Z9bnn4/GNXptkHhy+SvG7IZK +W2pAzei3Df/n47ZhJfQKERUCe9eO7b/ZmTEzAzYj9xucE5lYcpkOZd6gIMU3vXe4 +FeD/BM4sOLkKTtMejiElEecxw8cLI9Nji/0y1wIDAQABAoIBAQC6LMnoPFW1brs1 ++3JWhTTZf2btlYzEcbGgjnhU2v0+xaJu8UrrFhEIq4JcE4gFm/rjsecFUPKu2eND +0eLj3st699+lxsRObRPbMWtMyJ/IQRNDTesA4DV/odtC1zQbJXwCGcrpyjrlXNE+ +unZWiIE32PBVV+BnHBa1KHneCAFiSRLrySAiDAnTIJxB6ufweoxevLoJPPNLlbo7 +H2jv6g1Som/Imjhof4KhD/1Q04Sed2wScSS/7Bz38eO68HG4NMFY+M2/cLzrbflg +QdeKHNhoIGnSFMEW5TCVlI4qrP8zvPPdZmLOMBT+Ocm3pc5xDAPwFYCe8wH1DVn+ +b3sVpwu5AoGBAOhFA7gUDZjRBkNAqJfbUdhdWSslePQsjeTKsu5rc4gk2aiL4bZ4 +fxG0Dq1hX7FjAmYrGqnsXsbxxDnCkhXGH1lY73kF0Zzwr2Pg1yRHyn1nCinhD4g4 +G2vBr37QtWn4wS/L7V//D3xrcCTG3QgAmvZZ99tYgqlmnUzmawdZ8kQ7AoGBAOFt +qg7sTSNWVpKkfkyX2NXvBMt5e3Qcwnge2pX+SBgljwjNUwSSMLwxdBDSyDXIhk8W +s4pJLtMDJsT/2WBKC9WJm9m3gc7yYZznLJ+5YPcieXHGGNXCRldPePhTIjnL591H +CSXoc3BZ2iKK745BYuPqSuLb2XfE3/hwoaFR4S4VAoGAQ6ywG7dECu2ELJ4vQSe2 +3hq8u1SMvGAq66mfntYR8G4EORagqkDLjUXwLNY9Qnr9nPUcLLxhFQgmS0oEtHFo +eujtxU5Lt7Vs9OXy6XA9cHJQRMl9dAwc+TWSw5ld8kV3TEzXmevAAFlxcFW82vMK +M5MdI3zTfTYXyOst7hNoAjcCgYAhz/cgAeWYFU0q9a1UA7qsbAuGEZSo1997cPVM +ZjWeGZQYt+Np3hudPrWwCE2rc4Zhun/3j/6L+/8GsXGDddfMkbVktJet2ME3bZ1N +39phdzRMEnCLL3aphewZIy8RCDqhABSpMPKPuYp0f+5qofgZQ300BdHamxcVBp/X +uJZT+QKBgQDdJQd+QxfCb8BZ11fWtyWJWQWZMmyX2EEbAIMvYQP3xh8PHmw2JoiQ +VQ103bCkegJ1S7ubrGltdt8pyjN4rrByXJmxCe1Y/LSHIp9w8D3jaiLCRSk1EmBw +jXjnZoiJn3GV5jmbV10hzrn7jqRcwhYA5zuoE7qb604V7cPZLzHtog== +-----END RSA PRIVATE KEY----- diff --git a/modules/aggs-matrix-stats/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider b/modules/aggs-matrix-stats/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider new file mode 100644 index 0000000000000..a2d706a39a60c --- /dev/null +++ b/modules/aggs-matrix-stats/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider @@ -0,0 +1 @@ +org.elasticsearch.search.aggregations.matrix.spi.MatrixStatsNamedXContentProvider \ No newline at end of file diff --git a/modules/parent-join/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider b/modules/parent-join/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider new file mode 100644 index 0000000000000..48687c21c3250 --- /dev/null +++ b/modules/parent-join/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider @@ -0,0 +1 @@ +org.elasticsearch.join.spi.ParentJoinNamedXContentProvider \ No newline at end of file diff --git a/modules/rank-eval/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider b/modules/rank-eval/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider new file mode 100644 index 0000000000000..cd505a43679c1 --- /dev/null +++ b/modules/rank-eval/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider @@ -0,0 +1 @@ +org.elasticsearch.index.rankeval.RankEvalNamedXContentProvider \ No newline at end of file diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java index 18b803f41ab4d..3fe0c356a5a34 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java @@ -30,6 +30,7 @@ import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestHandler; +import org.elasticsearch.rest.compat.version7.RestCreateIndexActionV7; import org.elasticsearch.rest.compat.version7.RestGetActionV7; import org.elasticsearch.rest.compat.version7.RestIndexActionV7; @@ -54,7 +55,8 @@ public List getRestHandlers( new RestGetActionV7(), new RestIndexActionV7.CompatibleRestIndexAction(), new RestIndexActionV7.CompatibleCreateHandler(), - new RestIndexActionV7.CompatibleAutoIdHandler(nodesInCluster) + new RestIndexActionV7.CompatibleAutoIdHandler(nodesInCluster), + new RestCreateIndexActionV7() ); } return Collections.emptyList(); diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java new file mode 100644 index 0000000000000..ab866d0cc1e8b --- /dev/null +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java @@ -0,0 +1,125 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.rest.compat.version7; + +import org.elasticsearch.Version; +import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; +import org.elasticsearch.action.support.ActiveShardCount; +import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; +import org.elasticsearch.common.xcontent.XContentHelper; +import org.elasticsearch.index.mapper.MapperService; +import org.elasticsearch.rest.BaseRestHandler; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.RestToXContentListener; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static java.util.Collections.singletonMap; +import static org.elasticsearch.rest.RestRequest.Method.PUT; + +public class RestCreateIndexActionV7 extends BaseRestHandler { + + /** + * Parameter that controls whether certain REST apis should include type names in their requests or responses. + * Note: Support for this parameter will be removed after the transition period to typeless APIs. + */ + public static final String INCLUDE_TYPE_NAME_PARAMETER = "include_type_name"; + public static final boolean DEFAULT_INCLUDE_TYPE_NAME_POLICY = false; + + @Override + public List routes() { + return List.of(new Route(PUT, "/{index}")); + } + + @Override + public String getName() { + return "create_index_action"; + } + + @Override + public String compatibleWithVersion() { + return String.valueOf(Version.V_7_0_0.major); + } + + @Override + public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { + CreateIndexRequest createIndexRequest = new CreateIndexRequest(request.param("index")); + + if (request.hasContent()) { + Map sourceAsMap = XContentHelper.convertToMap(request.requiredContent(), false, + request.getXContentType()).v2(); + + request.param(INCLUDE_TYPE_NAME_PARAMETER);//just consume, it is not replaced with _doc + sourceAsMap = prepareMappingsV7(sourceAsMap, request); + + createIndexRequest.source(sourceAsMap, LoggingDeprecationHandler.INSTANCE); + } + + createIndexRequest.timeout(request.paramAsTime("timeout", createIndexRequest.timeout())); + createIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", createIndexRequest.masterNodeTimeout())); + createIndexRequest.waitForActiveShards(ActiveShardCount.parseString(request.param("wait_for_active_shards"))); + return channel -> client.admin().indices().create(createIndexRequest, new RestToXContentListener<>(channel)); + } + + static Map prepareMappingsV7(Map source, RestRequest request) { + final boolean includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, + DEFAULT_INCLUDE_TYPE_NAME_POLICY); + + @SuppressWarnings("unchecked") + Map mappings = (Map) source.get("mappings"); + + if (includeTypeName && mappings.size() == 1) { + //no matter what the type was, replace it with _doc + Map newSource = new HashMap<>(); + + String typeName = mappings.keySet().iterator().next(); + @SuppressWarnings("unchecked") + Map typedMappings = (Map) mappings.get(typeName); + + newSource.put("mappings", Collections.singletonMap(MapperService.SINGLE_MAPPING_NAME, typedMappings)); + return newSource; + }else{ + return prepareMappings(source); + } + } + + static Map prepareMappings(Map source) { + if (source.containsKey("mappings") == false + || (source.get("mappings") instanceof Map) == false) { + return source; + } + + Map newSource = new HashMap<>(source); + + @SuppressWarnings("unchecked") + Map mappings = (Map) source.get("mappings"); + if (MapperService.isMappingSourceTyped(MapperService.SINGLE_MAPPING_NAME, mappings)) { + throw new IllegalArgumentException("The mapping definition cannot be nested under a type"); + } + + newSource.put("mappings", singletonMap(MapperService.SINGLE_MAPPING_NAME, mappings)); + return newSource; + } +} diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestGetActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestGetActionV7.java index e9ac04ef4afbd..d779ff96ef9b2 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestGetActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestGetActionV7.java @@ -53,7 +53,7 @@ public RestChannelConsumer prepareRequest(RestRequest request, final NodeClient } @Override - public boolean compatibilityRequired() { - return true; + public String compatibleWithVersion() { + return String.valueOf(Version.V_7_0_0.major); } } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7.java index 1ce13121a4441..51d2e3db47e79 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7.java @@ -63,8 +63,8 @@ public RestChannelConsumer prepareRequest(RestRequest request, final NodeClient } @Override - public boolean compatibilityRequired() { - return true; + public String compatibleWithVersion() { + return String.valueOf(Version.V_7_0_0.major); } } @@ -84,8 +84,8 @@ public RestChannelConsumer prepareRequest(RestRequest request, final NodeClient } @Override - public boolean compatibilityRequired() { - return true; + public String compatibleWithVersion() { + return String.valueOf(Version.V_7_0_0.major); } } @@ -108,8 +108,8 @@ public RestChannelConsumer prepareRequest(RestRequest request, final NodeClient } @Override - public boolean compatibilityRequired() { - return true; + public String compatibleWithVersion() { + return String.valueOf(Version.V_7_0_0.major); } } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/_common.json b/rest-api-spec/out/production/resources/rest-api-spec/api/_common.json new file mode 100644 index 0000000000000..1505db774f0d1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/_common.json @@ -0,0 +1,31 @@ +{ + "documentation" : { + "description": "Parameters that are accepted by all API endpoints.", + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html" + }, + "params": { + "pretty": { + "type": "boolean", + "description": "Pretty format the returned JSON response.", + "default": false + }, + "human": { + "type": "boolean", + "description": "Return human readable values for statistics.", + "default": true + }, + "error_trace": { + "type": "boolean", + "description": "Include the stack trace of returned errors.", + "default": false + }, + "source": { + "type": "string", + "description": "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests." + }, + "filter_path": { + "type": "list", + "description": "A comma-separated list of filters used to reduce the response." + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/bulk.json b/rest-api-spec/out/production/resources/rest-api-spec/api/bulk.json new file mode 100644 index 0000000000000..085ff88d0c135 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/bulk.json @@ -0,0 +1,98 @@ +{ + "bulk":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html", + "description":"Allows to perform multiple index/update/delete operations in a single request." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_bulk", + "methods":[ + "POST", + "PUT" + ] + }, + { + "path":"/{index}/_bulk", + "methods":[ + "POST", + "PUT" + ], + "parts":{ + "index":{ + "type":"string", + "description":"Default index for items which don't provide one" + } + } + }, + { + "path":"/{index}/{type}/_bulk", + "methods":[ + "POST", + "PUT" + ], + "parts":{ + "index":{ + "type":"string", + "description":"Default index for items which don't provide one" + }, + "type":{ + "type":"string", + "description":"Default document type for items which don't provide one" + } + } + } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "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", + "description":"Specific routing value" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "type":{ + "type":"string", + "description":"Default document type for items which don't provide one" + }, + "_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_excludes":{ + "type":"list", + "description":"Default list of fields to exclude from the returned _source field, can be overridden on each sub-request" + }, + "_source_includes":{ + "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", + "description":"The pipeline id to preprocess incoming documents with" + } + }, + "body":{ + "description":"The operation definition and data (action-data pairs), separated by newlines", + "required":true, + "serialize":"bulk" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.aliases.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.aliases.json new file mode 100644 index 0000000000000..6ee594b099c43 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.aliases.json @@ -0,0 +1,71 @@ +{ + "cat.aliases":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html", + "description":"Shows information about currently configured aliases to indices including filter and routing infos." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/aliases", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/aliases/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"A comma-separated list of alias names to return" + } + } + } + ] + }, + "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)" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default": ["all"], + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.allocation.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.allocation.json new file mode 100644 index 0000000000000..7b3dc70b03c38 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.allocation.json @@ -0,0 +1,80 @@ +{ + "cat.allocation":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html", + "description":"Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/allocation", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/allocation/{node_id}", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "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 + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.count.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.count.json new file mode 100644 index 0000000000000..8cfaddf8db83b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.count.json @@ -0,0 +1,55 @@ +{ + "cat.count":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html", + "description":"Provides quick access to the document count of the entire cluster, or individual indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/count", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/count/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to limit the returned information" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.fielddata.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.fielddata.json new file mode 100644 index 0000000000000..9fbde4736b5ef --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.fielddata.json @@ -0,0 +1,76 @@ +{ + "cat.fielddata":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html", + "description":"Shows how much heap memory is currently being used by fielddata on every data node in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/fielddata", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/fielddata/{fields}", + "methods":[ + "GET" + ], + "parts":{ + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to return the fielddata size" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to return in the output" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.health.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.health.json new file mode 100644 index 0000000000000..7e79b7cc2c977 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.health.json @@ -0,0 +1,61 @@ +{ + "cat.health":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html", + "description":"Returns a concise representation of the cluster health." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/health", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d (Days)", + "h (Hours)", + "m (Minutes)", + "s (Seconds)", + "ms (Milliseconds)", + "micros (Microseconds)", + "nanos (Nanoseconds)" + ] + }, + "ts":{ + "type":"boolean", + "description":"Set to false to disable timestamping", + "default":true + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.help.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.help.json new file mode 100644 index 0000000000000..54ab6d6e5168c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.help.json @@ -0,0 +1,30 @@ +{ + "cat.help":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html", + "description":"Returns help for the Cat APIs." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.indices.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.indices.json new file mode 100644 index 0000000000000..d4a7eb3b051d2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.indices.json @@ -0,0 +1,125 @@ +{ + "cat.indices":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html", + "description":"Returns information about indices: number of primaries and replicas, document counts, disk size, ..." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/indices", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/indices/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to limit the returned information" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "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" + }, + "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", + "default":false + }, + "pri":{ + "type":"boolean", + "description":"Set to true to return stats only for primary shards", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + }, + "include_unloaded_segments":{ + "type":"boolean", + "description":"If set to true segment stats will include stats for segments that are not currently loaded into memory", + "default":false + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default": "all", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.master.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.master.json new file mode 100644 index 0000000000000..63fe159ee56b8 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.master.json @@ -0,0 +1,51 @@ +{ + "cat.master":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html", + "description":"Returns information about the master node." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/master", + "methods":[ + "GET" + ] + } + ] + }, + "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 + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodeattrs.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodeattrs.json new file mode 100644 index 0000000000000..e688e23cab089 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodeattrs.json @@ -0,0 +1,51 @@ +{ + "cat.nodeattrs":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html", + "description":"Returns information about custom node attributes." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/nodeattrs", + "methods":[ + "GET" + ] + } + ] + }, + "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 + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodes.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodes.json new file mode 100644 index 0000000000000..ba3faa92c5ec6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodes.json @@ -0,0 +1,89 @@ +{ + "cat.nodes":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html", + "description":"Returns basic statistics about performance of cluster nodes." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/nodes", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "full_id":{ + "type":"boolean", + "description":"Return the full node ID instead of the shortened version (default: false)" + }, + "local":{ + "type":"boolean", + "description":"Calculate the selected nodes using the local cluster state rather than the state from master node (default: false)", + "deprecated":{ + "version":"7.6.0", + "description":"This parameter does not cause this API to act locally." + } + }, + "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 + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.pending_tasks.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.pending_tasks.json new file mode 100644 index 0000000000000..36fa33be495cd --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.pending_tasks.json @@ -0,0 +1,64 @@ +{ + "cat.pending_tasks":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html", + "description":"Returns a concise representation of the cluster pending tasks." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/pending_tasks", + "methods":[ + "GET" + ] + } + ] + }, + "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 + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.plugins.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.plugins.json new file mode 100644 index 0000000000000..d5346c6d9e7b4 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.plugins.json @@ -0,0 +1,51 @@ +{ + "cat.plugins":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html", + "description":"Returns information about installed plugins across nodes node." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/plugins", + "methods":[ + "GET" + ] + } + ] + }, + "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 + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.recovery.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.recovery.json new file mode 100644 index 0000000000000..7baf0b8ded609 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.recovery.json @@ -0,0 +1,99 @@ +{ + "cat.recovery":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html", + "description":"Returns information about index shard recoveries, both on-going completed." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/recovery", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/recovery/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"Comma-separated list or wildcard expression of index names to limit the returned information" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "active_only":{ + "type":"boolean", + "description":"If `true`, the response only includes ongoing shard recoveries", + "default":false + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "detailed":{ + "type":"boolean", + "description":"If `true`, the response includes detailed information about shard recoveries", + "default":false + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "index":{ + "type":"list", + "description":"Comma-separated list or wildcard expression of index names to limit the returned information" + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.repositories.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.repositories.json new file mode 100644 index 0000000000000..84d9965907ff3 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.repositories.json @@ -0,0 +1,52 @@ +{ + "cat.repositories":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html", + "description":"Returns information about snapshot repositories registered in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/repositories", + "methods":[ + "GET" + ] + } + ] + }, + "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 + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.segments.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.segments.json new file mode 100644 index 0000000000000..472ef7fd22eee --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.segments.json @@ -0,0 +1,72 @@ +{ + "cat.segments":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html", + "description":"Provides low-level information about the segments in the shards of an index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/segments", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/segments/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to limit the returned information" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.shards.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.shards.json new file mode 100644 index 0000000000000..a13c0f6bf6d4a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.shards.json @@ -0,0 +1,93 @@ +{ + "cat.shards":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html", + "description":"Provides a detailed view of shard allocation on nodes." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/shards", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/shards/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to limit the returned information" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "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 + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.snapshots.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.snapshots.json new file mode 100644 index 0000000000000..757c2cfbe7dc6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.snapshots.json @@ -0,0 +1,77 @@ +{ + "cat.snapshots":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html", + "description":"Returns all snapshots in a specific repository." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/snapshots", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/snapshots/{repository}", + "methods":[ + "GET" + ], + "parts":{ + "repository":{ + "type":"list", + "description":"Name of repository from which to fetch the snapshot information" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Set to true to ignore unavailable snapshots", + "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 + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.tasks.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.tasks.json new file mode 100644 index 0000000000000..ae25ab10c0138 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.tasks.json @@ -0,0 +1,72 @@ +{ + "cat.tasks":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", + "description":"Returns information about the tasks currently executing on one or more nodes in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/tasks", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + }, + "actions":{ + "type":"list", + "description":"A comma-separated list of actions that should be returned. Leave empty to return all." + }, + "detailed":{ + "type":"boolean", + "description":"Return detailed task information (default: false)" + }, + "parent_task":{ + "type":"number", + "description":"Return tasks with specified parent task id. Set to -1 to return all." + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.templates.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.templates.json new file mode 100644 index 0000000000000..53fc872b5dae2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.templates.json @@ -0,0 +1,63 @@ +{ + "cat.templates":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html", + "description":"Returns information about existing templates." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/templates", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/templates/{name}", + "methods":[ + "GET" + ], + "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 + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.thread_pool.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.thread_pool.json new file mode 100644 index 0000000000000..d2ce7ed665d5a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.thread_pool.json @@ -0,0 +1,75 @@ +{ + "cat.thread_pool":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html", + "description":"Returns cluster-wide thread pool statistics per node.\nBy default the active, queue and rejected statistics are returned for all thread pools." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/thread_pool", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/thread_pool/{thread_pool_patterns}", + "methods":[ + "GET" + ], + "parts":{ + "thread_pool_patterns":{ + "type":"list", + "description":"A comma-separated list of regular-expressions to filter the thread pools in the output" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "size":{ + "type":"enum", + "description":"The multiplier in which to display values", + "options":[ + "", + "k", + "m", + "g", + "t", + "p" + ] + }, + "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 + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/clear_scroll.json b/rest-api-spec/out/production/resources/rest-api-spec/api/clear_scroll.json new file mode 100644 index 0000000000000..f484c94246c7b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/clear_scroll.json @@ -0,0 +1,40 @@ +{ + "clear_scroll":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#_clear_scroll_api", + "description":"Explicitly clears the search context for a scroll." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_search/scroll", + "methods":[ + "DELETE" + ] + }, + { + "path":"/_search/scroll/{scroll_id}", + "methods":[ + "DELETE" + ], + "parts":{ + "scroll_id":{ + "type":"list", + "description":"A comma-separated list of scroll IDs to clear", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"A scroll id can be quite large and should be specified as part of the body" + } + } + ] + }, + "params":{}, + "body":{ + "description":"A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.allocation_explain.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.allocation_explain.json new file mode 100644 index 0000000000000..e46218a781e1b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.allocation_explain.json @@ -0,0 +1,33 @@ +{ + "cluster.allocation_explain":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html", + "description":"Provides explanations for shard allocations in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/allocation/explain", + "methods":[ + "GET", + "POST" + ] + } + ] + }, + "params":{ + "include_yes_decisions":{ + "type":"boolean", + "description":"Return 'YES' decisions in explanation (default: false)" + }, + "include_disk_info":{ + "type":"boolean", + "description":"Return information about disk usage and shard sizes (default: false)" + } + }, + "body":{ + "description":"The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.delete_component_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.delete_component_template.json new file mode 100644 index 0000000000000..6ddfe6c7ead5f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.delete_component_template.json @@ -0,0 +1,35 @@ +{ + "cluster.delete_component_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-templates.html", + "description":"Deletes a component template" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_component_template/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the template" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_component_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_component_template.json new file mode 100644 index 0000000000000..27bd093e620f0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_component_template.json @@ -0,0 +1,41 @@ +{ + "cluster.get_component_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-templates.html", + "description":"Returns one or more component templates" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_component_template", + "methods":[ + "GET" + ] + }, + { + "path":"/_component_template/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"The comma separated names of the component templates" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_settings.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_settings.json new file mode 100644 index 0000000000000..6f91fbbedf5de --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_settings.json @@ -0,0 +1,38 @@ +{ + "cluster.get_settings":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html", + "description":"Returns cluster settings." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/settings", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "include_defaults":{ + "type":"boolean", + "description":"Whether to return all default clusters setting.", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.health.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.health.json new file mode 100644 index 0000000000000..2a21ff3725b6a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.health.json @@ -0,0 +1,105 @@ +{ + "cluster.health":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html", + "description":"Returns basic information about the health of the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/health", + "methods":[ + "GET" + ] + }, + { + "path":"/_cluster/health/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"Limit the information returned to a specific index" + } + } + } + ] + }, + "params":{ + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"all", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "level":{ + "type":"enum", + "options":[ + "cluster", + "indices", + "shards" + ], + "default":"cluster", + "description":"Specify the level of detail for returned information" + }, + "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" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Wait until the specified number of shards is active" + }, + "wait_for_nodes":{ + "type":"string", + "description":"Wait until the specified number of nodes is available" + }, + "wait_for_events":{ + "type":"enum", + "options":[ + "immediate", + "urgent", + "high", + "normal", + "low", + "languid" + ], + "description":"Wait until all currently queued events with the given priority are processed" + }, + "wait_for_no_relocating_shards":{ + "type":"boolean", + "description":"Whether to wait until there are no relocating shards in the cluster" + }, + "wait_for_no_initializing_shards":{ + "type":"boolean", + "description":"Whether to wait until there are no initializing shards in the cluster" + }, + "wait_for_status":{ + "type":"enum", + "options":[ + "green", + "yellow", + "red" + ], + "default":null, + "description":"Wait until cluster is in a specific state" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.pending_tasks.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.pending_tasks.json new file mode 100644 index 0000000000000..d940adf9aef5d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.pending_tasks.json @@ -0,0 +1,29 @@ +{ + "cluster.pending_tasks":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html", + "description":"Returns a list of any cluster-level changes (e.g. create index, update mapping,\nallocate or fail shard) which have not yet been executed." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/pending_tasks", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_component_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_component_template.json new file mode 100644 index 0000000000000..3bdac2357d023 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_component_template.json @@ -0,0 +1,45 @@ +{ + "cluster.put_component_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-templates.html", + "description":"Creates or updates a component template" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_component_template/{name}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the template" + } + } + } + ] + }, + "params":{ + "create":{ + "type":"boolean", + "description":"Whether the index template should only be added if new or can also replace an existing one", + "default":false + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + } + }, + "body":{ + "description":"The template definition", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_settings.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_settings.json new file mode 100644 index 0000000000000..f6b9a0863380e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_settings.json @@ -0,0 +1,37 @@ +{ + "cluster.put_settings":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html", + "description":"Updates the cluster settings." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/settings", + "methods":[ + "PUT" + ] + } + ] + }, + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + }, + "body":{ + "description":"The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart).", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.remote_info.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.remote_info.json new file mode 100644 index 0000000000000..4eac0b55ce6f1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.remote_info.json @@ -0,0 +1,20 @@ +{ + "cluster.remote_info":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html", + "description":"Returns the information about configured remote clusters." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_remote/info", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.reroute.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.reroute.json new file mode 100644 index 0000000000000..b0e8054fc9e53 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.reroute.json @@ -0,0 +1,57 @@ +{ + "cluster.reroute":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html", + "description":"Allows to manually change the allocation of individual shards in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/reroute", + "methods":[ + "POST" + ] + } + ] + }, + "params":{ + "dry_run":{ + "type":"boolean", + "description":"Simulate the operation only and return the resulting state" + }, + "explain":{ + "type":"boolean", + "description":"Return an explanation of why the commands can or cannot be executed" + }, + "retry_failed":{ + "type":"boolean", + "description":"Retries allocation of shards that are blocked due to too many subsequent allocation failures" + }, + "metric":{ + "type":"list", + "options":[ + "_all", + "blocks", + "metadata", + "nodes", + "routing_table", + "master_node", + "version" + ], + "description":"Limit the information returned to the specified metrics. Defaults to all but metadata" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + }, + "body":{ + "description":"The definition of `commands` to perform (`move`, `cancel`, `allocate`)" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.state.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.state.json new file mode 100644 index 0000000000000..017705082d189 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.state.json @@ -0,0 +1,109 @@ +{ + "cluster.state":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html", + "description":"Returns a comprehensive information about the state of the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/state", + "methods":[ + "GET" + ] + }, + { + "path":"/_cluster/state/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "blocks", + "metadata", + "nodes", + "routing_table", + "routing_nodes", + "master_node", + "version" + ], + "description":"Limit the information returned to the specified metrics" + } + } + }, + { + "path":"/_cluster/state/{metric}/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + }, + "metric":{ + "type":"list", + "options":[ + "_all", + "blocks", + "metadata", + "nodes", + "routing_table", + "routing_nodes", + "master_node", + "version" + ], + "description":"Limit the information returned to the specified metrics" + } + } + } + ] + }, + "params":{ + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "wait_for_metadata_version":{ + "type":"number", + "description":"Wait for the metadata version to be equal or greater than the specified metadata version" + }, + "wait_for_timeout":{ + "type":"time", + "description":"The maximum time to wait for wait_for_metadata_version before timing out" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.stats.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.stats.json new file mode 100644 index 0000000000000..f36db0979f4f7 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.stats.json @@ -0,0 +1,41 @@ +{ + "cluster.stats":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html", + "description":"Returns high-level overview of cluster statistics." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cluster/stats", + "methods":[ + "GET" + ] + }, + { + "path":"/_cluster/stats/nodes/{node_id}", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + } + ] + }, + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/count.json b/rest-api-spec/out/production/resources/rest-api-spec/api/count.json new file mode 100644 index 0000000000000..9f6461b16d3eb --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/count.json @@ -0,0 +1,129 @@ +{ + "count":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html", + "description":"Returns number of documents matching a query." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_count", + "methods":[ + "POST", + "GET" + ] + + }, + { + "path":"/{index}/_count", + "methods":[ + "POST", + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of indices to restrict the results" + } + } + }, + { + "path":"/{index}/{type}/_count", + "methods":[ + "POST", + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of indices to restrict the results" + }, + "type": { + "type" : "list", + "description" : "A comma-separated list of types to restrict the results" + } + }, + "deprecated": { + "version" : "7.0.0", + "description" : "Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "ignore_throttled":{ + "type":"boolean", + "description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "min_score":{ + "type":"number", + "description":"Include only documents with a specific `_score` value in the result" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "routing":{ + "type":"list", + "description":"A comma-separated list of specific routing values" + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "analyzer":{ + "type":"string", + "description":"The analyzer to use for the query string" + }, + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The field to use as default where no field prefix is given in the query string" + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "terminate_after":{ + "type":"number", + "description":"The maximum count for each shard, upon reaching which the query execution will terminate early" + } + }, + "body":{ + "description":"A query to restrict the results specified with the Query DSL (optional)" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/create.json b/rest-api-spec/out/production/resources/rest-api-spec/api/create.json new file mode 100644 index 0000000000000..171f3da44d36d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/create.json @@ -0,0 +1,100 @@ +{ + "create":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html", + "description":"Creates a new document in the index.\n\nReturns a 409 response when a document with a same ID already exists in the index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_create/{id}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + }, + { + "path":"/{index}/{type}/{id}/_create", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "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", + "description":"Specific routing value" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte" + ], + "description":"Specific version type" + }, + "pipeline":{ + "type":"string", + "description":"The pipeline id to preprocess incoming documents with" + } + }, + "body":{ + "description":"The document", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/delete.json b/rest-api-spec/out/production/resources/rest-api-spec/api/delete.json new file mode 100644 index 0000000000000..0d82bca9d4173 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/delete.json @@ -0,0 +1,99 @@ +{ + "delete":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html", + "description":"Removes a document from the index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_doc/{id}", + "methods":[ + "DELETE" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + }, + { + "path":"/{index}/{type}/{id}", + "methods":[ + "DELETE" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "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", + "description":"Specific routing value" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "if_seq_no":{ + "type":"number", + "description":"only perform the delete operation if the last operation that has changed the document has the specified sequence number" + }, + "if_primary_term":{ + "type":"number", + "description":"only perform the delete operation if the last operation that has changed the document has the specified primary term" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query.json b/rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query.json new file mode 100644 index 0000000000000..c840c763f4d90 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query.json @@ -0,0 +1,201 @@ +{ + "delete_by_query":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html", + "description":"Deletes documents matching the provided query." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_delete_by_query", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } + }, + { + "path" : "/{index}/{type}/_delete_by_query", + "methods": ["POST"], + "parts": { + "index": { + "required": true, + "type": "list", + "description": "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + }, + "type": { + "type": "list", + "description": "A comma-separated list of document types to search; leave empty to perform the operation on all types" + } + }, + "deprecated": { + "version" : "7.0.0", + "description" : "Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "analyzer": { + "type" : "string", + "description" : "The analyzer to use for the query string" + }, + "analyze_wildcard": { + "type" : "boolean", + "description" : "Specify whether wildcard and prefix queries should be analyzed (default: false)" + }, + "default_operator": { + "type" : "enum", + "options" : ["AND","OR"], + "default" : "OR", + "description" : "The default operator for query string query (AND or OR)" + }, + "df": { + "type" : "string", + "description" : "The field to use as default where no field prefix is given in the query string" + }, + "from": { + "type" : "number", + "description" : "Starting offset (default: 0)" + }, + "ignore_unavailable": { + "type" : "boolean", + "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices": { + "type" : "boolean", + "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "conflicts": { + "note": "This is not copied from search", + "type" : "enum", + "options": ["abort", "proceed"], + "default": "abort", + "description" : "What to do when the delete by query hits version conflicts?" + }, + "expand_wildcards": { + "type" : "enum", + "options" : [ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default" : "open", + "description" :"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "lenient": { + "type" : "boolean", + "description" : "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "preference": { + "type" : "string", + "description" : "Specify the node or shard the operation should be performed on (default: random)" + }, + "q": { + "type" : "string", + "description" : "Query in the Lucene query string syntax" + }, + "routing": { + "type" : "list", + "description" : "A comma-separated list of specific routing values" + }, + "scroll": { + "type" : "time", + "description" : "Specify how long a consistent view of the index should be maintained for scrolled search" + }, + "search_type": { + "type" : "enum", + "options" : ["query_then_fetch", "dfs_query_then_fetch"], + "description" : "Search operation type" + }, + "search_timeout": { + "type" : "time", + "description" : "Explicit timeout for each search request. Defaults to no timeout." + }, + "size": { + "type" : "number", + "description" : "Deprecated, please use `max_docs` instead" + }, + "max_docs": { + "type" : "number", + "description" : "Maximum number of documents to process (default: all documents)" + }, + "sort": { + "type" : "list", + "description" : "A comma-separated list of : pairs" + }, + "_source": { + "type" : "list", + "description" : "True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes": { + "type" : "list", + "description" : "A list of fields to exclude from the returned _source field" + }, + "_source_includes": { + "type" : "list", + "description" : "A list of fields to extract and return from the _source field" + }, + "terminate_after": { + "type" : "number", + "description" : "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." + }, + "stats": { + "type" : "list", + "description" : "Specific 'tag' of the request for logging and statistical purposes" + }, + "version": { + "type" : "boolean", + "description" : "Specify whether to return document version as part of a hit" + }, + "request_cache": { + "type" : "boolean", + "description" : "Specify if request cache should be used for this request or not, defaults to index level setting" + }, + "refresh": { + "type" : "boolean", + "description" : "Should the effected indexes be refreshed?" + }, + "timeout": { + "type" : "time", + "default": "1m", + "description" : "Time each individual bulk request should wait for shards that are unavailable." + }, + "wait_for_active_shards": { + "type" : "string", + "description" : "Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "scroll_size": { + "type": "number", + "defaut_value": 100, + "description": "Size on the scroll request powering the delete by query" + }, + "wait_for_completion": { + "type" : "boolean", + "default": true, + "description" : "Should the request should block until the delete by query is complete." + }, + "requests_per_second": { + "type": "number", + "default": 0, + "description": "The throttle for this request in sub-requests per second. -1 means no throttle." + }, + "slices": { + "type": "number|string", + "default": 1, + "description": "The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`." + } + }, + "body":{ + "description":"The search definition using the Query DSL", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query_rethrottle.json b/rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query_rethrottle.json new file mode 100644 index 0000000000000..112bfc8a7d2e0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query_rethrottle.json @@ -0,0 +1,32 @@ +{ + "delete_by_query_rethrottle":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html", + "description":"Changes the number of requests per second for a particular Delete By Query operation." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_delete_by_query/{task_id}/_rethrottle", + "methods":[ + "POST" + ], + "parts":{ + "task_id":{ + "type":"string", + "description":"The task id to rethrottle" + } + } + } + ] + }, + "params":{ + "requests_per_second":{ + "type":"number", + "required":true, + "description":"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/delete_script.json b/rest-api-spec/out/production/resources/rest-api-spec/api/delete_script.json new file mode 100644 index 0000000000000..b38b97ae57c2e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/delete_script.json @@ -0,0 +1,35 @@ +{ + "delete_script":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html", + "description":"Deletes a script." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_scripts/{id}", + "methods":[ + "DELETE" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Script ID" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/exists.json b/rest-api-spec/out/production/resources/rest-api-spec/api/exists.json new file mode 100644 index 0000000000000..09042376a256b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/exists.json @@ -0,0 +1,102 @@ +{ + "exists":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", + "description":"Returns information about whether a document exists in an index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_doc/{id}", + "methods":[ + "HEAD" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + }, + { + "path":"/{index}/{type}/{id}", + "methods":[ + "HEAD" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document (use `_all` to fetch the first document matching the ID across all types)", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "stored_fields":{ + "type":"list", + "description":"A comma-separated list of stored fields to return in the response" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "realtime":{ + "type":"boolean", + "description":"Specify whether to perform the operation in realtime or search mode" + }, + "refresh":{ + "type":"boolean", + "description":"Refresh the shard containing the document before performing the operation" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/exists_source.json b/rest-api-spec/out/production/resources/rest-api-spec/api/exists_source.json new file mode 100644 index 0000000000000..143ee406025ce --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/exists_source.json @@ -0,0 +1,98 @@ +{ + "exists_source":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", + "description":"Returns information about whether a document source exists in an index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_source/{id}", + "methods":[ + "HEAD" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + }, + { + "path":"/{index}/{type}/{id}/_source", + "methods":[ + "HEAD" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document; deprecated and optional starting with 7.0", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "realtime":{ + "type":"boolean", + "description":"Specify whether to perform the operation in realtime or search mode" + }, + "refresh":{ + "type":"boolean", + "description":"Refresh the shard containing the document before performing the operation" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/explain.json b/rest-api-spec/out/production/resources/rest-api-spec/api/explain.json new file mode 100644 index 0000000000000..c7c393a6a1cba --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/explain.json @@ -0,0 +1,114 @@ +{ + "explain":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html", + "description":"Returns information about why a specific matches (or doesn't match) a query." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_explain/{id}", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + }, + { + "path":"/{index}/{type}/{id}/_explain", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)" + }, + "analyzer":{ + "type":"string", + "description":"The analyzer for the query string query" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The default field for query string query (default: _all)" + }, + "stored_fields":{ + "type":"list", + "description":"A comma-separated list of stored fields to return in the response" + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + } + }, + "body":{ + "description":"The query definition using the Query DSL" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/field_caps.json b/rest-api-spec/out/production/resources/rest-api-spec/api/field_caps.json new file mode 100644 index 0000000000000..d56c3313a0bf0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/field_caps.json @@ -0,0 +1,64 @@ +{ + "field_caps":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html", + "description":"Returns the information about the capabilities of fields among multiple indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_field_caps", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_field_caps", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "fields":{ + "type":"list", + "description":"A comma-separated list of field names" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "include_unmapped":{ + "type":"boolean", + "default":false, + "description":"Indicates whether unmapped fields should be included in the response." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/get.json b/rest-api-spec/out/production/resources/rest-api-spec/api/get.json new file mode 100644 index 0000000000000..0c8d62d6d1d34 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/get.json @@ -0,0 +1,102 @@ +{ + "get":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", + "description":"Returns a document." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_doc/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + }, + { + "path":"/{index}/{type}/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document (use `_all` to fetch the first document matching the ID across all types)", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "stored_fields":{ + "type":"list", + "description":"A comma-separated list of stored fields to return in the response" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "realtime":{ + "type":"boolean", + "description":"Specify whether to perform the operation in realtime or search mode" + }, + "refresh":{ + "type":"boolean", + "description":"Refresh the shard containing the document before performing the operation" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/get_script.json b/rest-api-spec/out/production/resources/rest-api-spec/api/get_script.json new file mode 100644 index 0000000000000..14307bea2ef0b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/get_script.json @@ -0,0 +1,31 @@ +{ + "get_script":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html", + "description":"Returns a script." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_scripts/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Script ID" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/get_script_context.json b/rest-api-spec/out/production/resources/rest-api-spec/api/get_script_context.json new file mode 100644 index 0000000000000..16e8d0a0cfab3 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/get_script_context.json @@ -0,0 +1,19 @@ +{ + "get_script_context":{ + "documentation":{ + "description":"Returns all script contexts." + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_script_context", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/get_script_languages.json b/rest-api-spec/out/production/resources/rest-api-spec/api/get_script_languages.json new file mode 100644 index 0000000000000..5a45392d9ee11 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/get_script_languages.json @@ -0,0 +1,19 @@ +{ + "get_script_languages":{ + "documentation":{ + "description":"Returns available script types, languages and contexts" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_script_language", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/get_source.json b/rest-api-spec/out/production/resources/rest-api-spec/api/get_source.json new file mode 100644 index 0000000000000..e5336059d3924 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/get_source.json @@ -0,0 +1,98 @@ +{ + "get_source":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", + "description":"Returns the source of a document." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_source/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + }, + { + "path":"/{index}/{type}/{id}/_source", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document; deprecated and optional starting with 7.0", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "realtime":{ + "type":"boolean", + "description":"Specify whether to perform the operation in realtime or search mode" + }, + "refresh":{ + "type":"boolean", + "description":"Refresh the shard containing the document before performing the operation" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/index.json b/rest-api-spec/out/production/resources/rest-api-spec/api/index.json new file mode 100644 index 0000000000000..7ecd7a0e9279e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/index.json @@ -0,0 +1,149 @@ +{ + "index":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html", + "description":"Creates or updates a document in an index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_doc/{id}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + }, + { + "path":"/{index}/_doc", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index" + } + } + }, + { + "path":"/{index}/{type}", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + }, + { + "path":"/{index}/{type}/{id}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "op_type":{ + "type":"enum", + "options":[ + "index", + "create" + ], + "description":"Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID" + }, + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "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", + "description":"Specific routing value" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte" + ], + "description":"Specific version type" + }, + "if_seq_no":{ + "type":"number", + "description":"only perform the index operation if the last operation that has changed the document has the specified sequence number" + }, + "if_primary_term":{ + "type":"number", + "description":"only perform the index operation if the last operation that has changed the document has the specified primary term" + }, + "pipeline":{ + "type":"string", + "description":"The pipeline id to preprocess incoming documents with" + } + }, + "body":{ + "description":"The document", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.analyze.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.analyze.json new file mode 100644 index 0000000000000..aa8e84c1985d6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.analyze.json @@ -0,0 +1,42 @@ +{ + "indices.analyze":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html", + "description":"Performs the analysis process on a text and return the tokens breakdown of the text." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_analyze", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_analyze", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index to scope the operation" + } + } + } + ] + }, + "params":{ + "index":{ + "type":"string", + "description":"The name of the index to scope the operation" + } + }, + "body":{ + "description":"Define analyzer/tokenizer parameters and the text on which the analysis should be performed" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.clear_cache.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.clear_cache.json new file mode 100644 index 0000000000000..64c10a520c7c4 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.clear_cache.json @@ -0,0 +1,73 @@ +{ + "indices.clear_cache":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html", + "description":"Clears all or specific caches for one or more indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cache/clear", + "methods":[ + "POST" + ] + }, + { + "path":"/{index}/_cache/clear", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index name to limit the operation" + } + } + } + ] + }, + "params":{ + "fielddata":{ + "type":"boolean", + "description":"Clear field data" + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to clear when using the `fielddata` parameter (default: all)" + }, + "query":{ + "type":"boolean", + "description":"Clear query caches" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "index":{ + "type":"list", + "description":"A comma-separated list of index name to limit the operation" + }, + "request":{ + "type":"boolean", + "description":"Clear request cache" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.clone.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.clone.json new file mode 100644 index 0000000000000..d3a249583bd84 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.clone.json @@ -0,0 +1,47 @@ +{ + "indices.clone": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html", + "description": "Clones an index" + }, + "stability": "stable", + "url": { + "paths": [ + { + "path": "/{index}/_clone/{target}", + "methods": [ + "PUT", + "POST" + ], + "parts": { + "index": { + "type": "string", + "description": "The name of the source index to clone" + }, + "target": { + "type": "string", + "description": "The name of the target index to clone into" + } + } + } + ] + }, + "params": { + "timeout": { + "type" : "time", + "description" : "Explicit operation timeout" + }, + "master_timeout": { + "type" : "time", + "description" : "Specify timeout for connection to master" + }, + "wait_for_active_shards": { + "type" : "string", + "description" : "Set the number of active shards to wait for on the cloned index before the operation returns." + } + }, + "body": { + "description" : "The configuration for the target index (`settings` and `aliases`)" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.close.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.close.json new file mode 100644 index 0000000000000..f26c8e77a06a6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.close.json @@ -0,0 +1,59 @@ +{ + "indices.close":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html", + "description":"Closes an index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_close", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma separated list of indices to close" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of active shards to wait for before the operation returns." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.create.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.create.json new file mode 100644 index 0000000000000..2b9e8617a661c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.create.json @@ -0,0 +1,46 @@ +{ + "indices.create":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html", + "description":"Creates an index with optional settings and mappings." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}", + "methods":[ + "PUT" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index" + } + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be expected in the body of the mappings." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Set the number of active shards to wait for before the operation returns." + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + } + }, + "body":{ + "description":"The configuration for the index (`settings` and `mappings`)" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.create_data_stream.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.create_data_stream.json new file mode 100644 index 0000000000000..ef8615a69b1ca --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.create_data_stream.json @@ -0,0 +1,31 @@ +{ + "indices.create_data_stream":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html", + "description":"Creates or updates a data stream" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_data_stream/{name}", + "methods":[ + "PUT" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the data stream" + } + } + } + ] + }, + "params":{ + }, + "body":{ + "description":"The data stream definition", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete.json new file mode 100644 index 0000000000000..53fdf44bb36a1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete.json @@ -0,0 +1,55 @@ +{ + "indices.delete":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html", + "description":"Deletes an index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}", + "methods":[ + "DELETE" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Ignore unavailable indexes (default: false)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_alias.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_alias.json new file mode 100644 index 0000000000000..13abf70ca739b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_alias.json @@ -0,0 +1,55 @@ +{ + "indices.delete_alias":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", + "description":"Deletes an alias." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_alias/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names (supports wildcards); use `_all` for all indices" + }, + "name":{ + "type":"list", + "description":"A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices." + } + } + }, + { + "path":"/{index}/_aliases/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names (supports wildcards); use `_all` for all indices" + }, + "name":{ + "type":"list", + "description":"A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices." + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit timestamp for the document" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_data_stream.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_data_stream.json new file mode 100644 index 0000000000000..71ed5808caefc --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_data_stream.json @@ -0,0 +1,26 @@ +{ + "indices.delete_data_stream":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html", + "description":"Deletes a data stream." + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_data_stream/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the data stream" + } + } + } + ] + }, + "params":{} + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_template.json new file mode 100644 index 0000000000000..ca484a73e99f9 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_template.json @@ -0,0 +1,35 @@ +{ + "indices.delete_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", + "description":"Deletes an index template." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_template/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the template" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists.json new file mode 100644 index 0000000000000..7539f44a81eed --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists.json @@ -0,0 +1,60 @@ +{ + "indices.exists":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html", + "description":"Returns information about whether a particular index exists." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}", + "methods":[ + "HEAD" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + } + } + } + ] + }, + "params":{ + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Ignore unavailable indexes (default: false)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "include_defaults":{ + "type":"boolean", + "description":"Whether to return all default setting for each of the indices.", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_alias.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_alias.json new file mode 100644 index 0000000000000..66e5ce92cbbe5 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_alias.json @@ -0,0 +1,67 @@ +{ + "indices.exists_alias":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", + "description":"Returns information about whether a particular alias exists." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_alias/{name}", + "methods":[ + "HEAD" + ], + "parts":{ + "name":{ + "type":"list", + "description":"A comma-separated list of alias names to return" + } + } + }, + { + "path":"/{index}/_alias/{name}", + "methods":[ + "HEAD" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to filter aliases" + }, + "name":{ + "type":"list", + "description":"A comma-separated list of alias names to return" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"all", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_template.json new file mode 100644 index 0000000000000..9796bdd9d21ff --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_template.json @@ -0,0 +1,39 @@ +{ + "indices.exists_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", + "description":"Returns information about whether a particular index template exists." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_template/{name}", + "methods":[ + "HEAD" + ], + "parts":{ + "name":{ + "type":"list", + "description":"The comma separated names of the index templates" + } + } + } + ] + }, + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_type.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_type.json new file mode 100644 index 0000000000000..c854d0e8fd841 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_type.json @@ -0,0 +1,55 @@ +{ + "indices.exists_type":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html", + "description":"Returns information about whether a particular document type exists. (DEPRECATED)" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_mapping/{type}", + "methods":[ + "HEAD" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` to check the types across all indices" + }, + "type":{ + "type":"list", + "description":"A comma-separated list of document types to check" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush.json new file mode 100644 index 0000000000000..35138b920466f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush.json @@ -0,0 +1,63 @@ +{ + "indices.flush":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html", + "description":"Performs the flush operation on one or more indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_flush", + "methods":[ + "POST", + "GET" + ] + }, + { + "path":"/{index}/_flush", + "methods":[ + "POST", + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string for all indices" + } + } + } + ] + }, + "params":{ + "force":{ + "type":"boolean", + "description":"Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal)" + }, + "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 true. If set to false the flush will be skipped iff if another flush operation is already running." + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush_synced.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush_synced.json new file mode 100644 index 0000000000000..a7b4541c9623a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush_synced.json @@ -0,0 +1,54 @@ +{ + "indices.flush_synced":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush-api.html", + "description":"Performs a synced flush operation on one or more indices. Synced flush is deprecated and will be removed in 8.0. Use flush instead" + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_flush/synced", + "methods":[ + "POST", + "GET" + ] + }, + { + "path":"/{index}/_flush/synced", + "methods":[ + "POST", + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string for all indices" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.forcemerge.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.forcemerge.json new file mode 100644 index 0000000000000..6036b75bb83e4 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.forcemerge.json @@ -0,0 +1,65 @@ +{ + "indices.forcemerge":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html", + "description":"Performs the force merge operation on one or more indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_forcemerge", + "methods":[ + "POST" + ] + }, + { + "path":"/{index}/_forcemerge", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "flush":{ + "type":"boolean", + "description":"Specify whether the index should be flushed after performing the operation (default: true)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "max_num_segments":{ + "type":"number", + "description":"The number of segments the index should be merged into (default: dynamic)" + }, + "only_expunge_deletes":{ + "type":"boolean", + "description":"Specify whether the operation should only expunge deleted documents" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get.json new file mode 100644 index 0000000000000..f78b410f5b489 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get.json @@ -0,0 +1,68 @@ +{ + "indices.get":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html", + "description":"Returns information about one or more indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + } + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether to add the type name to the response (default: false)" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Ignore unavailable indexes (default: false)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "include_defaults":{ + "type":"boolean", + "description":"Whether to return all default setting for each of the indices.", + "default":false + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_alias.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_alias.json new file mode 100644 index 0000000000000..e238c4fc38afc --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_alias.json @@ -0,0 +1,85 @@ +{ + "indices.get_alias":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", + "description":"Returns an alias." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_alias", + "methods":[ + "GET" + ] + }, + { + "path":"/_alias/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"A comma-separated list of alias names to return" + } + } + }, + { + "path":"/{index}/_alias/{name}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to filter aliases" + }, + "name":{ + "type":"list", + "description":"A comma-separated list of alias names to return" + } + } + }, + { + "path":"/{index}/_alias", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to filter aliases" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default": ["all"], + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_data_streams.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_data_streams.json new file mode 100644 index 0000000000000..42415068d4a5d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_data_streams.json @@ -0,0 +1,33 @@ +{ + "indices.get_data_streams":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html", + "description":"Returns data streams." + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_data_streams", + "methods":[ + "GET" + ] + }, + { + "path":"/_data_streams/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"The comma separated names of data streams" + } + } + } + ] + }, + "params":{ + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_field_mapping.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_field_mapping.json new file mode 100644 index 0000000000000..15cc48a582cc4 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_field_mapping.json @@ -0,0 +1,121 @@ +{ + "indices.get_field_mapping":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html", + "description":"Returns mapping for one or more fields." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_mapping/field/{fields}", + "methods":[ + "GET" + ], + "parts":{ + "fields":{ + "type":"list", + "description":"A comma-separated list of fields" + } + } + }, + { + "path":"/{index}/_mapping/field/{fields}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields" + } + } + }, + { + "path":"/_mapping/{type}/field/{fields}", + "methods":[ + "GET" + ], + "parts":{ + "type":{ + "type":"list", + "description":"A comma-separated list of document types", + "deprecated":true + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields" + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + }, + { + "path":"/{index}/_mapping/{type}/field/{fields}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + }, + "type":{ + "type":"list", + "description":"A comma-separated list of document types", + "deprecated":true + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields" + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be returned in the body of the mappings." + }, + "include_defaults":{ + "type":"boolean", + "description":"Whether the default mapping values should be returned as well" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_mapping.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_mapping.json new file mode 100644 index 0000000000000..188203dc13664 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_mapping.json @@ -0,0 +1,103 @@ +{ + "indices.get_mapping":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html", + "description":"Returns mappings for one or more indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_mapping", + "methods":[ + "GET" + ] + }, + { + "path":"/{index}/_mapping", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + } + } + }, + { + "path":"/_mapping/{type}", + "methods":[ + "GET" + ], + "parts":{ + "type":{ + "type":"list", + "description":"A comma-separated list of document types", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + }, + { + "path":"/{index}/_mapping/{type}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + }, + "type":{ + "type":"list", + "description":"A comma-separated list of document types", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether to add the type name to the response (default: false)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_settings.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_settings.json new file mode 100644 index 0000000000000..4a1dea974f750 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_settings.json @@ -0,0 +1,101 @@ +{ + "indices.get_settings":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html", + "description":"Returns settings for one or more indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_settings", + "methods":[ + "GET" + ] + }, + { + "path":"/{index}/_settings", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + }, + { + "path":"/{index}/_settings/{name}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + }, + "name":{ + "type":"list", + "description":"The name of the settings that should be included" + } + } + }, + { + "path":"/_settings/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"The name of the settings that should be included" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":[ + "open", + "closed" + ], + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "include_defaults":{ + "type":"boolean", + "description":"Whether to return all default setting for each of the indices.", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_template.json new file mode 100644 index 0000000000000..9e07ae663ff8f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_template.json @@ -0,0 +1,49 @@ +{ + "indices.get_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", + "description":"Returns an index template." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_template", + "methods":[ + "GET" + ] + }, + { + "path":"/_template/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"The comma separated names of the index templates" + } + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be returned in the body of the mappings." + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_upgrade.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_upgrade.json new file mode 100644 index 0000000000000..472a90121fd2a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_upgrade.json @@ -0,0 +1,53 @@ +{ + "indices.get_upgrade":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html", + "description":"The _upgrade API is no longer useful and will be removed." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_upgrade", + "methods":[ + "GET" + ] + }, + { + "path":"/{index}/_upgrade", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.open.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.open.json new file mode 100644 index 0000000000000..1dab468ce4ff4 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.open.json @@ -0,0 +1,59 @@ +{ + "indices.open":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html", + "description":"Opens an index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_open", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma separated list of indices to open" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"closed", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of active shards to wait for before the operation returns." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_alias.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_alias.json new file mode 100644 index 0000000000000..603f24b665eb7 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_alias.json @@ -0,0 +1,61 @@ +{ + "indices.put_alias":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", + "description":"Creates or updates an alias." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_alias/{name}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices." + }, + "name":{ + "type":"string", + "description":"The name of the alias to be created or updated" + } + } + }, + { + "path":"/{index}/_aliases/{name}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices." + }, + "name":{ + "type":"string", + "description":"The name of the alias to be created or updated" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit timestamp for the document" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + } + }, + "body":{ + "description":"The settings for the alias, such as `routing` or `filter`", + "required":false + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_mapping.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_mapping.json new file mode 100644 index 0000000000000..deb7bb728f733 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_mapping.json @@ -0,0 +1,205 @@ +{ + "indices.put_mapping":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html", + "description":"Updates the index mappings." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_mapping", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." + } + } + }, + { + "path":"/{index}/{type}/_mapping", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." + }, + "type":{ + "type":"string", + "description":"The name of the document type", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + }, + { + "path":"/{index}/_mapping/{type}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." + }, + "type":{ + "type":"string", + "description":"The name of the document type", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + }, + { + "path":"/{index}/{type}/_mappings", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." + }, + "type":{ + "type":"string", + "description":"The name of the document type", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + }, + { + "path":"/{index}/_mappings/{type}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." + }, + "type":{ + "type":"string", + "description":"The name of the document type", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + }, + { + "path":"/_mappings/{type}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "type":{ + "type":"string", + "description":"The name of the document type", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + }, + { + "path":"{index}/_mappings", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"The plural mappings is accepted but only /_mapping is documented" + } + }, + { + "path":"/_mapping/{type}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "type":{ + "type":"string", + "description":"The name of the document type", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be expected in the body of the mappings." + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + }, + "body":{ + "description":"The mapping definition", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_settings.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_settings.json new file mode 100644 index 0000000000000..66fe23bab8ba2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_settings.json @@ -0,0 +1,73 @@ +{ + "indices.put_settings":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html", + "description":"Updates the index settings." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_settings", + "methods":[ + "PUT" + ] + }, + { + "path":"/{index}/_settings", + "methods":[ + "PUT" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "preserve_existing":{ + "type":"boolean", + "description":"Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false`" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + } + }, + "body":{ + "description":"The index settings to be updated", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_template.json new file mode 100644 index 0000000000000..701a722d89eb8 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_template.json @@ -0,0 +1,49 @@ +{ + "indices.put_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", + "description":"Creates or updates an index template." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_template/{name}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the template" + } + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be returned in the body of the mappings." + }, + "order":{ + "type":"number", + "description":"The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)" + }, + "create":{ + "type":"boolean", + "description":"Whether the index template should only be added if new or can also replace an existing one", + "default":false + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + } + }, + "body":{ + "description":"The template definition", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.recovery.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.recovery.json new file mode 100644 index 0000000000000..8b134bbe2413a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.recovery.json @@ -0,0 +1,43 @@ +{ + "indices.recovery":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html", + "description":"Returns information about ongoing index shard recoveries." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_recovery", + "methods":[ + "GET" + ] + }, + { + "path":"/{index}/_recovery", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "detailed":{ + "type":"boolean", + "description":"Whether to display detailed information about shard recovery", + "default":false + }, + "active_only":{ + "type":"boolean", + "description":"Display only those recoveries that are currently on-going", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.refresh.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.refresh.json new file mode 100644 index 0000000000000..950e0a62489fa --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.refresh.json @@ -0,0 +1,55 @@ +{ + "indices.refresh":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html", + "description":"Performs the refresh operation in one or more indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_refresh", + "methods":[ + "POST", + "GET" + ] + }, + { + "path":"/{index}/_refresh", + "methods":[ + "POST", + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.rollover.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.rollover.json new file mode 100644 index 0000000000000..4ed1f9b490969 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.rollover.json @@ -0,0 +1,66 @@ +{ + "indices.rollover":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html", + "description":"Updates an alias to point to a new index when the existing index\nis considered to be too large or too old." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{alias}/_rollover", + "methods":[ + "POST" + ], + "parts":{ + "alias":{ + "type":"string", + "description":"The name of the alias to rollover" + } + } + }, + { + "path":"/{alias}/_rollover/{new_index}", + "methods":[ + "POST" + ], + "parts":{ + "alias":{ + "type":"string", + "description":"The name of the alias to rollover" + }, + "new_index":{ + "type":"string", + "description":"The name of the rollover index" + } + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be included in the body of the mappings." + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "dry_run":{ + "type":"boolean", + "description":"If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Set the number of active shards to wait for on the newly created rollover index before the operation returns." + } + }, + "body":{ + "description":"The conditions that needs to be met for executing rollover" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.segments.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.segments.json new file mode 100644 index 0000000000000..83430a9a85600 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.segments.json @@ -0,0 +1,58 @@ +{ + "indices.segments":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html", + "description":"Provides low-level information about segments in a Lucene index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_segments", + "methods":[ + "GET" + ] + }, + { + "path":"/{index}/_segments", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "verbose":{ + "type":"boolean", + "description":"Includes detailed memory usage by Lucene.", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.shard_stores.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.shard_stores.json new file mode 100644 index 0000000000000..7e48e99916171 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.shard_stores.json @@ -0,0 +1,63 @@ +{ + "indices.shard_stores":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html", + "description":"Provides store information for shard copies of indices." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_shard_stores", + "methods":[ + "GET" + ] + }, + { + "path":"/{index}/_shard_stores", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "status":{ + "type":"list", + "options":[ + "green", + "yellow", + "red", + "all" + ], + "description":"A comma-separated list of statuses used to filter on shards to get store information for" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.shrink.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.shrink.json new file mode 100644 index 0000000000000..fd6d705d6a5fa --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.shrink.json @@ -0,0 +1,51 @@ +{ + "indices.shrink":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html", + "description":"Allow to shrink an existing index into a new index with fewer primary shards." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_shrink/{target}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the source index to shrink" + }, + "target":{ + "type":"string", + "description":"The name of the target index to shrink into" + } + } + } + ] + }, + "params":{ + "copy_settings": { + "type" : "boolean", + "description" : "whether or not to copy settings from the source index (defaults to false)" + }, + "timeout": { + "type" : "time", + "description" : "Explicit operation timeout" + }, + "master_timeout": { + "type" : "time", + "description" : "Specify timeout for connection to master" + }, + "wait_for_active_shards": { + "type" : "string", + "description" : "Set the number of active shards to wait for on the shrunken index before the operation returns." + } + }, + "body":{ + "description":"The configuration for the target index (`settings` and `aliases`)" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.split.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.split.json new file mode 100644 index 0000000000000..02df3cdedf01f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.split.json @@ -0,0 +1,51 @@ +{ + "indices.split":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html", + "description":"Allows you to split an existing index into a new index with more primary shards." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_split/{target}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the source index to split" + }, + "target":{ + "type":"string", + "description":"The name of the target index to split into" + } + } + } + ] + }, + "params": { + "copy_settings": { + "type" : "boolean", + "description" : "whether or not to copy settings from the source index (defaults to false)" + }, + "timeout": { + "type" : "time", + "description" : "Explicit operation timeout" + }, + "master_timeout": { + "type" : "time", + "description" : "Specify timeout for connection to master" + }, + "wait_for_active_shards": { + "type" : "string", + "description" : "Set the number of active shards to wait for on the shrunken index before the operation returns." + } + }, + "body":{ + "description":"The configuration for the target index (`settings` and `aliases`)" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.stats.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.stats.json new file mode 100644 index 0000000000000..0a8960f2f9e89 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.stats.json @@ -0,0 +1,154 @@ +{ + "indices.stats":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html", + "description":"Provides statistics on operations happening in an index." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_stats", + "methods":[ + "GET" + ] + }, + { + "path":"/_stats/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "description":"Limit the information returned the specific metrics." + } + } + }, + { + "path":"/{index}/_stats", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + }, + { + "path":"/{index}/_stats/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + }, + "metric":{ + "type":"list", + "options":[ + "_all", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "description":"Limit the information returned the specific metrics." + } + } + } + ] + }, + "params":{ + "completion_fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)" + }, + "fielddata_fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` index metric (supports wildcards)" + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)" + }, + "groups":{ + "type":"list", + "description":"A comma-separated list of search groups for `search` index metric" + }, + "level":{ + "type":"enum", + "description":"Return stats aggregated at cluster, index or shard level", + "options":[ + "cluster", + "indices", + "shards" + ], + "default":"indices" + }, + "types":{ + "type":"list", + "description":"A comma-separated list of document types for the `indexing` index metric" + }, + "include_segment_file_sizes":{ + "type":"boolean", + "description":"Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)", + "default":false + }, + "include_unloaded_segments":{ + "type":"boolean", + "description":"If set to true segment stats will include stats for segments that are not currently loaded into memory", + "default":false + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "forbid_closed_indices":{ + "type":"boolean", + "description":"If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices", + "default":true + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.update_aliases.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.update_aliases.json new file mode 100644 index 0000000000000..d4a222f2061c8 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.update_aliases.json @@ -0,0 +1,33 @@ +{ + "indices.update_aliases":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", + "description":"Updates index aliases." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_aliases", + "methods":[ + "POST" + ] + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Request timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + } + }, + "body":{ + "description":"The definition of `actions` to perform", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.upgrade.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.upgrade.json new file mode 100644 index 0000000000000..670d3e0a33586 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.upgrade.json @@ -0,0 +1,61 @@ +{ + "indices.upgrade":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html", + "description":"The _upgrade API is no longer useful and will be removed." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_upgrade", + "methods":[ + "POST" + ] + }, + { + "path":"/{index}/_upgrade", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "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/rest-api-spec/out/production/resources/rest-api-spec/api/indices.validate_query.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.validate_query.json new file mode 100644 index 0000000000000..3becec003a9e6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.validate_query.json @@ -0,0 +1,121 @@ +{ + "indices.validate_query":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html", + "description":"Allows a user to validate a potentially expensive query without executing it." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_validate/query", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_validate/query", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices" + } + } + }, + { + "path":"/{index}/{type}/_validate/query", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices" + }, + "type":{ + "type":"list", + "description":"A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "explain":{ + "type":"boolean", + "description":"Return detailed information about the error" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "analyzer":{ + "type":"string", + "description":"The analyzer to use for the query string" + }, + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The field to use as default where no field prefix is given in the query string" + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "rewrite":{ + "type":"boolean", + "description":"Provide a more detailed explanation showing the actual Lucene query that will be executed." + }, + "all_shards":{ + "type":"boolean", + "description":"Execute validation on all shards instead of one random shard per index" + } + }, + "body":{ + "description":"The query definition specified with the Query DSL" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/info.json b/rest-api-spec/out/production/resources/rest-api-spec/api/info.json new file mode 100644 index 0000000000000..1c48f05d02e9d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/info.json @@ -0,0 +1,20 @@ +{ + "info":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html", + "description":"Returns basic information about the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.delete_pipeline.json b/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.delete_pipeline.json new file mode 100644 index 0000000000000..29b4219038cd2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.delete_pipeline.json @@ -0,0 +1,35 @@ +{ + "ingest.delete_pipeline":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html", + "description":"Deletes a pipeline." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ingest/pipeline/{id}", + "methods":[ + "DELETE" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Pipeline ID" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.get_pipeline.json b/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.get_pipeline.json new file mode 100644 index 0000000000000..65fc4f91b2b42 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.get_pipeline.json @@ -0,0 +1,37 @@ +{ + "ingest.get_pipeline":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html", + "description":"Returns a pipeline." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ingest/pipeline", + "methods":[ + "GET" + ] + }, + { + "path":"/_ingest/pipeline/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Comma separated list of pipeline ids. Wildcards supported" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.processor_grok.json b/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.processor_grok.json new file mode 100644 index 0000000000000..ac8ad6e6d0669 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.processor_grok.json @@ -0,0 +1,20 @@ +{ + "ingest.processor_grok":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get", + "description":"Returns a list of the built-in patterns." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ingest/processor/grok", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.put_pipeline.json b/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.put_pipeline.json new file mode 100644 index 0000000000000..4d2105866791c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.put_pipeline.json @@ -0,0 +1,39 @@ +{ + "ingest.put_pipeline":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html", + "description":"Creates or updates a pipeline." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ingest/pipeline/{id}", + "methods":[ + "PUT" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Pipeline ID" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + }, + "body":{ + "description":"The ingest definition", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.simulate.json b/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.simulate.json new file mode 100644 index 0000000000000..8122f7a0ffa19 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.simulate.json @@ -0,0 +1,44 @@ +{ + "ingest.simulate":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html", + "description":"Allows to simulate a pipeline with example documents." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_ingest/pipeline/_simulate", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/_ingest/pipeline/{id}/_simulate", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Pipeline ID" + } + } + } + ] + }, + "params":{ + "verbose":{ + "type":"boolean", + "description":"Verbose mode. Display data output for each processor in executed pipeline", + "default":false + } + }, + "body":{ + "description":"The simulate definition", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/mget.json b/rest-api-spec/out/production/resources/rest-api-spec/api/mget.json new file mode 100644 index 0000000000000..f1d35aee7d62f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/mget.json @@ -0,0 +1,93 @@ +{ + "mget":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html", + "description":"Allows to get multiple documents in one request." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_mget", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_mget", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index" + } + } + }, + { + "path":"/{index}/{type}/_mget", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "stored_fields":{ + "type":"list", + "description":"A comma-separated list of stored fields to return in the response" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "realtime":{ + "type":"boolean", + "description":"Specify whether to perform the operation in realtime or search mode" + }, + "refresh":{ + "type":"boolean", + "description":"Refresh the shard containing the document before performing the operation" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + } + }, + "body":{ + "description":"Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL.", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/msearch.json b/rest-api-spec/out/production/resources/rest-api-spec/api/msearch.json new file mode 100644 index 0000000000000..e3e6ef57e42c8 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/msearch.json @@ -0,0 +1,95 @@ +{ + "msearch":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html", + "description":"Allows to execute several search operations in one request." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_msearch", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_msearch", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to use as default" + } + } + }, + { + "path" : "/{index}/{type}/_msearch", + "methods": ["GET", "POST"], + "parts": { + "index": { + "type" : "list", + "description" : "A comma-separated list of index names to use as default" + }, + "type": { + "type" : "list", + "description" : "A comma-separated list of document types to use as default" + } + }, + "deprecated": { + "version" : "7.0.0", + "description" : "Specifying types in urls has been deprecated" + } + } + ] + }, + "params": { + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "query_and_fetch", + "dfs_query_then_fetch", + "dfs_query_and_fetch" + ], + "description":"Search operation type" + }, + "max_concurrent_searches" : { + "type" : "number", + "description" : "Controls the maximum number of concurrent searches the multi search api will execute" + }, + "typed_keys": { + "type" : "boolean", + "description" : "Specify whether aggregation and suggester names should be prefixed by their respective types in the response" + }, + "pre_filter_shard_size":{ + "type":"number", + "description" : "A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint." + }, + "max_concurrent_shard_requests" : { + "type" : "number", + "description" : "The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests", + "default" : 5 + }, + "rest_total_hits_as_int" : { + "type": "boolean", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default": false + }, + "ccs_minimize_roundtrips":{ + "type":"boolean", + "description":"Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", + "default":"true" + } + }, + "body":{ + "description":"The request definitions (metadata-search request definition pairs), separated by newlines", + "required":true, + "serialize":"bulk" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/msearch_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/msearch_template.json new file mode 100644 index 0000000000000..8eb300c975932 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/msearch_template.json @@ -0,0 +1,86 @@ +{ + "msearch_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html", + "description":"Allows to execute several search template operations in one request." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_msearch/template", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_msearch/template", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to use as default" + } + } + }, + { + "path" : "/{index}/{type}/_msearch/template", + "methods": ["GET", "POST"], + "parts": { + "index": { + "type" : "list", + "description" : "A comma-separated list of index names to use as default" + }, + "type": { + "type" : "list", + "description" : "A comma-separated list of document types to use as default" + } + }, + "deprecated": { + "version" : "7.0.0", + "description" : "Specifying types in urls has been deprecated" + } + } + ] + }, + "params": { + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "query_and_fetch", + "dfs_query_then_fetch", + "dfs_query_and_fetch" + ], + "description":"Search operation type" + }, + "typed_keys": { + "type" : "boolean", + "description" : "Specify whether aggregation and suggester names should be prefixed by their respective types in the response" + }, + "max_concurrent_searches" : { + "type" : "number", + "description" : "Controls the maximum number of concurrent searches the multi search api will execute" + }, + "rest_total_hits_as_int" : { + "type" : "boolean", + "description" : "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default" : false + }, + "ccs_minimize_roundtrips": { + "type" : "boolean", + "description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", + "default" : "true" + } + }, + "body":{ + "description":"The request definitions (metadata-search request definition pairs), separated by newlines", + "required":true, + "serialize":"bulk" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/mtermvectors.json b/rest-api-spec/out/production/resources/rest-api-spec/api/mtermvectors.json new file mode 100644 index 0000000000000..93dee177e8026 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/mtermvectors.json @@ -0,0 +1,117 @@ +{ + "mtermvectors":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html", + "description":"Returns multiple termvectors in one request." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_mtermvectors", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_mtermvectors", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The index in which the document resides." + } + } + }, + { + "path" : "/{index}/{type}/_mtermvectors", + "methods" : ["GET", "POST"], + "parts" : { + "index" : { + "type" : "string", + "description" : "The index in which the document resides." + }, + "type" : { + "type" : "string", + "description" : "The type of the document." + } + }, + "deprecated":{ + "version" : "7.0.0", + + "description" : "Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "ids":{ + "type":"list", + "description":"A comma-separated list of documents ids. You must define ids as parameter or set \"ids\" or \"docs\" in the request body" + }, + "term_statistics":{ + "type":"boolean", + "description":"Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "default":false + }, + "field_statistics":{ + "type":"boolean", + "description":"Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "default":true + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\"." + }, + "offsets":{ + "type":"boolean", + "description":"Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "default":true + }, + "positions":{ + "type":"boolean", + "description":"Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "default":true + }, + "payloads":{ + "type":"boolean", + "description":"Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "default":true + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\"." + }, + "routing":{ + "type":"string", + "description":"Specific routing value. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\"." + }, + "realtime":{ + "type":"boolean", + "description":"Specifies if requests are real-time as opposed to near-real-time (default: true)." + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + } + }, + "body":{ + "description":"Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation.", + "required":false + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.hot_threads.json b/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.hot_threads.json new file mode 100644 index 0000000000000..0830344dc4ad4 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.hot_threads.json @@ -0,0 +1,143 @@ +{ + "nodes.hot_threads":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html", + "description":"Returns information about hot threads on each node in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_nodes/hot_threads", + "methods":[ + "GET" + ] + }, + { + "path":"/_nodes/{node_id}/hot_threads", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + }, + { + "path":"/_cluster/nodes/hotthreads", + "methods":[ + "GET" + ], + "parts":{}, + "deprecated":{ + "version":"7.0.0", + "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + } + }, + { + "path":"/_cluster/nodes/{node_id}/hotthreads", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + } + }, + { + "path":"/_nodes/hotthreads", + "methods":[ + "GET" + ], + "parts":{}, + "deprecated":{ + "version":"7.0.0", + "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + } + }, + { + "path":"/_nodes/{node_id}/hotthreads", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + } + }, + { + "path":"/_cluster/nodes/hot_threads", + "methods":[ + "GET" + ], + "parts":{}, + "deprecated":{ + "version":"7.0.0", + "description":"The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" + } + }, + { + "path":"/_cluster/nodes/{node_id}/hot_threads", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" + } + } + ] + }, + "params":{ + "interval":{ + "type":"time", + "description":"The interval for the second sampling of threads" + }, + "snapshots":{ + "type":"number", + "description":"Number of samples of thread stacktrace (default: 10)" + }, + "threads":{ + "type":"number", + "description":"Specify the number of threads to provide information for (default: 3)" + }, + "ignore_idle_threads":{ + "type":"boolean", + "description":"Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true)" + }, + "type":{ + "type":"enum", + "options":[ + "cpu", + "wait", + "block" + ], + "description":"The type to sample (default: cpu)" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.info.json b/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.info.json new file mode 100644 index 0000000000000..37279edd3106f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.info.json @@ -0,0 +1,91 @@ +{ + "nodes.info":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html", + "description":"Returns information about nodes in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_nodes", + "methods":[ + "GET" + ] + }, + { + "path":"/_nodes/{node_id}", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + }, + { + "path":"/_nodes/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "settings", + "os", + "process", + "jvm", + "thread_pool", + "transport", + "http", + "plugins", + "ingest" + ], + "description":"A comma-separated list of metrics you wish returned. Leave empty to return all." + } + } + }, + { + "path":"/_nodes/{node_id}/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + }, + "metric":{ + "type":"list", + "options":[ + "settings", + "os", + "process", + "jvm", + "thread_pool", + "transport", + "http", + "plugins", + "ingest" + ], + "description":"A comma-separated list of metrics you wish returned. Leave empty to return all." + } + } + } + ] + }, + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.reload_secure_settings.json b/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.reload_secure_settings.json new file mode 100644 index 0000000000000..b1be8af3eee67 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.reload_secure_settings.json @@ -0,0 +1,37 @@ +{ + "nodes.reload_secure_settings":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings", + "description":"Reloads secure settings." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_nodes/reload_secure_settings", + "methods":[ + "POST" + ] + }, + { + "path":"/_nodes/{node_id}/reload_secure_settings", + "methods":[ + "POST" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes." + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.stats.json b/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.stats.json new file mode 100644 index 0000000000000..1aa57ee849c66 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.stats.json @@ -0,0 +1,224 @@ +{ + "nodes.stats":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html", + "description":"Returns statistical information about nodes in the cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_nodes/stats", + "methods":[ + "GET" + ] + }, + { + "path":"/_nodes/{node_id}/stats", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + }, + { + "path":"/_nodes/stats/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery" + ], + "description":"Limit the information returned to the specified metrics" + } + } + }, + { + "path":"/_nodes/{node_id}/stats/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery" + ], + "description":"Limit the information returned to the specified metrics" + }, + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + }, + { + "path":"/_nodes/stats/{metric}/{index_metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery" + ], + "description":"Limit the information returned to the specified metrics" + }, + "index_metric":{ + "type":"list", + "options":[ + "_all", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified." + } + } + }, + { + "path":"/_nodes/{node_id}/stats/{metric}/{index_metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery" + ], + "description":"Limit the information returned to the specified metrics" + }, + "index_metric":{ + "type":"list", + "options":[ + "_all", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified." + }, + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + } + ] + }, + "params":{ + "completion_fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)" + }, + "fielddata_fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` index metric (supports wildcards)" + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)" + }, + "groups":{ + "type":"boolean", + "description":"A comma-separated list of search groups for `search` index metric" + }, + "level":{ + "type":"enum", + "description":"Return indices stats aggregated at index, node or shard level", + "options":[ + "indices", + "node", + "shards" + ], + "default":"node" + }, + "types":{ + "type":"list", + "description":"A comma-separated list of document types for the `indexing` index metric" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "include_segment_file_sizes":{ + "type":"boolean", + "description":"Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)", + "default":false + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.usage.json b/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.usage.json new file mode 100644 index 0000000000000..5acbf7a51116c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.usage.json @@ -0,0 +1,73 @@ +{ + "nodes.usage":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html", + "description":"Returns low-level information about REST actions usage on nodes." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_nodes/usage", + "methods":[ + "GET" + ] + }, + { + "path":"/_nodes/{node_id}/usage", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + }, + { + "path":"/_nodes/usage/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "rest_actions" + ], + "description":"Limit the information returned to the specified metrics" + } + } + }, + { + "path":"/_nodes/{node_id}/usage/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "rest_actions" + ], + "description":"Limit the information returned to the specified metrics" + }, + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/ping.json b/rest-api-spec/out/production/resources/rest-api-spec/api/ping.json new file mode 100644 index 0000000000000..0e787e039d09e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/ping.json @@ -0,0 +1,20 @@ +{ + "ping":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html", + "description":"Returns whether the cluster is running." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/", + "methods":[ + "HEAD" + ] + } + ] + }, + "params":{} + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/put_script.json b/rest-api-spec/out/production/resources/rest-api-spec/api/put_script.json new file mode 100644 index 0000000000000..750f7fdf4eb62 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/put_script.json @@ -0,0 +1,61 @@ +{ + "put_script":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html", + "description":"Creates or updates a script." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_scripts/{id}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Script ID" + } + } + }, + { + "path":"/_scripts/{id}/{context}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Script ID" + }, + "context":{ + "type":"string", + "description":"Script context" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master" + }, + "context":{ + "type":"string", + "description":"Context name to compile script against" + } + }, + "body":{ + "description":"The document", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/rank_eval.json b/rest-api-spec/out/production/resources/rest-api-spec/api/rank_eval.json new file mode 100644 index 0000000000000..eadf240192394 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/rank_eval.json @@ -0,0 +1,67 @@ +{ + "rank_eval":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html", + "description":"Allows to evaluate the quality of ranked search results over a set of typical search queries" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_rank_eval", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_rank_eval", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "dfs_query_then_fetch" + ], + "description":"Search operation type" + } + }, + "body":{ + "description":"The ranking evaluation search definition, including search requests, document ratings and ranking metric definition.", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/reindex.json b/rest-api-spec/out/production/resources/rest-api-spec/api/reindex.json new file mode 100644 index 0000000000000..2fbaf86cab616 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/reindex.json @@ -0,0 +1,62 @@ +{ + "reindex":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html", + "description":"Allows to copy documents from one index to another, optionally filtering the source\ndocuments by a query, changing the destination index settings, or fetching the\ndocuments from a remote cluster." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_reindex", + "methods":[ + "POST" + ] + } + ] + }, + "params":{ + "refresh":{ + "type":"boolean", + "description":"Should the affected indexes be refreshed?" + }, + "timeout":{ + "type":"time", + "default":"1m", + "description":"Time each individual bulk request should wait for shards that are unavailable." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "wait_for_completion":{ + "type":"boolean", + "default":true, + "description":"Should the request should block until the reindex is complete." + }, + "requests_per_second":{ + "type":"number", + "default":0, + "description":"The throttle to set on this request in sub-requests per second. -1 means no throttle." + }, + "scroll":{ + "type":"time", + "description":"Control how long to keep the search context alive", + "default":"5m" + }, + "slices":{ + "type":"number|string", + "default":1, + "description":"The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`." + }, + "max_docs":{ + "type":"number", + "description":"Maximum number of documents to process (default: all documents)" + } + }, + "body":{ + "description":"The search definition using the Query DSL and the prototype for the index request.", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/reindex_rethrottle.json b/rest-api-spec/out/production/resources/rest-api-spec/api/reindex_rethrottle.json new file mode 100644 index 0000000000000..d91365b3c49a5 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/reindex_rethrottle.json @@ -0,0 +1,32 @@ +{ + "reindex_rethrottle":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html", + "description":"Changes the number of requests per second for a particular Reindex operation." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_reindex/{task_id}/_rethrottle", + "methods":[ + "POST" + ], + "parts":{ + "task_id":{ + "type":"string", + "description":"The task id to rethrottle" + } + } + } + ] + }, + "params":{ + "requests_per_second":{ + "type":"number", + "required":true, + "description":"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/render_search_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/render_search_template.json new file mode 100644 index 0000000000000..c2c474edd9853 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/render_search_template.json @@ -0,0 +1,36 @@ +{ + "render_search_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html#_validating_templates", + "description":"Allows to use the Mustache language to pre-render a search definition." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_render/template", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/_render/template/{id}", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The id of the stored search template" + } + } + } + ] + }, + "body":{ + "description":"The search definition template and its params" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/scripts_painless_execute.json b/rest-api-spec/out/production/resources/rest-api-spec/api/scripts_painless_execute.json new file mode 100644 index 0000000000000..9f761fb452ba1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/scripts_painless_execute.json @@ -0,0 +1,24 @@ +{ + "scripts_painless_execute":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html", + "description":"Allows an arbitrary script to be executed and a result to be returned" + }, + "stability":"experimental", + "url":{ + "paths":[ + { + "path":"/_scripts/painless/_execute", + "methods":[ + "GET", + "POST" + ] + } + ] + }, + "params":{}, + "body":{ + "description":"The script to execute" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/scroll.json b/rest-api-spec/out/production/resources/rest-api-spec/api/scroll.json new file mode 100644 index 0000000000000..ea0cbe2675325 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/scroll.json @@ -0,0 +1,56 @@ +{ + "scroll":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll", + "description":"Allows to retrieve a large numbers of results from a single search request." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_search/scroll", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/_search/scroll/{scroll_id}", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "scroll_id":{ + "type":"string", + "description":"The scroll ID", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"A scroll id can be quite large and should be specified as part of the body" + } + } + ] + }, + "params":{ + "scroll":{ + "type":"time", + "description":"Specify how long a consistent view of the index should be maintained for scrolled search" + }, + "scroll_id":{ + "type":"string", + "description":"The scroll ID for scrolled search" + }, + "rest_total_hits_as_int":{ + "type":"boolean", + "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default":false + } + }, + "body":{ + "description":"The scroll ID if not passed by URL or query parameter." + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/search.json b/rest-api-spec/out/production/resources/rest-api-spec/api/search.json new file mode 100644 index 0000000000000..7770acc52f978 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/search.json @@ -0,0 +1,252 @@ +{ + "search":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html", + "description":"Returns results matching a query." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_search", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_search", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } + }, + { + "path" : "/{index}/{type}/_search", + "methods": ["GET", "POST"], + "parts": { + "index": { + "type" : "list", + "description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + }, + "type": { + "type": "list", + "description": "A comma-separated list of document types to search; leave empty to perform the operation on all types" + } + }, + "deprecated" : { + "version" : "7.0.0", + "description" : "Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "analyzer":{ + "type":"string", + "description":"The analyzer to use for the query string" + }, + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" + }, + "ccs_minimize_roundtrips":{ + "type":"boolean", + "description":"Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", + "default":"true" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The field to use as default where no field prefix is given in the query string" + }, + "explain":{ + "type":"boolean", + "description":"Specify whether to return detailed information about score computation as part of a hit" + }, + "stored_fields":{ + "type":"list", + "description":"A comma-separated list of stored fields to return as part of a hit" + }, + "docvalue_fields":{ + "type":"list", + "description":"A comma-separated list of fields to return as the docvalue representation of a field for each hit" + }, + "from":{ + "type":"number", + "description":"Starting offset (default: 0)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "ignore_throttled":{ + "type":"boolean", + "description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "routing":{ + "type":"list", + "description":"A comma-separated list of specific routing values" + }, + "scroll":{ + "type":"time", + "description":"Specify how long a consistent view of the index should be maintained for scrolled search" + }, + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "dfs_query_then_fetch" + ], + "description":"Search operation type" + }, + "size":{ + "type":"number", + "description":"Number of hits to return (default: 10)" + }, + "sort":{ + "type":"list", + "description":"A comma-separated list of : pairs" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "terminate_after":{ + "type":"number", + "description":"The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." + }, + "stats":{ + "type":"list", + "description":"Specific 'tag' of the request for logging and statistical purposes" + }, + "suggest_field":{ + "type":"string", + "description":"Specify which field to use for suggestions" + }, + "suggest_mode":{ + "type":"enum", + "options":[ + "missing", + "popular", + "always" + ], + "default":"missing", + "description":"Specify suggest mode" + }, + "suggest_size":{ + "type":"number", + "description":"How many suggestions to return in response" + }, + "suggest_text":{ + "type":"string", + "description":"The source text for which the suggestions should be returned" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "track_scores":{ + "type":"boolean", + "description":"Whether to calculate and return scores even if they are not used for sorting" + }, + "track_total_hits":{ + "type":"boolean", + "description":"Indicate if the number of documents that match the query should be tracked" + }, + "allow_partial_search_results":{ + "type":"boolean", + "default":true, + "description":"Indicate if an error should be returned if there is a partial search failure or timeout" + }, + "typed_keys":{ + "type":"boolean", + "description":"Specify whether aggregation and suggester names should be prefixed by their respective types in the response" + }, + "version":{ + "type":"boolean", + "description":"Specify whether to return document version as part of a hit" + }, + "seq_no_primary_term":{ + "type":"boolean", + "description":"Specify whether to return sequence number and primary term of the last modification of each hit" + }, + "request_cache":{ + "type":"boolean", + "description":"Specify if request cache should be used for this request or not, defaults to index level setting" + }, + "batched_reduce_size":{ + "type":"number", + "description":"The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.", + "default":512 + }, + "max_concurrent_shard_requests":{ + "type":"number", + "description":"The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests", + "default":5 + }, + "pre_filter_shard_size":{ + "type":"number", + "description":"A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint." + }, + "rest_total_hits_as_int":{ + "type":"boolean", + "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default":false + } + }, + "body":{ + "description":"The search definition using the Query DSL" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/search_shards.json b/rest-api-spec/out/production/resources/rest-api-spec/api/search_shards.json new file mode 100644 index 0000000000000..74b7055b4c4b0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/search_shards.json @@ -0,0 +1,67 @@ +{ + "search_shards":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html", + "description":"Returns information about the indices and shards that a search request would be executed against." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_search_shards", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_search_shards", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/search_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/search_template.json new file mode 100644 index 0000000000000..00bd09729c908 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/search_template.json @@ -0,0 +1,125 @@ +{ + "search_template":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html", + "description":"Allows to use the Mustache language to pre-render a search definition." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_search/template", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_search/template", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } + }, + { + "path" : "/{index}/{type}/_search/template", + "methods": ["GET", "POST"], + "parts": { + "index": { + "type" : "list", + "description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + }, + "type": { + "type" : "list", + "description" : "A comma-separated list of document types to search; leave empty to perform the operation on all types" + } + }, + "deprecated" : { + "version" : "7.0.0", + "description" : "Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "ignore_throttled":{ + "type":"boolean", + "description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "routing":{ + "type":"list", + "description":"A comma-separated list of specific routing values" + }, + "scroll":{ + "type":"time", + "description":"Specify how long a consistent view of the index should be maintained for scrolled search" + }, + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "query_and_fetch", + "dfs_query_then_fetch", + "dfs_query_and_fetch" + ], + "description":"Search operation type" + }, + "explain":{ + "type":"boolean", + "description":"Specify whether to return detailed information about score computation as part of a hit" + }, + "profile":{ + "type":"boolean", + "description":"Specify whether to profile the query execution" + }, + "typed_keys":{ + "type":"boolean", + "description":"Specify whether aggregation and suggester names should be prefixed by their respective types in the response" + }, + "rest_total_hits_as_int":{ + "type":"boolean", + "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default":false + }, + "ccs_minimize_roundtrips": { + "type" : "boolean", + "description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", + "default" : "true" + } + }, + "body":{ + "description":"The search definition template and its params", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.cleanup_repository.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.cleanup_repository.json new file mode 100644 index 0000000000000..1d216dcb0b322 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.cleanup_repository.json @@ -0,0 +1,36 @@ +{ + "snapshot.cleanup_repository": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description": "Removes stale data from repository." + }, + "stability": "stable", + "url": { + "paths": [ + { + "path": "/_snapshot/{repository}/_cleanup", + "methods": [ + "POST" + ], + "parts": { + "repository": { + "type": "string", + "description": "A repository name" + } + } + } + ] + }, + "params": { + "master_timeout": { + "type" : "time", + "description" : "Explicit operation timeout for connection to master node" + }, + "timeout": { + "type" : "time", + "description" : "Explicit operation timeout" + } + }, + "body": {} + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create.json new file mode 100644 index 0000000000000..da8cb9916f584 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create.json @@ -0,0 +1,45 @@ +{ + "snapshot.create":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Creates a snapshot in a repository." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/{snapshot}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"string", + "description":"A snapshot name" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "wait_for_completion":{ + "type":"boolean", + "description":"Should this request wait until the operation has completed before returning", + "default":false + } + }, + "body":{ + "description":"The snapshot definition", + "required":false + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create_repository.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create_repository.json new file mode 100644 index 0000000000000..431ac3c68c0bd --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create_repository.json @@ -0,0 +1,44 @@ +{ + "snapshot.create_repository":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Creates a repository." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "verify":{ + "type":"boolean", + "description":"Whether to verify the repository after creation" + } + }, + "body":{ + "description":"The repository definition", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete.json new file mode 100644 index 0000000000000..30053cd5b94d3 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete.json @@ -0,0 +1,35 @@ +{ + "snapshot.delete":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Deletes a snapshot." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/{snapshot}", + "methods":[ + "DELETE" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"string", + "description":"A snapshot name" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete_repository.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete_repository.json new file mode 100644 index 0000000000000..b94c5f39b4f22 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete_repository.json @@ -0,0 +1,35 @@ +{ + "snapshot.delete_repository":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Deletes a repository." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}", + "methods":[ + "DELETE" + ], + "parts":{ + "repository":{ + "type":"list", + "description":"A comma-separated list of repository names" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get.json new file mode 100644 index 0000000000000..20006f6f499b6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get.json @@ -0,0 +1,43 @@ +{ + "snapshot.get":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Returns information about a snapshot." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/{snapshot}", + "methods":[ + "GET" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"list", + "description":"A comma-separated list of snapshot names" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown" + }, + "verbose":{ + "type":"boolean", + "description":"Whether to show verbose snapshot info or only show the basic info found in the repository index blob" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get_repository.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get_repository.json new file mode 100644 index 0000000000000..8c91caa4fe81f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get_repository.json @@ -0,0 +1,41 @@ +{ + "snapshot.get_repository":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Returns information about a repository." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot", + "methods":[ + "GET" + ] + }, + { + "path":"/_snapshot/{repository}", + "methods":[ + "GET" + ], + "parts":{ + "repository":{ + "type":"list", + "description":"A comma-separated list of repository names" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.restore.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.restore.json new file mode 100644 index 0000000000000..697ea395dcc2b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.restore.json @@ -0,0 +1,44 @@ +{ + "snapshot.restore":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Restores a snapshot." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/{snapshot}/_restore", + "methods":[ + "POST" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"string", + "description":"A snapshot name" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "wait_for_completion":{ + "type":"boolean", + "description":"Should this request wait until the operation has completed before returning", + "default":false + } + }, + "body":{ + "description":"Details of what to restore", + "required":false + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.status.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.status.json new file mode 100644 index 0000000000000..70a7ba23ef506 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.status.json @@ -0,0 +1,57 @@ +{ + "snapshot.status":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Returns information about the status of a snapshot." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/_status", + "methods":[ + "GET" + ] + }, + { + "path":"/_snapshot/{repository}/_status", + "methods":[ + "GET" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + } + } + }, + { + "path":"/_snapshot/{repository}/{snapshot}/_status", + "methods":[ + "GET" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"list", + "description":"A comma-separated list of snapshot names" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.verify_repository.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.verify_repository.json new file mode 100644 index 0000000000000..de638c19d4a0b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.verify_repository.json @@ -0,0 +1,35 @@ +{ + "snapshot.verify_repository":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", + "description":"Verifies a repository." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/_verify", + "methods":[ + "POST" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.cancel.json b/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.cancel.json new file mode 100644 index 0000000000000..d9d681899868d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.cancel.json @@ -0,0 +1,45 @@ +{ + "tasks.cancel":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", + "description":"Cancels a task, if it can be cancelled through an API." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_tasks/_cancel", + "methods":[ + "POST" + ] + }, + { + "path":"/_tasks/{task_id}/_cancel", + "methods":[ + "POST" + ], + "parts":{ + "task_id":{ + "type":"string", + "description":"Cancel the task with specified task id (node_id:task_number)" + } + } + } + ] + }, + "params":{ + "nodes":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + }, + "actions":{ + "type":"list", + "description":"A comma-separated list of actions that should be cancelled. Leave empty to cancel all." + }, + "parent_task_id":{ + "type":"string", + "description":"Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.get.json b/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.get.json new file mode 100644 index 0000000000000..63bd1b6a96e98 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.get.json @@ -0,0 +1,35 @@ +{ + "tasks.get":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", + "description":"Returns information about a task." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_tasks/{task_id}", + "methods":[ + "GET" + ], + "parts":{ + "task_id":{ + "type":"string", + "description":"Return the task with specified id (node_id:task_number)" + } + } + } + ] + }, + "params":{ + "wait_for_completion":{ + "type":"boolean", + "description":"Wait for the matching tasks to complete (default: false)" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.list.json b/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.list.json new file mode 100644 index 0000000000000..0aba6d6391d48 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.list.json @@ -0,0 +1,55 @@ +{ + "tasks.list":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", + "description":"Returns a list of tasks." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_tasks", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "nodes":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + }, + "actions":{ + "type":"list", + "description":"A comma-separated list of actions that should be returned. Leave empty to return all." + }, + "detailed":{ + "type":"boolean", + "description":"Return detailed task information (default: false)" + }, + "parent_task_id":{ + "type":"string", + "description":"Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all." + }, + "wait_for_completion":{ + "type":"boolean", + "description":"Wait for the matching tasks to complete (default: false)" + }, + "group_by":{ + "type":"enum", + "description":"Group tasks by nodes or parent/child relationships", + "options":[ + "nodes", + "parents", + "none" + ], + "default":"nodes" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/termvectors.json b/rest-api-spec/out/production/resources/rest-api-spec/api/termvectors.json new file mode 100644 index 0000000000000..dd7fac97d79a7 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/termvectors.json @@ -0,0 +1,148 @@ +{ + "termvectors":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html", + "description":"Returns information and statistics about terms in the fields of a particular document." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_termvectors/{id}", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The index in which the document resides." + }, + "id":{ + "type":"string", + "description":"The id of the document, when not specified a doc param should be supplied." + } + } + }, + { + "path":"/{index}/_termvectors", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The index in which the document resides." + } + } + }, + { + "path" : "/{index}/{type}/{id}/_termvectors", + "methods" : ["GET", "POST"], + "parts" : { + "index" : { + "type" : "string", + "description" : "The index in which the document resides.", + "required" : true + }, + "type" : { + "type" : "string", + "description" : "The type of the document.", + "required" : false + }, + "id" : { + "type" : "string", + "description" : "The id of the document, when not specified a doc param should be supplied." + } + }, + "deprecated": { + "version" : "7.0.0", + "description" : "Specifying types in urls has been deprecated" + } + }, + { + "path" : "/{index}/{type}/_termvectors", + "methods" : ["GET", "POST"], + "parts" : { + "index" : { + "type" : "string", + "description" : "The index in which the document resides.", + "required" : true + }, + "type" : { + "type" : "string", + "description" : "The type of the document.", + "required" : false + } + }, + "deprecated": { + "version" : "7.0.0", + "description" : "Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "term_statistics":{ + "type":"boolean", + "description":"Specifies if total term frequency and document frequency should be returned.", + "default":false + }, + "field_statistics":{ + "type":"boolean", + "description":"Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.", + "default":true + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to return." + }, + "offsets":{ + "type":"boolean", + "description":"Specifies if term offsets should be returned.", + "default":true + }, + "positions":{ + "type":"boolean", + "description":"Specifies if term positions should be returned.", + "default":true + }, + "payloads":{ + "type":"boolean", + "description":"Specifies if term payloads should be returned.", + "default":true + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)." + }, + "routing":{ + "type":"string", + "description":"Specific routing value." + }, + "realtime":{ + "type":"boolean", + "description":"Specifies if request is real-time as opposed to near-real-time (default: true)." + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + } + }, + "body":{ + "description":"Define parameters and or supply a document to get termvectors for. See documentation.", + "required":false + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/update.json b/rest-api-spec/out/production/resources/rest-api-spec/api/update.json new file mode 100644 index 0000000000000..45b6f764387eb --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/update.json @@ -0,0 +1,109 @@ +{ + "update":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html", + "description":"Updates a document with a script or partial document." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_update/{id}", + "methods":[ + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + }, + { + "path":"/{index}/{type}/{id}/_update", + "methods":[ + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + }, + "type":{ + "type":"string", + "description":"The type of the document", + "deprecated":true + } + }, + "deprecated":{ + "version":"7.0.0", + "description":"Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "lang":{ + "type":"string", + "description":"The script language (default: painless)" + }, + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "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." + }, + "retry_on_conflict":{ + "type":"number", + "description":"Specify how many times should the operation be retried when a conflict occurs (default: 0)" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "if_seq_no":{ + "type":"number", + "description":"only perform the update operation if the last operation that has changed the document has the specified sequence number" + }, + "if_primary_term":{ + "type":"number", + "description":"only perform the update operation if the last operation that has changed the document has the specified primary term" + } + }, + "body":{ + "description":"The request definition requires either `script` or partial `doc`", + "required":true + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query.json b/rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query.json new file mode 100644 index 0000000000000..eb4c7ea258b3b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query.json @@ -0,0 +1,217 @@ +{ + "update_by_query":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html", + "description":"Performs an update on every document in the index without changing the source,\nfor example to pick up a mapping change." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/{index}/_update_by_query", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } + }, + { + "path" : "/{index}/{type}/_update_by_query", + "methods": ["POST"], + "parts": { + "index": { + "required": true, + "type": "list", + "description": "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + }, + "type": { + "type": "list", + "description": "A comma-separated list of document types to search; leave empty to perform the operation on all types" + } + }, + "deprecated" : { + "version" : "7.0.0", + "description" : "Specifying types in urls has been deprecated" + } + } + ] + }, + "params":{ + "analyzer":{ + "type":"string", + "description":"The analyzer to use for the query string" + }, + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The field to use as default where no field prefix is given in the query string" + }, + "from":{ + "type":"number", + "description":"Starting offset (default: 0)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "conflicts":{ + "note":"This is not copied from search", + "type":"enum", + "options":[ + "abort", + "proceed" + ], + "default":"abort", + "description":"What to do when the update by query hits version conflicts?" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "pipeline":{ + "type":"string", + "description":"Ingest pipeline to set on index requests made by this action. (default: none)" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "routing":{ + "type":"list", + "description":"A comma-separated list of specific routing values" + }, + "scroll":{ + "type":"time", + "description":"Specify how long a consistent view of the index should be maintained for scrolled search" + }, + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "dfs_query_then_fetch" + ], + "description":"Search operation type" + }, + "search_timeout":{ + "type":"time", + "description":"Explicit timeout for each search request. Defaults to no timeout." + }, + "size": { + "type" : "number", + "description" : "Deprecated, please use `max_docs` instead" + }, + "max_docs":{ + "type":"number", + "description":"Maximum number of documents to process (default: all documents)" + }, + "sort":{ + "type":"list", + "description":"A comma-separated list of : pairs" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "terminate_after":{ + "type":"number", + "description":"The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." + }, + "stats":{ + "type":"list", + "description":"Specific 'tag' of the request for logging and statistical purposes" + }, + "version":{ + "type":"boolean", + "description":"Specify whether to return document version as part of a hit" + }, + "version_type":{ + "type":"boolean", + "description":"Should the document increment the version number (internal) on hit or not (reindex)" + }, + "request_cache":{ + "type":"boolean", + "description":"Specify if request cache should be used for this request or not, defaults to index level setting" + }, + "refresh":{ + "type":"boolean", + "description":"Should the affected indexes be refreshed?" + }, + "timeout":{ + "type":"time", + "default":"1m", + "description":"Time each individual bulk request should wait for shards that are unavailable." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "scroll_size":{ + "type":"number", + "defaut_value":100, + "description":"Size on the scroll request powering the update by query" + }, + "wait_for_completion":{ + "type":"boolean", + "default":true, + "description":"Should the request should block until the update by query operation is complete." + }, + "requests_per_second":{ + "type":"number", + "default":0, + "description":"The throttle to set on this request in sub-requests per second. -1 means no throttle." + }, + "slices":{ + "type":"number|string", + "default":1, + "description":"The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`." + } + }, + "body":{ + "description":"The search definition using the Query DSL" + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query_rethrottle.json b/rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query_rethrottle.json new file mode 100644 index 0000000000000..bd70f6e1231c9 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query_rethrottle.json @@ -0,0 +1,32 @@ +{ + "update_by_query_rethrottle":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html", + "description":"Changes the number of requests per second for a particular Update By Query operation." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_update_by_query/{task_id}/_rethrottle", + "methods":[ + "POST" + ], + "parts":{ + "task_id":{ + "type":"string", + "description":"The task id to rethrottle" + } + } + } + ] + }, + "params":{ + "requests_per_second":{ + "type":"number", + "required":true, + "description":"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." + } + } + } +} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/README.asciidoc b/rest-api-spec/out/production/resources/rest-api-spec/test/README.asciidoc new file mode 100644 index 0000000000000..920fedd3e7414 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/README.asciidoc @@ -0,0 +1,387 @@ +Test Suite: +=========== + +[NOTE] +.Required settings +======================================= +Certain tests require specific settings to be applied to the +Elasticsearch instance in order to pass. You should run +Elasticsearch as follows: + +[source,sh] +--------------------- +bin/elasticsearch -Enode.attr.testattr=test -Epath.repo=/tmp -Erepositories.url.allowed_urls='http://snapshot.*' +--------------------- + +======================================= + +Test file structure +-------------------- + +A YAML test file consists of: + +- an optional `setup` section, followed by +- an optional `teardown` section, followed by +- one or more test sections + +For instance: + + setup: + - do: .... + - do: .... + + --- + teardown: + - do: .... + + --- + "First test": + - do: ... + - match: ... + + --- + "Second test": + - do: ... + - match: ... + + +A `setup` section contains a list of commands to run before each test +section in order to setup the same environment for each test section. + +A `teardown` section contains a list of commands to run after each test +section in order to setup the same environment for each test section. This +may be needed for modifications made by the test that are not cleared by the +deletion of indices and templates. + +A test section represents an independent test, containing multiple `do` +statements and assertions. The contents of a test section must be run in +order, but individual test sections may be run in any order, as follows: + +1. run `setup` (if any) +2. reset the `response` var and the `stash` (see below) +2. run test contents +3. run `teardown` (if any) +4. delete all indices and all templates + +Dot notation: +------------- +Dot notation is used for (1) method calls and (2) hierarchical data structures. For +instance, a method call like `cluster.health` would do the equivalent of: + + client.cluster.health(...params...) + +A test against `_tokens.1.token` would examine the `token` key, in the second element +of the `tokens` array, inside the `response` var (see below): + + $val = $response->{tokens}[1]{token} # Perl syntax roolz! + +If one of the levels (eg `tokens`) does not exist, it should return an undefined value. +If no field name is given (ie the empty string) then return the current +$val -- used for testing the whole response body. + +Use \. to specify paths that actually contain '.' in the key name, for example +in the `indices.get_settings` API. + +Skipping tests: +--------------- +If a test section should only be run on certain versions of Elasticsearch, +then the first entry in the section (after the title) should be called +`skip`, and should contain the range of versions to be +skipped, and the reason why the tests are skipped. For instance: + +.... + "Parent": + - skip: + version: "0.20.1 - 0.90.2" + reason: Delete ignores the parent param + + - do: + ... test definitions ... +.... + +All tests in the file following the skip statement should be skipped if: +`min <= current <= max`. + +The `version` range can leave either bound empty, which means "open ended". +For instance: +.... + "Parent": + - skip: + version: "1.0.0.Beta1 - " + reason: Delete ignores the parent param + + - do: + ... test definitions ... +.... + +The skip section can also be used to list new features that need to be +supported in order to run a test. This way the up-to-date runners will +run the test, while the ones that don't support the feature yet can +temporarily skip it, and avoid having lots of test failures in the meantime. +Once all runners have implemented the feature, it can be declared supported +by default, thus the related skip sections can be removed from the tests. + +.... + "Parent": + - skip: + features: regex + + - do: + ... test definitions ... +.... + +The `features` field can either be a string or an array of strings. +The skip section requires to specify either a `version` or a `features` list. + +Required operators: +------------------- + +=== `do` + +The `do` operator calls a method on the client. For instance: + +.... + - do: + cluster.health: + level: shards +.... + +The response from the `do` operator should be stored in the `response` var, which +is reset (1) at the beginning of a file or (2) on the next `do`. + +If the arguments to `do` include `catch`, then we are expecting an error, which should +be caught and tested. For instance: + +.... + - do: + catch: missing + get: + index: test + type: test + id: 1 +.... + +The argument to `catch` can be any of: + +[horizontal] +`bad_request`:: a 400 response from ES +`unauthorized`:: a 401 response from ES +`forbidden`:: a 403 response from ES +`missing`:: a 404 response from ES +`request_timeout`:: a 408 response from ES +`conflict`:: a 409 response from ES +`request`:: a 4xx-5xx error response from ES, not equal to any named response + above +`unavailable`:: a 503 response from ES +`param`:: a client-side error indicating an unknown parameter has been passed + to the method +`/foo bar/`:: the text of the error message matches this regular expression + +If `catch` is specified, then the `response` var must be cleared, and the test +should fail if no error is thrown. + +If the arguments to `do` include `warnings` then we are expecting a `Warning` +header to come back from the request. If the arguments *don't* include a +`warnings` argument then we *don't* expect the response to include a `Warning` +header. The warnings must match exactly. Using it looks like this: + +.... + - do: + warnings: + - '[index] is deprecated' + - quotes are not required because yaml + - but this argument is always a list, never a single string + - no matter how many warnings you expect + get: + index: test + type: test + id: 1 +.... + +If the arguments to `do` include `allowed_warnings` then matching `Warning` +headers do not fail the request. Unlike the `warnings` argument, these aren't +expected so much as "allowed". This usually comes up in backwards compatibility +testing. Using it looks like this: + +.... + - do: + allowed_warnings: + - some warning + - this argument is also always a list, never a single string + - no matter how many warnings you expect + get: + index: test + type: test + id: 1 +.... + +If the arguments to `do` include `node_selector` then the request is only +sent to nodes that match the `node_selector`. It looks like this: + +.... +"test id": + - skip: + features: node_selector + - do: + node_selector: + version: " - 6.9.99" + index: + index: test-weird-index-中文 + type: weird.type + id: 1 + body: { foo: bar } +.... + +If you list multiple selectors then the request will only go to nodes that +match all of those selectors. The following selectors are supported: + +- `version`: Only nodes who's version is within the range will receive the +request. The syntax for the pattern is the same as when `version` is within +`skip`. +- `attribute`: Only nodes that have an attribute matching the name and value +of the provided attribute match. +Looks like: +.... + node_selector: + attribute: + name: value +.... + +=== `set` + +For some tests, it is necessary to extract a value from the previous `response`, in +order to reuse it in a subsequent `do` and other tests. For instance, when +testing indexing a document without a specified ID: + +.... + - do: + index: + index: test + type: test + - set: { _id: id } # stash the value of `response._id` as `id` + - do: + get: + index: test + type: test + id: $id # replace `$id` with the stashed value + - match: { _id: $id } # the returned `response._id` matches the stashed `id` +.... + +The last response obtained gets always stashed automatically as a string, called `body`. +This is useful when needing to test apis that return text rather than json (e.g. cat api), +as it allows to treat the whole body as an ordinary string field. + +Stashed values can be used in property names, eg: + +.... + - do: + cluster.state: {} + + - set: {master_node: master} + + - do: + nodes.info: + metric: [ transport ] + + - is_true: nodes.$master.transport.profiles +.... + + +Note that not only expected values can be retrieved from the stashed values (as in the +example above), but the same goes for actual values: + +.... + - match: { $body: /^.+$/ } # the returned `body` matches the provided regex if the body is text + - match: { $body: {} } # the returned `body` matches the JSON object if the body is JSON +.... + +The stash should be reset at the beginning of each test file. + +=== `transform_and_set` + +For some tests, it is necessary to extract a value and transform it from the previous `response`, in +order to reuse it in a subsequent `do` and other tests. +Currently, it only has support for `base64EncodeCredentials`, for unknown transformations it will not +do anything and stash the value as is. +For instance, when testing you may want to base64 encode username and password for +`Basic` authorization header: + +.... + - do: + index: + index: test + type: test + - transform_and_set: { login_creds: "#base64EncodeCredentials(user,password)" } # stash the base64 encoded credentials of `response.user` and `response.password` as `login_creds` + - do: + headers: + Authorization: Basic ${login_creds} # replace `$login_creds` with the stashed value + get: + index: test + type: test +.... + +Stashed values can be used as described in the `set` section + +=== `is_true` + +The specified key exists and has a true value (ie not `0`, `false`, `undefined`, `null` +or the empty string), eg: + +.... + - is_true: fields.foo # the foo key exists in the fields hash and is "true" +.... + +=== `is_false` + +The specified key doesn't exist or has a false value (ie `0`, `false`, `undefined`, +`null` or the empty string), eg: + +.... + - is_false: fields._source # the _source key doesn't exist in the fields hash or is "false" +.... + +=== `match` + +Used to compare two variables (could be scalars, arrays or hashes). The two variables +should be identical, eg: + +.... + - match: { _source: { foo: bar }} +.... + +Supports also regular expressions with flag X for more readability (accepts whitespaces and comments): + +.... + - match: + $body: > + /^ epoch \s+ timestamp \s+ count \s+ \n + \d+ \s+ \d{2}:\d{2}:\d{2} \s+ \d+ \s+ \n $/ +.... + +**Note:** `$body` is used to refer to the last obtained response body as a string, while `''` refers to the parsed representation (parsed into a Map by the Java runner for instance). Having the raw string response is for example useful when testing cat APIs. + +=== `lt` and `gt` + +Compares two numeric values, eg: + +.... + - lt: { foo: 10000 } # the `foo` value is less than 10,000 +.... + +=== `lte` and `gte` + +Compares two numeric values, eg: + +.... + - lte: { foo: 10000 } # the `foo` value is less than or equal to 10,000 +.... + +=== `length` + +This depends on the datatype of the value being examined, eg: + +.... + - length: { _id: 22 } # the `_id` string is 22 chars long + - length: { _tokens: 3 } # the `_tokens` array has 3 elements + - length: { _source: 5 } # the `_source` hash has 5 keys +.... diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/10_basic.yml new file mode 100644 index 0000000000000..95ee564d0c1a3 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/10_basic.yml @@ -0,0 +1,124 @@ +--- +"Array of objects": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + bulk: + refresh: true + body: + - index: + _index: test_index + _id: test_id + - f1: v1 + f2: 42 + - index: + _index: test_index + _id: test_id2 + - f1: v2 + f2: 47 + + - do: + count: + index: test_index + + - match: {count: 2} + +--- +"Empty _id": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + bulk: + refresh: true + body: + - index: + _index: test + _id: '' + - f: 1 + - index: + _index: test + _id: id + - f: 2 + - index: + _index: test + - f: 3 + - match: { errors: true } + - match: { items.0.index.status: 400 } + - match: { items.0.index.error.type: illegal_argument_exception } + - match: { items.0.index.error.reason: if _id is specified it must not be empty } + - match: { items.1.index.result: created } + - match: { items.2.index.result: created } + + - do: + count: + index: test + + - match: { count: 2 } + +--- +"Empty _id with op_type create": + - skip: + version: " - 7.4.99" + reason: "auto id + op type create only supported since 7.5" + + - do: + bulk: + refresh: true + body: + - index: + _index: test + _id: '' + - f: 1 + - index: + _index: test + _id: id + - f: 2 + - index: + _index: test + - f: 3 + - create: + _index: test + - f: 4 + - index: + _index: test + op_type: create + - f: 5 + - match: { errors: true } + - match: { items.0.index.status: 400 } + - match: { items.0.index.error.type: illegal_argument_exception } + - match: { items.0.index.error.reason: if _id is specified it must not be empty } + - match: { items.1.index.result: created } + - match: { items.2.index.result: created } + - match: { items.3.create.result: created } + - match: { items.4.create.result: created } + + - do: + count: + index: test + + - match: { count: 4 } + + +--- +"empty action": + + - skip: + version: " - 6.99.99" + features: headers + reason: types are required in requests before 7.0.0 + + - do: + catch: /Malformed action\/metadata line \[3\], expected FIELD_NAME but found \[END_OBJECT\]/ + headers: + Content-Type: application/json + bulk: + body: | + {"index": {"_index": "test_index", "_id": "test_id"}} + {"f1": "v1", "f2": 42} + {} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/11_basic_with_types.yml new file mode 100644 index 0000000000000..6bebed7bc1dd0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/11_basic_with_types.yml @@ -0,0 +1,120 @@ +--- +"Array of objects": + - do: + bulk: + refresh: true + body: + - index: + _index: test_index + _type: test_type + _id: test_id + - f1: v1 + f2: 42 + - index: + _index: test_index + _type: test_type + _id: test_id2 + - f1: v2 + f2: 47 + + - do: + count: + index: test_index + + - match: {count: 2} + +--- +"Empty _id": + - do: + bulk: + refresh: true + body: + - index: + _index: test + _type: type + _id: '' + - f: 1 + - index: + _index: test + _type: type + _id: id + - f: 2 + - index: + _index: test + _type: type + - f: 3 + - match: { errors: true } + - match: { items.0.index.status: 400 } + - match: { items.0.index.error.type: illegal_argument_exception } + - match: { items.0.index.error.reason: if _id is specified it must not be empty } + - match: { items.1.index.result: created } + - match: { items.2.index.result: created } + + - do: + count: + index: test + + - match: { count: 2 } + +--- +"Empty _id with op_type create": + - skip: + version: " - 7.4.99" + reason: "auto id + op type create only supported since 7.5" + + - do: + bulk: + refresh: true + body: + - index: + _index: test + _type: type + _id: '' + - f: 1 + - index: + _index: test + _type: type + _id: id + - f: 2 + - index: + _index: test + _type: type + - f: 3 + - create: + _index: test + _type: type + - f: 4 + - index: + _index: test + _type: type + op_type: create + - f: 5 + - match: { errors: true } + - match: { items.0.index.status: 400 } + - match: { items.0.index.error.type: illegal_argument_exception } + - match: { items.0.index.error.reason: if _id is specified it must not be empty } + - match: { items.1.index.result: created } + - match: { items.2.index.result: created } + - match: { items.3.create.result: created } + - match: { items.4.create.result: created } + + - do: + count: + index: test + + - match: { count: 4 } + +--- +"empty action": + - skip: + features: headers + + - do: + catch: /Malformed action\/metadata line \[3\], expected FIELD_NAME but found \[END_OBJECT\]/ + headers: + Content-Type: application/json + bulk: + body: | + {"index": {"_index": "test_index", "_type": "test_type", "_id": "test_id"}} + {"f1": "v1", "f2": 42} + {} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/20_list_of_strings.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/20_list_of_strings.yml new file mode 100644 index 0000000000000..b23517f6a8f25 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/20_list_of_strings.yml @@ -0,0 +1,21 @@ +--- +"List of strings": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + bulk: + refresh: true + body: + - '{"index": {"_index": "test_index", "_id": "test_id"}}' + - '{"f1": "v1", "f2": 42}' + - '{"index": {"_index": "test_index", "_id": "test_id2"}}' + - '{"f1": "v2", "f2": 47}' + + - do: + count: + index: test_index + + - match: {count: 2} + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/21_list_of_strings_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/21_list_of_strings_with_types.yml new file mode 100644 index 0000000000000..def91f4280722 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/21_list_of_strings_with_types.yml @@ -0,0 +1,17 @@ +--- +"List of strings": + - do: + bulk: + refresh: true + body: + - '{"index": {"_index": "test_index", "_type": "test_type", "_id": "test_id"}}' + - '{"f1": "v1", "f2": 42}' + - '{"index": {"_index": "test_index", "_type": "test_type", "_id": "test_id2"}}' + - '{"f1": "v2", "f2": 47}' + + - do: + count: + index: test_index + + - match: {count: 2} + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/30_big_string.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/30_big_string.yml new file mode 100644 index 0000000000000..38706d133e44b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/30_big_string.yml @@ -0,0 +1,21 @@ +--- +"One big string": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + bulk: + refresh: true + body: | + {"index": {"_index": "test_index", "_id": "test_id"}} + {"f1": "v1", "f2": 42} + {"index": {"_index": "test_index", "_id": "test_id2"}} + {"f1": "v2", "f2": 47} + + - do: + count: + index: test_index + + - match: {count: 2} + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/31_big_string_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/31_big_string_with_types.yml new file mode 100644 index 0000000000000..1d117253c9b01 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/31_big_string_with_types.yml @@ -0,0 +1,17 @@ +--- +"One big string": + - do: + bulk: + refresh: true + body: | + {"index": {"_index": "test_index", "_type": "test_type", "_id": "test_id"}} + {"f1": "v1", "f2": 42} + {"index": {"_index": "test_index", "_type": "test_type", "_id": "test_id2"}} + {"f1": "v2", "f2": 47} + + - do: + count: + index: test_index + + - match: {count: 2} + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/40_source.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/40_source.yml new file mode 100644 index 0000000000000..5e783d60d3d46 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/40_source.yml @@ -0,0 +1,75 @@ +--- +"Source filtering": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + index: + refresh: true + index: test_index + id: test_id_1 + body: { "foo": "bar", "bar": "foo" } + + - do: + index: + refresh: true + index: test_index + id: test_id_2 + body: { "foo": "qux", "bar": "pux" } + + - do: + index: + refresh: true + index: test_index + id: test_id_3 + body: { "foo": "corge", "bar": "forge" } + + + - do: + bulk: + refresh: true + body: | + { "update": { "_index": "test_index", "_id": "test_id_1", "_source": true } } + { "doc": { "foo": "baz" } } + { "update": { "_index": "test_index", "_id": "test_id_2" } } + { "_source": true, "doc": { "foo": "quux" } } + + - match: { items.0.update.get._source.foo: baz } + - match: { items.1.update.get._source.foo: quux } + + - do: + bulk: + index: test_index + _source: true + body: | + { "update": { "_id": "test_id_3" } } + { "doc": { "foo": "garply" } } + + - match: { items.0.update.get._source.foo: garply } + + - do: + bulk: + refresh: true + body: | + { "update": { "_index": "test_index", "_id": "test_id_1", "_source": {"includes": "bar"} } } + { "doc": { "foo": "baz" } } + { "update": { "_index": "test_index", "_id": "test_id_2" } } + { "_source": {"includes": "foo"}, "doc": { "foo": "quux" } } + + - match: { items.0.update.get._source.bar: foo } + - is_false: items.0.update.get._source.foo + - match: { items.1.update.get._source.foo: quux } + - is_false: items.1.update.get._source.bar + + - do: + bulk: + index: test_index + _source_includes: foo + body: | + { "update": { "_id": "test_id_3" } } + { "doc": { "foo": "garply" } } + + - match: { items.0.update.get._source.foo: garply } + - is_false: items.0.update.get._source.bar + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/41_source_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/41_source_with_types.yml new file mode 100644 index 0000000000000..3c8a86c13bdac --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/41_source_with_types.yml @@ -0,0 +1,76 @@ +--- +"Source filtering": + - do: + index: + refresh: true + index: test_index + type: test_type + id: test_id_1 + body: { "foo": "bar", "bar": "foo" } + + - do: + index: + refresh: true + index: test_index + type: test_type + id: test_id_2 + body: { "foo": "qux", "bar": "pux" } + + - do: + index: + refresh: true + index: test_index + type: test_type + id: test_id_3 + body: { "foo": "corge", "bar": "forge" } + + + - do: + bulk: + refresh: true + body: | + { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_1", "_source": true } } + { "doc": { "foo": "baz" } } + { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_2" } } + { "_source": true, "doc": { "foo": "quux" } } + + - match: { items.0.update.get._source.foo: baz } + - match: { items.1.update.get._source.foo: quux } + + - do: + bulk: + index: test_index + type: test_type + _source: true + body: | + { "update": { "_id": "test_id_3" } } + { "doc": { "foo": "garply" } } + + - match: { items.0.update.get._source.foo: garply } + + - do: + bulk: + refresh: true + body: | + { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_1", "_source": {"includes": "bar"} } } + { "doc": { "foo": "baz" } } + { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_2" } } + { "_source": {"includes": "foo"}, "doc": { "foo": "quux" } } + + - match: { items.0.update.get._source.bar: foo } + - is_false: items.0.update.get._source.foo + - match: { items.1.update.get._source.foo: quux } + - is_false: items.1.update.get._source.bar + + - do: + bulk: + index: test_index + type: test_type + _source_includes: foo + body: | + { "update": { "_id": "test_id_3" } } + { "doc": { "foo": "garply" } } + + - match: { items.0.update.get._source.foo: garply } + - is_false: items.0.update.get._source.bar + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/50_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/50_refresh.yml new file mode 100644 index 0000000000000..77098779c0c4f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/50_refresh.yml @@ -0,0 +1,60 @@ +--- +"refresh=true immediately makes changes are visible in search": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + bulk: + refresh: true + body: | + {"index": {"_index": "bulk_50_refresh_1", "_id": "bulk_50_refresh_id1"}} + {"f1": "v1", "f2": 42} + {"index": {"_index": "bulk_50_refresh_1", "_id": "bulk_50_refresh_id2"}} + {"f1": "v2", "f2": 47} + + - do: + count: + index: bulk_50_refresh_1 + - match: {count: 2} + +--- +"refresh=empty string immediately makes changes are visible in search": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + bulk: + refresh: "" + body: | + {"index": {"_index": "bulk_50_refresh_2", "_id": "bulk_50_refresh_id3"}} + {"f1": "v1", "f2": 42} + {"index": {"_index": "bulk_50_refresh_2", "_id": "bulk_50_refresh_id4"}} + {"f1": "v2", "f2": 47} + + - do: + count: + index: bulk_50_refresh_2 + - match: {count: 2} + + +--- +"refresh=wait_for waits until changes are visible in search": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + bulk: + refresh: wait_for + body: | + {"index": {"_index": "bulk_50_refresh_3", "_id": "bulk_50_refresh_id5"}} + {"f1": "v1", "f2": 42} + {"index": {"_index": "bulk_50_refresh_3", "_id": "bulk_50_refresh_id6"}} + {"f1": "v2", "f2": 47} + + - do: + count: + index: bulk_50_refresh_3 + - match: {count: 2} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/51_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/51_refresh_with_types.yml new file mode 100644 index 0000000000000..6326b9464caa0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/51_refresh_with_types.yml @@ -0,0 +1,48 @@ +--- +"refresh=true immediately makes changes are visible in search": + - do: + bulk: + refresh: true + body: | + {"index": {"_index": "bulk_50_refresh_1", "_type": "test_type", "_id": "bulk_50_refresh_id1"}} + {"f1": "v1", "f2": 42} + {"index": {"_index": "bulk_50_refresh_1", "_type": "test_type", "_id": "bulk_50_refresh_id2"}} + {"f1": "v2", "f2": 47} + + - do: + count: + index: bulk_50_refresh_1 + - match: {count: 2} + +--- +"refresh=empty string immediately makes changes are visible in search": + - do: + bulk: + refresh: "" + body: | + {"index": {"_index": "bulk_50_refresh_2", "_type": "test_type", "_id": "bulk_50_refresh_id3"}} + {"f1": "v1", "f2": 42} + {"index": {"_index": "bulk_50_refresh_2", "_type": "test_type", "_id": "bulk_50_refresh_id4"}} + {"f1": "v2", "f2": 47} + + - do: + count: + index: bulk_50_refresh_2 + - match: {count: 2} + + +--- +"refresh=wait_for waits until changes are visible in search": + - do: + bulk: + refresh: wait_for + body: | + {"index": {"_index": "bulk_50_refresh_3", "_type": "test_type", "_id": "bulk_50_refresh_id5"}} + {"f1": "v1", "f2": 42} + {"index": {"_index": "bulk_50_refresh_3", "_type": "test_type", "_id": "bulk_50_refresh_id6"}} + {"f1": "v2", "f2": 47} + + - do: + count: + index: bulk_50_refresh_3 + - match: {count: 2} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/60_deprecated.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/60_deprecated.yml new file mode 100644 index 0000000000000..1401fcc086208 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/60_deprecated.yml @@ -0,0 +1,26 @@ + +--- +"Deprecated parameters should fail in Bulk query": + + - skip: + version: " - 6.99.99" + reason: some parameters are removed starting from 7.0, their equivalents without underscore are used instead + features: "warnings" + + - do: + catch: bad_request + bulk: + body: | + { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_1", "_version": 1 } } + { "doc": { "f1": "v1" } } + { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_2", "_version": 1 } } + { "doc": { "f1": "v2" } } + + - do: + catch: bad_request + bulk: + body: | + { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_1", "_routing": "test1" } } + { "doc": { "f1": "v1" } } + { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_2", "_routing": "test1" } } + { "doc": { "f1": "v2" } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/70_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/70_mix_typeless_typeful.yml new file mode 100644 index 0000000000000..cad0891b21e52 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/70_mix_typeless_typeful.yml @@ -0,0 +1,35 @@ +--- +"bulk without types on an index that has types": + + - skip: + version: " - 6.99.99" + reason: Typeless APIs were introduced in 7.0.0 + + - do: + indices.create: # not using include_type_name: false on purpose + include_type_name: true + index: index + body: + mappings: + not_doc: + properties: + foo: + type: "keyword" + - do: + bulk: + refresh: true + body: + - index: + _index: index + _id: 0 + - foo: bar + - index: + _index: index + _id: 1 + - foo: bar + + - do: + count: + index: index + + - match: {count: 2} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/80_cas.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/80_cas.yml new file mode 100644 index 0000000000000..902621cfba578 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/80_cas.yml @@ -0,0 +1,42 @@ +--- +"Compare And Swap Sequence Numbers": + + - skip: + version: " - 6.99.99" + reason: typeless API are add in 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + - match: { _version: 1} + - set: { _seq_no: seqno } + - set: { _primary_term: primary_term } + + - do: + bulk: + body: + - index: + _index: test_1 + _id: 1 + if_seq_no: 10000 + if_primary_term: $primary_term + - foo: bar2 + + - match: { errors: true } + - match: { items.0.index.status: 409 } + - match: { items.0.index.error.type: version_conflict_engine_exception } + + - do: + bulk: + body: + - index: + _index: test_1 + _id: 1 + if_seq_no: $seqno + if_primary_term: $primary_term + - foo: bar2 + + - match: { errors: false} + - match: { items.0.index.status: 200 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/81_cas_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/81_cas_with_types.yml new file mode 100644 index 0000000000000..101316e7bf504 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/81_cas_with_types.yml @@ -0,0 +1,45 @@ +--- +"Compare And Swap Sequence Numbers": + + - skip: + version: " - 6.6.99" + reason: cas operations with sequence numbers was added in 6.7 + + - do: + index: + index: test_1 + type: _doc + id: 1 + body: { foo: bar } + - match: { _version: 1} + - set: { _seq_no: seqno } + - set: { _primary_term: primary_term } + + - do: + bulk: + body: + - index: + _index: test_1 + _type: _doc + _id: 1 + if_seq_no: 10000 + if_primary_term: $primary_term + - foo: bar2 + + - match: { errors: true } + - match: { items.0.index.status: 409 } + - match: { items.0.index.error.type: version_conflict_engine_exception } + + - do: + bulk: + body: + - index: + _index: test_1 + _type: _doc + _id: 1 + if_seq_no: $seqno + if_primary_term: $primary_term + - foo: bar2 + + - match: { errors: false} + - match: { items.0.index.status: 200 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/10_basic.yml new file mode 100644 index 0000000000000..5669206ee87ad --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/10_basic.yml @@ -0,0 +1,489 @@ + +--- +"Help": + - skip: + version: " - 7.3.99" + reason: "is_write_index is shown in cat.aliases starting version 7.4.0" + + - do: + cat.aliases: + help: true + + - match: + $body: | + /^ alias .+ \n + index .+ \n + filter .+ \n + routing.index .+ \n + routing.search .+ \n + is_write_index .+ \n + $/ + +--- +"Help (pre 7.4.0)": + - skip: + version: "7.4.0 - " + features: node_selector + reason: "is_write_index is shown in cat.aliases starting version 7.4.0" + + - do: + node_selector: + version: " - 7.3.99" + cat.aliases: + help: true + + - match: + $body: | + /^ alias .+ \n + index .+ \n + filter .+ \n + routing.index .+ \n + routing.search .+ \n + $/ + +--- +"Empty cluster": + + - do: + cat.aliases: {} + + - match: + $body: | + /^ + $/ + +--- +"Simple alias": + - skip: + version: " - 7.3.99" + reason: "is_write_index is shown in cat.aliases starting version 7.4.0" + + - do: + indices.create: + index: test + + - do: + indices.put_alias: + index: test + name: test_alias + + - do: + cat.aliases: {} + + - match: + $body: | + /^ + test_alias \s+ + test \s+ + - \s+ + - \s+ + - \s+ + - \s+ + $/ + +--- +"Simple alias (pre 7.4.0)": + - skip: + version: "7.4.0 - " + features: node_selector + reason: "is_write_index is shown in cat.aliases starting version 7.4.0" + + - do: + indices.create: + index: test + + - do: + indices.put_alias: + index: test + name: test_alias + + - do: + node_selector: + version: " - 7.3.99" + cat.aliases: {} + + - match: + $body: | + /^ + test_alias \s+ + test \s+ + - \s+ + - \s+ + - \s+ + $/ + +--- +"Complex alias": + - skip: + version: " - 7.3.99" + reason: "is_write_index is shown in cat.aliases starting version 7.4.0" + + - do: + indices.create: + index: test + body: + mappings: + properties: + foo: + type: text + + - do: + indices.put_alias: + index: test + name: test_alias + body: + index_routing: ir + search_routing: "sr1,sr2" + is_write_index: true + filter: + term: + foo: bar + - do: + cat.aliases: {} + + - match: + $body: | + /^ + test_alias \s+ + test \s+ + [*] \s+ + ir \s+ + sr1,sr2 \s+ + true \s+ + $/ + +--- +"Complex alias (pre 7.4.0)": + - skip: + version: "7.4.0 - " + features: node_selector + reason: "is_write_index is shown in cat.aliases starting version 7.4.0" + + - do: + indices.create: + index: test + body: + mappings: + properties: + foo: + type: text + + - do: + indices.put_alias: + index: test + name: test_alias + body: + index_routing: ir + search_routing: "sr1,sr2" + filter: + term: + foo: bar + - do: + node_selector: + version: " - 7.3.99" + cat.aliases: {} + + - match: + $body: | + /^ + test_alias \s+ + test \s+ + [*] \s+ + ir \s+ + sr1,sr2 \s+ + $/ + +--- +"Alias name": + + - do: + indices.create: + index: test + + - do: + indices.put_alias: + index: test + name: test_1 + + - do: + indices.put_alias: + index: test + name: test_2 + + - do: + cat.aliases: + name: test_1 + + - match: + $body: /^test_1 .+ \n$/ + + - do: + cat.aliases: + name: test_2 + + - match: + $body: /^test_2 .+ \n$/ + + - do: + cat.aliases: + name: test_* + + - match: + $body: / (^|\n)test_1 .+ \n/ + + - match: + $body: / (^|\n)test_2 .+ \n/ + +--- +"Multiple alias names": + + - do: + indices.create: + index: test + + - do: + indices.create: + index: test2 + - do: + indices.create: + index: test3 + + - do: + indices.put_alias: + index: test + name: foo + + - do: + indices.put_alias: + index: test2 + name: bar + - do: + indices.put_alias: + index: test3 + name: baz + + - do: + cat.aliases: + name: foo,bar + v: true + h: [alias, index] + s: [index] + + - match: + $body: | + /^ alias \s+ index \n + foo \s+ test \n + bar \s+ test2 + $/ + +--- +"Column headers": + - skip: + version: " - 7.3.99" + reason: "is_write_index is shown in cat.aliases starting version 7.4.0" + + - do: + indices.create: + index: test + + - do: + indices.put_alias: + index: test + name: test_1 + + - do: + cat.aliases: + v: true + + - match: + $body: | + /^ alias \s+ + index \s+ + filter \s+ + routing.index \s+ + routing.search \s+ + is_write_index + \n + test_1 \s+ + test \s+ + - \s+ + - \s+ + - \s+ + - \s+ + $/ + +--- +"Column headers (pre 7.4.0)": + - skip: + version: "7.4.0 - " + features: node_selector + reason: "is_write_index is shown in cat.aliases starting version 7.4.0" + + - do: + indices.create: + index: test + + - do: + indices.put_alias: + index: test + name: test_1 + + - do: + node_selector: + version: " - 7.3.99" + cat.aliases: + v: true + + - match: + $body: | + /^ alias \s+ + index \s+ + filter \s+ + routing.index \s+ + routing.search + \n + test_1 \s+ + test \s+ + - \s+ + - \s+ + - \s+ + $/ + +--- +"Select columns": + + - do: + indices.create: + index: test + + - do: + indices.put_alias: + index: test + name: test_1 + + - do: + cat.aliases: + h: [index, alias] + + - match: + $body: /^ test \s+ test_1 \s+ $/ + + + - do: + cat.aliases: + h: [index, alias] + v: true + - match: + $body: | + /^ + index \s+ alias \n + test \s+ test_1 \n + $/ + +--- +"Alias against closed index": + - skip: + version: " - 7.3.99" + reason: "is_write_index is shown in cat.aliases starting version 7.4.0" + + - do: + indices.create: + index: test_index + body: + aliases: + test_alias: {} + + - do: + indices.close: + index: test_index + + - do: + cat.aliases: {} + + - match: + $body: | + /^ + test_alias \s+ + test_index \s+ + - \s+ + - \s+ + - \s+ + - \s+ + $/ + +--- +"Alias against closed index (pre 7.4.0)": + - skip: + version: "7.4.0 - " + features: node_selector + reason: "is_write_index is shown in cat.aliases starting version 7.4.0" + + - do: + indices.create: + index: test_index + body: + aliases: + test_alias: {} + + - do: + indices.close: + index: test_index + + - do: + node_selector: + version: " - 7.3.99" + cat.aliases: {} + + - match: + $body: | + /^ + test_alias \s+ + test_index \s+ + - \s+ + - \s+ + - \s+ + $/ + +--- +"Alias sorting": + + - do: + indices.create: + index: test_index + body: + aliases: + test_alias: {} + my_alias: {} + + - do: + indices.create: + index: other_index + body: + aliases: + other_alias: {} + + - do: + cat.aliases: + h: [alias, index] + s: [index, alias] + + - match: + $body: | + /^ + other_alias \s+ other_index\n + my_alias \s+ test_index\n + test_alias \s+ test_index\n + $/ + + - do: + cat.aliases: + h: [alias, index] + s: [index, "a:desc"] + + - match: + $body: | + /^ + other_alias \s+ other_index\n + test_alias \s+ test_index\n + my_alias \s+ test_index\n + $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/20_headers.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/20_headers.yml new file mode 100644 index 0000000000000..c5a806c5615c7 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/20_headers.yml @@ -0,0 +1,24 @@ +--- +"Simple alias with yaml body through Accept header": + - skip: + features: ["headers", "yaml"] + + - do: + indices.create: + index: test + + - do: + indices.put_alias: + index: test + name: test_alias + + - do: + cat.aliases: {} + headers: + Accept: application/yaml + + - match: {0.alias: test_alias} + - match: {0.index: test} + - match: {0.filter: "-"} + - match: {0.routing\.index: "-"} + - match: {0.routing\.search: "-"} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/30_json.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/30_json.yml new file mode 100644 index 0000000000000..178b77ce60dda --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/30_json.yml @@ -0,0 +1,21 @@ +--- +"Simple alias with json body through format argument": + + - do: + indices.create: + index: test + + - do: + indices.put_alias: + index: test + name: test_alias + + - do: + cat.aliases: + format: json + + - match: {0.alias: test_alias} + - match: {0.index: test} + - match: {0.filter: "-"} + - match: {0.routing\.index: "-"} + - match: {0.routing\.search: "-"} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/40_hidden.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/40_hidden.yml new file mode 100644 index 0000000000000..3aa7fdbb1f760 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/40_hidden.yml @@ -0,0 +1,147 @@ +--- +"Test cat aliases output with a hidden index with a hidden alias": + - skip: + version: "- 7.6.99" + reason: "hidden indices and aliases were added in 7.7.0" + + - do: + indices.create: + index: test + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + index: + hidden: true + aliases: + test_alias: + is_hidden: true + + - do: + cat.aliases: {} + + - match: + $body: | + /^ + test_alias \s+ + test \s+ + - \s+ + - \s+ + - \s+ + - \s+ + $/ + + - do: + cat.aliases: + name: test_alias + + - match: + $body: | + /^ + test_alias \s+ + test \s+ + - \s+ + - \s+ + - \s+ + - \s+ + $/ + + + - do: + cat.aliases: + expand_wildcards: ["open","closed"] + + - match: + $body: | + /^ + $/ +--- +"Test cat aliases output with a hidden index with a visible alias": + - skip: + version: "- 7.6.99" + reason: "hidden indices and aliases were added in 7.7.0" + + - do: + indices.create: + index: test + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + index: + hidden: true + aliases: + test_alias: {} + - do: + cat.aliases: {} + + - match: + $body: | + /^ + test_alias \s+ + test \s+ + - \s+ + - \s+ + - \s+ + - \s+ + $/ + + - do: + cat.aliases: + name: test_alias + + - match: + $body: | + /^ + test_alias \s+ + test \s+ + - \s+ + - \s+ + - \s+ + - \s+ + $/ + +--- +"Test cat aliases output with a visible index with a hidden alias": + - skip: + version: "- 7.6.99" + reason: "hidden indices and aliases were added in 7.7.0" + + - do: + indices.create: + index: test + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + aliases: + test_alias: + is_hidden: true + - do: + cat.aliases: {} + + - match: + $body: | + /^ + test_alias \s+ + test \s+ + - \s+ + - \s+ + - \s+ + - \s+ + $/ + + - do: + cat.aliases: + name: test_alias + + - match: + $body: | + /^ + test_alias \s+ + test \s+ + - \s+ + - \s+ + - \s+ + - \s+ + $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.allocation/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.allocation/10_basic.yml new file mode 100644 index 0000000000000..73e35972aecaa --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.allocation/10_basic.yml @@ -0,0 +1,230 @@ +--- +"Help": + - do: + cat.allocation: + help: true + + - match: + $body: | + /^ shards .+ \n + disk.indices .+ \n + disk.used .+ \n + disk.avail .+ \n + disk.total .+ \n + disk.percent .+ \n + host .+ \n + ip .+ \n + node .+ \n + $/ + +--- +"Empty cluster": + + - do: + cat.allocation: {} + + - match: + $body: | + /^ + ( 0 \s+ + 0b \s+ + \d+(\.\d+)?[kmgt]?b \s+ + (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes + (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes + (\d+ \s+)? #no value from client nodes + [-\w.]+ \s+ + \d+(\.\d+){3} \s+ + [-\w.]+ + \n + )+ + $/ + +--- +"One index": + + - do: + indices.create: + index: test + + - do: + cat.allocation: {} + + - match: + $body: | + /^ + ( \s* #allow leading spaces to account for right-justified text + \d+ \s+ + \d+(\.\d+)?[kmgt]?b \s+ + \d+(\.\d+)?[kmgt]?b \s+ + (\d+(\.\d+)?[kmgt]b \s+) #always should return value since we filter out non data nodes by default + (\d+(\.\d+)?[kmgt]b \s+) #always should return value since we filter out non data nodes by default + (\d+ \s+) #always should return value since we filter out non data nodes by default + [-\w.]+ \s+ + \d+(\.\d+){3} \s+ + [-\w.]+ + \n + )+ + ( + \s* #allow leading spaces to account for right-justified text + \d+ \s+ + UNASSIGNED + \n + )? + $/ + +--- +"Node ID": + + - do: + cat.allocation: + node_id: _master + + - match: + $body: | + /^ + ( 0 \s+ + \d+(\.\d+)?[kmgt]?b \s+ + \d+(\.\d+)?[kmgt]?b \s+ + (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes + (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes + (\d+ \s+)? #no value from client nodes + [-\w.]+ \s+ + \d+(\.\d+){3} \s+ + [-\w.]+ + \n + ) + $/ + + - do: + cat.allocation: + node_id: non_existent + + - match: + $body: | + /^ + $/ + +--- + +"All Nodes": + + - do: + cat.allocation: + node_id: "*" + + - match: + $body: | + /^ + ( \s* #allow leading spaces to account for right-justified text + \d+ \s+ + \d+(\.\d+)?[kmgt]?b \s+ + \d+(\.\d+)?[kmgt]?b \s+ + (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes + (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes + (\d+ \s+)? #no value from client nodes + [-\w.]+ \s+ + \d+(\.\d+){3} \s+ + [-\w.]+ + \n + )+ + ( + \s* #allow leading spaces to account for right-justified text + \d+ \s+ + UNASSIGNED + \n + )? + $/ + +--- +"Column headers": + + - do: + cat.allocation: + v: true + - match: + + $body: | + /^ shards \s+ + disk.indices \s+ + disk.used \s+ + disk.avail \s+ + disk.total \s+ + disk.percent \s+ + host \s+ + ip \s+ + node + \n + + ( \s* #allow leading spaces to account for right-justified text + 0 \s+ + 0b \s+ + \d+(\.\d+)?[kmgt]?b \s+ + (\d+(\.\d+)?[kmgt]b \s+) #always should return value since we filter out non data nodes by default + (\d+(\.\d+)?[kmgt]b \s+) #always should return value since we filter out non data nodes by default + (\d+ \s+) #always should return value since we filter out non data nodes by default + [-\w.]+ \s+ + \d+(\.\d+){3} \s+ + [-\w.]+ + \n + )+ + $/ + +--- +"Select columns": + + - do: + cat.allocation: + h: [disk.percent, node] + v: false + + - match: + $body: | + /^ + ( \d* \s+ + [-\w.]+ + \n + )+ + $/ + + - do: + cat.allocation: + h: [disk.percent, node] + v: true + + - match: + $body: | + /^ + disk.percent \s+ + node + \n + ( + \s+\d* \s+ + [-\w.]+ + \n + )+ + $/ + + +--- + +"Bytes": + + - do: + cat.allocation: + bytes: gb + + - match: + $body: | + /^ + ( 0 \s+ + 0 \s+ + \d+ \s+ + (\d+ \s+) #always should return value since we filter out non data nodes by default + (\d+ \s+) #always should return value since we filter out non data nodes by default + (\d+ \s+) #always should return value since we filter out non data nodes by default + [-\w.]+ \s+ + \d+(\.\d+){3} \s+ + [-\w.]+ + \n + )+ + $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.count/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.count/10_basic.yml new file mode 100644 index 0000000000000..7a6a29032cf74 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.count/10_basic.yml @@ -0,0 +1,73 @@ +--- +"Test cat count help": + - do: + cat.count: + help: true + + - match: + $body: | + /^ epoch .+ \n + timestamp .+ \n + count .+ \n $/ + +--- +"Test cat count output": + + - do: + cat.count: {} + + - match: + $body: | + /# epoch timestamp count + ^ \d+ \s \d{2}:\d{2}:\d{2} \s 0 \n$/ + + - do: + index: + index: index1 + id: 1 + body: { foo: bar } + refresh: true + + - do: + cat.count: {} + + - match: + $body: | + /# epoch timestamp count + ^ \d+ \s \d{2}:\d{2}:\d{2} \s 1 \n $/ + + - do: + index: + index: index2 + id: 1 + body: { foo: bar } + refresh: true + + - do: + cat.count: + h: count + + - match: + $body: | + /# count + ^ 2 \n $/ + + + - do: + cat.count: + index: index1 + + - match: + $body: | + /# epoch timestamp count + ^ \d+ \s \d{2}:\d{2}:\d{2} \s 1 \n $/ + + - do: + cat.count: + index: index2 + v: true + + - match: + $body: | + /^ epoch \s+ timestamp \s+ count \n + \d+ \s+ \d{2}:\d{2}:\d{2} \s+ \d+ \n $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.fielddata/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.fielddata/10_basic.yml new file mode 100644 index 0000000000000..6ef59f30753f7 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.fielddata/10_basic.yml @@ -0,0 +1,78 @@ +--- +"Help": + - do: + cat.fielddata: + help: true + + - match: + $body: | + /^ id .+ \n + host .+ \n + ip .+ \n + node .+ \n + field .+ \n + size .+ \n + $/ + +--- +"Test cat fielddata output": + + - do: + cat.fielddata: {} + + - do: + indices.create: + index: index + body: + settings: + number_of_shards: "1" + mappings: + properties: + foo: + type: text + fielddata: true + + - do: + index: + index: index + body: { foo: bar } + refresh: true + + - do: + search: + rest_total_hits_as_int: true + index: index + body: + query: { match_all: {} } + sort: foo + + - do: + cat.fielddata: + h: field,size + v: true + + - match: + $body: | + /^ field \s+ size \n + foo \s+ (\d+(\.\d+)?[gmk]?b \n)+ $/ + + - do: + cat.fielddata: + h: field,size + fields: notfoo,foo + v: true + + - match: + $body: | + /^ field \s+ size \n + foo \s+ (\d+(\.\d+)?[gmk]?b \n)+ $/ + + - do: + cat.fielddata: + h: field,size + fields: notfoo + v: true + + - match: + $body: | + /^ field \s+ size \n $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.health/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.health/10_basic.yml new file mode 100644 index 0000000000000..504b7c8f9b1b6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.health/10_basic.yml @@ -0,0 +1,79 @@ +--- +"Help": + - do: + cat.health: + help: true + + - match: + $body: | + /^ epoch .+ \n + timestamp .+ \n + cluster .+ \n + status .+ \n + node.total .+ \n + node.data .+ \n + shards .+ \n + pri .+ \n + relo .+ \n + init .+ \n + unassign .+ \n + pending_tasks .+ \n + max_task_wait_time .+ \n + active_shards_percent .+ \n + + $/ + + +--- +"Empty cluster": + + - do: + cat.health: {} + + - match: + $body: | + /^ + ( \d+ \s+ # epoch + \d\d:\d\d:\d\d \s+ # timestamp + \S+ \s+ # cluster + \w+ \s+ # status + \d+ \s+ # node.total + \d+ \s+ # node.data + \d+ \s+ # shards + \d+ \s+ # pri + \d+ \s+ # relo + \d+ \s+ # init + \d+ \s+ # unassign + \d+ \s+ # pending_tasks + (-|\d+(?:[.]\d+)?m?s) \s+ # max task waiting time + \d+\.\d+% # active shards percent + \n + )+ + $/ + + +--- +"With ts parameter": + + - do: + cat.health: + ts: false + + - match: + $body: | + /^ + ( \S+ \s+ # cluster + \w+ \s+ # status + \d+ \s+ # node.total + \d+ \s+ # node.data + \d+ \s+ # shards + \d+ \s+ # pri + \d+ \s+ # relo + \d+ \s+ # init + \d+ \s+ # unassign + \d+ \s+ # pending_tasks + (-|\d+(?:[.]\d+)?m?s) \s+ # max task waiting time + \d+\.\d+% # active shards percent + \n + )+ + $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/10_basic.yml new file mode 100644 index 0000000000000..4da58c2ed4d0d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/10_basic.yml @@ -0,0 +1,275 @@ +--- +"Test cat indices output (no indices)": + + - do: + cat.indices: {} + + - match: + $body: | + /^$/ +--- +"Test cat indices output": + + - do: + indices.create: + index: index1 + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + - do: + cat.indices: {} + + - match: + $body: | + /^(green \s+ + open \s+ + index1 \s+ + ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ + 1 \s+ + 0 \s+ + 0 \s+ + 0 \s+ + (\d+|\d+[.]\d+)(kb|b) \s+ + (\d+|\d+[.]\d+)(kb|b) \s* + ) + $/ + + - do: + cat.indices: + v: false + h: i,cd,cds,creation.date,creation.date.string + - match: + $body: | + /^( + index1 \s+ + (\d+) \s+ + (\d\d\d\d\-\d\d\-\d\dT\d\d:\d\d:\d\d.\d\d\dZ) \s+ + (\d+) \s+ + (\d\d\d\d\-\d\d\-\d\dT\d\d:\d\d:\d\d.\d\d\dZ) \s* + ) + $/ +--- +"Test cat indices output for closed index (pre 7.2.0)": + - skip: + version: "7.2.0 - " + reason: "closed indices are replicated starting version 7.2.0" + + - do: + indices.create: + index: index-2 + body: + settings: + number_of_shards: 3 + number_of_replicas: 0 + + - do: + indices.close: + index: index-2 + - is_true: acknowledged + + - do: + cluster.health: + wait_for_status: green + + - do: + cat.indices: + index: index-* + + - match: + $body: | + /^( \s+ + close \s+ + index-2 \s+ + ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ + \s+ + \s+ + \s+ + \s+ + \s+ + \s* + ) + $/ +--- +"Test cat indices output for closed index": + - skip: + version: " - 7.1.99" + reason: "closed indices are replicated starting version 7.2.0" + + - do: + indices.create: + index: index-2 + body: + settings: + number_of_shards: 3 + number_of_replicas: 0 + + - do: + indices.close: + index: index-2 + - is_true: acknowledged + + - do: + cluster.health: + wait_for_status: green + + - do: + cat.indices: + index: index-* + + - match: + $body: | + /^(green \s+ + close \s+ + index-2 \s+ + ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ + 3 \s+ + 0 \s+ + \s+ + \s+ + \s+ + \s* + ) + $/ +--- +"Test cat indices using health status": + + - do: + cluster.health: {} + + - set: { number_of_data_nodes: count } + + - do: + indices.create: + index: foo + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + - do: + indices.create: + index: bar + body: + settings: + number_of_shards: "1" + number_of_replicas: $count + + - do: + cat.indices: + health: green + h: index + + - match: + $body: | + /^(foo)$/ + + - do: + cat.indices: + health: yellow + h: index + + - match: + $body: | + /^(bar)$/ + +--- +"Test cat indices using wildcards": + + - do: + indices.create: + index: foo + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + indices.create: + index: bar + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + indices.create: + index: baz + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + cat.indices: + index: f* + v: false + h: i + + - match: + $body: | + /^(foo \n?)$/ + + - do: + cat.indices: + index: ba* + v: false + h: i + + - match: + $body: | + /^(ba(r|z) \n?){2}$/ + +--- +"Test cat indices sort": + + - do: + indices.create: + index: foo + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + indices.create: + index: bar + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + indices.create: + index: baz + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + indices.close: + index: bar + + - do: + cat.indices: + h: [status, index] + s: [status, index] + + - match: + $body: | + /^ close \s+ bar\n + open \s+ baz\n + open \s+ foo\n + $/ + + - do: + cat.indices: + h: [status, index] + s: [status, "index:desc"] + + - match: + $body: | + /^ close \s+ bar\n + open \s+ foo\n + open \s+ baz\n + $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/20_hidden.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/20_hidden.yml new file mode 100644 index 0000000000000..7a8cf51d4a129 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/20_hidden.yml @@ -0,0 +1,240 @@ +--- +"Test cat indices output for hidden index": + - skip: + version: "- 7.6.99" + reason: "hidden indices were added in 7.7.0" + + - do: + indices.create: + index: index1 + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + index: + hidden: true + - do: + cat.indices: {} + - match: + $body: | + /^$/ + + - do: + cat.indices: + expand_wildcards: ["all"] + - match: + $body: | + /^(green \s+ + open \s+ + index1 \s+ + ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ + 1 \s+ + 0 \s+ + 0 \s+ + 0 \s+ + (\d+|\d+[.]\d+)(kb|b) \s+ + (\d+|\d+[.]\d+)(kb|b) \s* + ) + $/ + +--- +"Test cat indices output for dot-hidden index and dot-prefixed pattern": + - skip: + version: "- 7.6.99" + reason: "hidden indices were added in 7.7.0" + + - do: + indices.create: + index: .index1 + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + index: + hidden: true + - do: + cat.indices: {} + - match: + $body: | + /^$/ + + - do: + cat.indices: + index: ".*" + - match: + $body: | + /^(green \s+ + open \s+ + \.index1 \s+ + ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ + 1 \s+ + 0 \s+ + 0 \s+ + 0 \s+ + (\d+|\d+[.]\d+)(kb|b) \s+ + (\d+|\d+[.]\d+)(kb|b) \s* + ) + $/ + +--- +"Test cat indices output with a hidden index with a visible alias": + - skip: + version: "- 7.6.99" + reason: "hidden indices were added in 7.7.0" + + - do: + indices.create: + index: index1 + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + index: + hidden: true + aliases: + alias1: {} + - do: + cat.indices: + index: "i*" + # Can't use a bare wildcard here because Security replaces wildcards + # it with all matching authorized indices/aliases, including the visible + # alias + - match: + $body: | + /^$/ + + - do: + cat.indices: + expand_wildcards: ["open", "hidden"] + - match: + $body: | + /^(green \s+ + open \s+ + index1 \s+ + ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ + 1 \s+ + 0 \s+ + 0 \s+ + 0 \s+ + (\d+|\d+[.]\d+)(kb|b) \s+ + (\d+|\d+[.]\d+)(kb|b) \s* + ) + $/ + + - do: + cat.indices: + index: alias1 + - match: + $body: | + /^(green \s+ + open \s+ + index1 \s+ + ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ + 1 \s+ + 0 \s+ + 0 \s+ + 0 \s+ + (\d+|\d+[.]\d+)(kb|b) \s+ + (\d+|\d+[.]\d+)(kb|b) \s* + ) + $/ +--- +"Test cat indices output with a hidden index with a hidden alias": + - skip: + version: "- 7.6.99" + reason: "hidden indices and aliases were added in 7.7.0" + + - do: + indices.create: + index: index1 + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + index: + hidden: true + aliases: + alias1: + is_hidden: true + - do: + cat.indices: {} + + - match: + $body: | + /^$/ + + - do: + cat.indices: + expand_wildcards: ["all"] + - match: + $body: | + /^(green \s+ + open \s+ + index1 \s+ + ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ + 1 \s+ + 0 \s+ + 0 \s+ + 0 \s+ + (\d+|\d+[.]\d+)(kb|b) \s+ + (\d+|\d+[.]\d+)(kb|b) \s* + ) + $/ + + - do: + cat.indices: + index: alias1 + - match: + $body: | + /^(green \s+ + open \s+ + index1 \s+ + ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ + 1 \s+ + 0 \s+ + 0 \s+ + 0 \s+ + (\d+|\d+[.]\d+)(kb|b) \s+ + (\d+|\d+[.]\d+)(kb|b) \s* + ) + $/ +--- +"Test cat indices output with a hidden index, dot-hidden alias and dot pattern": + - skip: + version: "- 7.6.99" + reason: "hidden indices and aliases were added in 7.7.0" + + - do: + indices.create: + index: index1 + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + index: + hidden: true + aliases: + .alias1: + is_hidden: true + - do: + cat.indices: {} + - match: + $body: | + /^$/ + - do: + cat.indices: + index: ".*" + - match: + $body: | + /^(green \s+ + open \s+ + index1 \s+ + ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ + 1 \s+ + 0 \s+ + 0 \s+ + 0 \s+ + (\d+|\d+[.]\d+)(kb|b) \s+ + (\d+|\d+[.]\d+)(kb|b) \s* + ) + $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodeattrs/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodeattrs/10_basic.yml new file mode 100644 index 0000000000000..c205e29ff6fec --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodeattrs/10_basic.yml @@ -0,0 +1,70 @@ +--- +"Help": + - do: + cat.nodeattrs: + help: true + + - match: + $body: | + /^ node .+ \n + id .+ \n + pid .+ \n + host .+ \n + ip .+ \n + port .+ \n + attr .+ \n + value .+ \n + $/ + +--- +"Test cat nodes attrs output": + - do: + cat.nodeattrs: {} + # All attributes look good + - match: + $body: | + /^# node\s+ host\s+ ip\s+ attr\s+ value\s* \n + (((\S+\s?){1,10})\s+(\S+)\s+(\d{1,3}\.){3}\d{1,3}\s+(\S+)\s+ (\S+)\s* \n)+ + $/ + # A specific planted attribute is present and looks good + - match: + $body: | + /# node\s+ host\s+ ip\s+ attr\s+ value\s* \n + (\S+(\s\S+){0,7})\s+ (\S+)\s+ (\d{1,3}\.){3}\d{1,3}\s+testattr\s+ test \s* \n + / + # Note for future editors: its quite possible to construct a regex with an + # intense amount of backtracking if you use something like (\S\s?)+ to match + # node name. + + - do: + cat.nodeattrs: + v: true + # All attributes look good including the heading + - match: + $body: | + /^ node\s+ host\s+ ip\s+ attr\s+ value\s* \n + (((\S+\s?){1,10})\s+(\S+)\s+(\d{1,3}\.){3}\d{1,3}\s+(\S+)\s+ (\S+)\s* \n)+ + $/ + # A specific planted attribute is present and looks good + - match: + $body: | + /# node\s+ host\s+ ip\s+ attr\s+ value\s* \n + (\S+(\s\S+){0,7})\s+ (\S+)\s+ (\d{1,3}\.){3}\d{1,3}\s+ testattr\s+ test \s* \n + / + + - do: + cat.nodeattrs: + h: attr,value + v: true + # All attributes look good + - match: + $body: | + /^ attr\s+ value\s*\n + ((\S+)\s+ (\S+)\s*)+ + $/ + # A specific planted attribute is present and looks good + - match: + $body: | + /# attr\s+ value\s*\n + testattr\s+ test\s*\n + / diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodes/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodes/10_basic.yml new file mode 100644 index 0000000000000..4c28f0bec5dfb --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodes/10_basic.yml @@ -0,0 +1,108 @@ +--- +"Test cat nodes output": + + - do: + cat.nodes: {} + + - match: + $body: | + / #ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name + ^ ((\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d* \s+ (-)?\d* \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)?\s+ ((-)?\d*(\.\d+)?)? \s+ (-|[dilmrt]{1,6}) \s+ [-*x] \s+ (\S+\s?)+ \n)+ $/ + + - do: + cat.nodes: + v: true + + - match: + $body: | + /^ ip \s+ heap\.percent \s+ ram\.percent \s+ cpu \s+ load_1m \s+ load_5m \s+ load_15m \s+ node\.role \s+ master \s+ name \n + ((\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d* \s+ (-)?\d* \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ (-|[dilmrt]{1,6}) \s+ [-*x] \s+ (\S+\s?)+ \n)+ $/ + + - do: + cat.nodes: + h: heap.current,heap.percent,heap.max + v: true + + - match: + $body: | + /^ heap\.current \s+ heap\.percent \s+ heap\.max \n + (\s+ \d+(\.\d+)?[ptgmk]?b \s+ \d+ \s+ \d+(\.\d+)?[ptgmk]?b \n)+ $/ + + - do: + cat.nodes: + h: heap.* + v: true + + - match: + $body: | + /^ heap\.current \s+ heap\.percent \s+ heap\.max \n + (\s+ \d+(\.\d+)?[ptgmk]?b \s+ \d+ \s+ \d+(\.\d+)?[ptgmk]?b \n)+ $/ + + - do: + cat.nodes: + h: file_desc.current,file_desc.percent,file_desc.max + v: true + + - match: + # Windows reports -1 for the file descriptor counts. + $body: | + /^ file_desc\.current \s+ file_desc\.percent \s+ file_desc\.max \n + (\s+ (-1|\d+) \s+ \d+ \s+ (-1|\d+) \n)+ $/ + + - do: + cat.nodes: + h: http + v: true + + - match: + $body: | + /^ http \n ((\d{1,3}\.){3}\d{1,3}:\d{1,5}\n)+ $/ + +--- +"Additional disk information": + - do: + cat.nodes: + h: diskAvail,diskTotal,diskUsed,diskUsedPercent + v: true + + - match: + # leading whitespace on columns and optional whitespace on values is necessary + # because `diskAvail` is right aligned and text representation of disk size might be + # longer so it's padded with leading whitespace + $body: | + /^ \s* diskAvail \s+ diskTotal \s+ diskUsed \s+ diskUsedPercent \n + (\s* \d+(\.\d+)?[ptgmk]?b \s+ \d+(\.\d+)?[ptgmk]?b \s+ \d+(\.\d+)?[ptgmk]?b\s+ (100\.00 | \d{1,2}\.\d{2}) \n)+ $/ + + - do: + cat.nodes: + h: disk,dt,du,dup + v: true + + - match: + # leading whitespace on columns and optional whitespace on values is necessary + # because `disk` is right aligned and text representation of disk size might be + # longer so it's padded with leading whitespace + $body: | + /^ \s* disk \s+ dt \s+ du \s+ dup \n + (\s* \d+(\.\d+)?[ptgmk]?b \s+ \d+(\.\d+)?[ptgmk]?b \s+ \d+(\.\d+)?[ptgmk]?b\s+ (100\.00 | \d{1,2}\.\d{2}) \n)+ $/ + +--- +"Test cat nodes output with full_id set": + + - do: + cat.nodes: + h: id + # check for a 4 char non-whitespace character string + - match: + $body: | + /^(\S{4}\n)+$/ + + - do: + cat.nodes: + h: id + full_id: true + # check for a 5+ char non-whitespace character string + - match: + $body: | + /^(\S{5,}\n)+$/ + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.plugins/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.plugins/10_basic.yml new file mode 100644 index 0000000000000..86f2a360afab0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.plugins/10_basic.yml @@ -0,0 +1,14 @@ +--- +"Help": + - do: + cat.plugins: + help: true + + - match: + $body: | + /^ id .+ \n + name .+ \n + component .+ \n + version .+ \n + description .+ \n + $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.recovery/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.recovery/10_basic.yml new file mode 100644 index 0000000000000..ef1272322e9af --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.recovery/10_basic.yml @@ -0,0 +1,134 @@ +--- +"Test cat recovery output": + + - do: + cat.recovery: {} + + - match: + $body: | + /^$/ + + - do: + index: + index: index1 + id: 1 + body: { foo: bar } + refresh: true + - do: + cat.recovery: + h: i,s,t,ty,st,shost,thost,rep,snap,f,fr,fp,tf,b,br,bp,tb,to,tor,top + + - match: + $body: | + /^ + ( + index1 \s+ + \d \s+ # shard + (?:\d+ms|\d+(?:\.\d+)?s) \s+ # time in ms or seconds + (empty_store|existing_store|peer|snapshot|local_shards) \s+ # source type + (init|index|verify_index|translog|finalize|done) \s+ # stage + [-\w./]+ \s+ # source_host + [-\w./]+ \s+ # target_host + [-\w./]+ \s+ # repository + [-\w./]+ \s+ # snapshot + \d+ \s+ # files + \d+ \s+ # files_recovered + \d+\.\d+% \s+ # files_percent + \d+ \s+ # files_total + \d+ \s+ # bytes + \d+ \s+ # bytes_recovered + \d+\.\d+% \s+ # bytes_percent + \d+ \s+ # bytes_total + -?\d+ \s+ # translog_ops + \d+ \s+ # translog_ops_recovered + -?\d+\.\d+% # translog_ops_percent + \n + )+ + $/ + + - do: + cat.recovery: + h: shard,source_node,bytes + + - match: + $body: | + /^ + ( + \d \s+ # shard + ((\S+\s?){1,10})\s+ # source_node + \d+ # bytes + \n + )+ + $/ + + - do: + cat.recovery: + h: shard,target_node,bytes + + - match: + $body: | + /^ + ( + \d \s+ # shard + ((\S+\s?){1,10})\s+ # target_node + \d+ # bytes + \n + )+ + $/ + +--- +"Test cat recovery output for closed index": + - skip: + version: " - 7.1.99" + reason: closed indices are replicated starting version 7.2.0 + + - do: + indices.create: + index: index2 + body: + settings: + index: + number_of_replicas: 0 + + - do: + indices.close: + index: index2 + - is_true: acknowledged + + - do: + cluster.health: + index: index2 + wait_for_status: green + + - do: + cat.recovery: + index: index2 + h: i,s,t,ty,st,shost,thost,rep,snap,f,fr,fp,tf,b,br,bp,tb,to,tor,top + + - match: + $body: | + /^ + ( + index2 \s+ + \d \s+ # shard + (?:\d+ms|\d+(?:\.\d+)?s) \s+ # time in ms or seconds + existing_store \s+ # source type (always existing_store for closed indices) + done \s+ # stage + [-\w./]+ \s+ # source_host + [-\w./]+ \s+ # target_host + [-\w./]+ \s+ # repository + [-\w./]+ \s+ # snapshot + \d+ \s+ # files + \d+ \s+ # files_recovered + \d+\.\d+% \s+ # files_percent + \d+ \s+ # files_total + \d+ \s+ # bytes + \d+ \s+ # bytes_recovered + \d+\.\d+% \s+ # bytes_percent + \d+ \s+ # bytes_total + 0 \s+ # translog_ops (always 0 for closed indices) + 0 \s+ # translog_ops_recovered (always 0 for closed indices) + 100\.0% # translog_ops_percent (always 100.0% for closed indices) + \n + )+ + $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.repositories/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.repositories/10_basic.yml new file mode 100644 index 0000000000000..ca1a03545e692 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.repositories/10_basic.yml @@ -0,0 +1,83 @@ +--- +"Help": + - do: + cat.repositories: + help: true + + - match: + $body: | + /^ id .+ \n + type .+ \n + $/ +--- +"Test cat repositories output": + + - do: + cat.repositories: {} + + - match: + $body: | + /^$/ + + - do: + snapshot.create_repository: + repository: test_cat_repo_1 + body: + type: fs + settings: + location: "test_cat_repo_1_loc" + + - do: + snapshot.create_repository: + repository: test_cat_repo_2 + body: + type: fs + settings: + location: "test_cat_repo_2_loc" + + - do: + cat.repositories: {} + + - match: + $body: | + /^ test_cat_repo_1\s+ fs\s*\n + test_cat_repo_2\s+ fs\s*\n + $/ + +--- +"Test cat repositories sort": + - do: + snapshot.create_repository: + repository: test_cat_repo_1 + body: + type: fs + settings: + location: "test_cat_repo_1_loc" + + - do: + snapshot.create_repository: + repository: test_cat_repo_2 + body: + type: fs + settings: + location: "test_cat_repo_2_loc" + + - do: + cat.repositories: + s: [type, id] + + - match: + $body: | + /^ test_cat_repo_1 \s+ fs \n + test_cat_repo_2 \s+ fs \n + $/ + + - do: + cat.repositories: + s: [type, "id:desc"] + + - match: + $body: | + /^ test_cat_repo_2 \s+ fs \n + test_cat_repo_1 \s+ fs \n + $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.segments/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.segments/10_basic.yml new file mode 100644 index 0000000000000..82488a0c23ce2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.segments/10_basic.yml @@ -0,0 +1,167 @@ +--- +"Help": + - do: + cat.segments: + help: true + + - match: + $body: | + /^ index .+ \n + shard .+ \n + prirep .+ \n + ip .+ \n + id .+ \n + segment .+ \n + generation .+ \n + docs.count .+ \n + docs.deleted .+ \n + size .+ \n + size.memory .+ \n + committed .+ \n + searchable .+ \n + version .+ \n + compound .+ \n + $/ +--- +"Test cat segments output": + + - do: + cat.segments: {} + + - match: + $body: | + /^$/ + + - do: + indices.create: + index: index1 + body: + settings: + number_of_shards: "3" + number_of_replicas: "0" + - do: + index: + index: index1 + body: { foo: bar } + refresh: true + - do: + cat.segments: {} + - match: + $body: | + /^(index1 \s+ \d \s+ (p|r) \s+ \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} \s+ _\d (\s\d){3} \s+ + (\d+|\d+[.]\d+)(kb|b) \s+ \d+ (\s+ (false|true)){2} \s+ \d+\.\d+(\.\d+)? \s+ (false|true) \s? \n?)$/ + + - do: + indices.create: + index: index2 + body: + settings: + number_of_shards: "3" + number_of_replicas: "0" + - do: + index: + index: index2 + body: { foo: bar } + refresh: true + - do: + cluster.health: + wait_for_status: green + + + - do: + cat.segments: {} + - match: + $body: | + /^(index(1|2) .+ \n?){2}$/ + + - do: + cat.segments: + index: index2 + - match: + $body: | + /^(index2 .+ \n?)$/ + +--- +"Test cat segments on closed index behaviour": + + - do: + indices.create: + index: index1 + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + indices.close: + index: index1 + + - do: + catch: bad_request + cat.segments: + index: index1 + +--- +"Test cat segments using wildcards": + + - do: + indices.create: + index: foo + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + index: + index: foo + body: { test: foo } + refresh: true + + - do: + indices.create: + index: bar + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + index: + index: bar + body: { test: bar } + refresh: true + + - do: + indices.create: + index: baz + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + index: + index: baz + body: { test: baz } + refresh: true + + - do: + cat.segments: + index: f* + v: false + h: i + + - match: + $body: | + /^(foo \n?)$/ + + - do: + cat.segments: + index: ba* + v: false + h: i + + - match: + $body: | + /^(ba(r|z) \n?){2}$/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.shards/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.shards/10_basic.yml new file mode 100644 index 0000000000000..aa4abc7a11eae --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.shards/10_basic.yml @@ -0,0 +1,209 @@ +--- +"Help": + - skip: + version: " - 7.99.99" + reason: shard path stats were added in 8.0.0 + - do: + cat.shards: + help: true + + - match: + $body: | + /^ index .+ \n + shard .+ \n + prirep .+ \n + state .+ \n + docs .+ \n + store .+ \n + ip .+ \n + id .+ \n + node .+ \n + sync_id .+ \n + unassigned.reason .+ \n + unassigned.at .+ \n + unassigned.for .+ \n + unassigned.details .+ \n + recoverysource.type .+ \n + completion.size .+ \n + fielddata.memory_size .+ \n + fielddata.evictions .+ \n + query_cache.memory_size .+ \n + query_cache.evictions .+ \n + flush.total .+ \n + flush.total_time .+ \n + get.current .+ \n + get.time .+ \n + get.total .+ \n + get.exists_time .+ \n + get.exists_total .+ \n + get.missing_time .+ \n + get.missing_total .+ \n + indexing.delete_current .+ \n + indexing.delete_time .+ \n + indexing.delete_total .+ \n + indexing.index_current .+ \n + indexing.index_time .+ \n + indexing.index_total .+ \n + indexing.index_failed .+ \n + merges.current .+ \n + merges.current_docs .+ \n + merges.current_size .+ \n + merges.total .+ \n + merges.total_docs .+ \n + merges.total_size .+ \n + merges.total_time .+ \n + refresh.total .+ \n + refresh.time .+ \n + refresh.external_total .+ \n + refresh.external_time .+ \n + refresh.listeners .+ \n + search.fetch_current .+ \n + search.fetch_time .+ \n + search.fetch_total .+ \n + search.open_contexts .+ \n + search.query_current .+ \n + search.query_time .+ \n + search.query_total .+ \n + search.scroll_current .+ \n + search.scroll_time .+ \n + search.scroll_total .+ \n + segments.count .+ \n + segments.memory .+ \n + segments.index_writer_memory .+ \n + segments.version_map_memory .+ \n + segments.fixed_bitset_memory .+ \n + seq_no.max .+ \n + seq_no.local_checkpoint .+ \n + seq_no.global_checkpoint .+ \n + warmer.current .+ \n + warmer.total .+ \n + warmer.total_time .+ \n + path.data .+ \n + path.state .+ \n + $/ +--- +"Test cat shards output": + + - do: + cat.shards: {} + + - match: + $body: | + /^$/ + - do: + indices.create: + index: index1 + body: + settings: + number_of_shards: "5" + number_of_replicas: "1" + - do: + cat.shards: {} + + - match: + $body: | + /^(index1 \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING|RELOCATING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){10}$/ + + - do: + indices.create: + index: index2 + body: + settings: + number_of_shards: "5" + number_of_replicas: "0" + + - do: + cat.shards: {} + - match: + $body: | + /^(index(1|2) \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING|RELOCATING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){15}$/ + + - do: + cat.shards: + index: index2 + - match: + $body: | + /^(index2 \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING|RELOCATING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){5}$/ + +--- +"Test cat shards using wildcards": + + - do: + indices.create: + index: foo + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + indices.create: + index: bar + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + indices.create: + index: baz + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + cat.shards: + index: f* + v: false + h: i + + - match: + $body: | + /^(foo \n?)$/ + + - do: + cat.shards: + index: ba* + v: false + h: i + + - match: + $body: | + /^(ba(r|z) \n?){2}$/ + +--- +"Test cat shards sort": + - do: + indices.create: + index: foo + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + indices.create: + index: bar + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + index: + index: bar + body: { test: bar } + refresh: true + + - do: + cat.shards: + h: [index, docs] + s: [docs] + +# don't use the store here it's cached and might be stale + - match: + $body: | + /^ foo \s+ 0\n + bar \s+ 1\n + $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.snapshots/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.snapshots/10_basic.yml new file mode 100644 index 0000000000000..6e03ceb98c716 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.snapshots/10_basic.yml @@ -0,0 +1,79 @@ +--- +"Help": + - do: + cat.snapshots: + help: true + + - match: + $body: | + /^ id .+ \n + status .+ \n + start_epoch .+ \n + start_time .+ \n + end_epoch .+ \n + end_time .+ \n + duration .+ \n + indices .+ \n + successful_shards .+ \n + failed_shards .+ \n + total_shards .+ \n + reason .+ \n + $/ +--- +"Test cat snapshots output": + + - do: + snapshot.create_repository: + repository: test_cat_snapshots_1 + body: + type: fs + settings: + location: "test_cat_snapshots_1_loc" + + - do: + cat.snapshots: + repository: test_cat_snapshots_1 + + - match: + $body: | + /^$/ + + - do: + indices.create: + index: index1 + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + - do: + indices.create: + index: index2 + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + - do: + cluster.health: + wait_for_status: green + + - do: + snapshot.create: + repository: test_cat_snapshots_1 + snapshot: snap1 + wait_for_completion: true + + - do: + snapshot.create: + repository: test_cat_snapshots_1 + snapshot: snap2 + wait_for_completion: true + + - do: + cat.snapshots: + repository: test_cat_snapshots_1 + + - match: + $body: | + /^ snap1\s+ SUCCESS\s+ \d+\s+ \d\d\:\d\d\:\d\d\s+ \d+\s+ \d\d\:\d\d\:\d\d\s+ \S+\s+ 2\s+ 2\s+ 0\s+ 2\s*\n + snap2\s+ SUCCESS\s+ \d+\s+ \d\d\:\d\d\:\d\d\s+ \d+\s+ \d\d\:\d\d\:\d\d\s+ \S+\s+ 2\s+ 2\s+ 0\s+ 2\s*\n + $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.tasks/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.tasks/10_basic.yml new file mode 100644 index 0000000000000..c7a38bfb44adc --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.tasks/10_basic.yml @@ -0,0 +1,19 @@ +--- +"Test cat tasks output": + + - do: + cat.tasks: {} + + - match: + $body: | + / # action task_id parent_task_id type start_time timestamp running_time ip node + ^( \S+\s+ \S+\:\d+\s+ (?:\-|\S+\:\d+)\s+ \S+\s+ \d+\s+ \d\d\:\d\d\:\d\d\s+ \S+\s+ \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\s+ \S+\n)+$/ + + - do: + cat.tasks: + detailed: true + + - match: + $body: | + / # action task_id parent_task_id type start_time timestamp running_time ip node description + ^( \S+\s+ \S+\:\d+\s+ (?:\-|\S+\:\d+)\s+ \S+\s+ \d+\s+ \d\d\:\d\d\:\d\d\s+ \S+\s+ \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\s+ \S+\s+ .*\n)+$/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.templates/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.templates/10_basic.yml new file mode 100644 index 0000000000000..fe0d7ee30730f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.templates/10_basic.yml @@ -0,0 +1,257 @@ +--- +"Help": + - do: + cat.templates: + help: true + + - match: + $body: | + /^ name .+ \n + index_patterns .+ \n + order .+ \n + version .+ \n + $/ + +--- +"No templates": + - skip: + features: default_shards, no_xpack + - do: + cat.templates: {} + + - match: + $body: | + /^ + $/ + +--- +"Normal templates": + + - do: + indices.put_template: + name: test + body: + order: 0 + version: 1 + index_patterns: test-* + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + indices.put_template: + name: test_2 + body: + order: 1 + version: 2 + index_patterns: test-2* + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + cat.templates: {} + + - match: + $body: > + / + (^|\n)test \s+ + \[test-\*\] \s+ + 0 \s+ + 1 + (\n|$) + / + + - match: + $body: > + / + (^|\n)test_2 \s+ + \[test-2\*\] \s+ + 1 \s+ + 2 + (\n|$) + / + +--- +"Filtered templates": + + - do: + indices.put_template: + name: test + body: + order: 0 + version: 1 + index_patterns: t* + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + indices.put_template: + name: nomatch + body: + order: 2 + version: 1 + index_patterns: tea* + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + cat.templates: + name: test* + + - match: + $body: | + /^ + test \s+ + \[t\*\] \s+ + 0 \s+ + 1 + \n + $/ + +--- +"Column headers": + - do: + indices.put_template: + name: test + body: + order: 0 + version: 1 + index_patterns: t* + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + cat.templates: + v: true + name: test + + - match: + $body: | + /^ + name \s+ + index_patterns \s+ + order \s+ + version + \n + test \s+ + \[t\*\] \s+ + 0 \s+ + 1 + \n + $/ + +--- +"Select columns": + - do: + indices.put_template: + name: test + body: + order: 0 + version: 1 + index_patterns: t* + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + cat.templates: + h: [name, index_patterns] + v: true + name: test* + + - match: + $body: | + /^ + name \s+ + index_patterns + \n + test \s+ + \[t\*\] + \n + $/ + +--- +"Sort templates": + - skip: + features: default_shards, no_xpack + - do: + indices.put_template: + name: test + body: + order: 0 + index_patterns: t* + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + indices.put_template: + name: test_1 + body: + order: 0 + version: 1 + index_patterns: te* + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + cat.templates: + h: [name, index_patterns, version] + s: [version] + + - match: + $body: | + /^ + test \s+ \[t\*\] \s+ \n + test_1 \s+ \[te\*\] \s+ 1 \n + $/ + + - do: + cat.templates: + h: [name, index_patterns, version] + s: ["version:desc"] + + - match: + $body: | + /^ + test_1 \s+ \[te\*\] \s+ 1\n + test \s+ \[t\*\] \s+ \n + + $/ + +--- +"Multiple template": + - skip: + features: default_shards, no_xpack + - do: + indices.put_template: + name: test_1 + body: + order: 0 + version: 1 + index_patterns: [t*, te*] + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + cat.templates: + h: [name, index_patterns] + v: true + + + - match: + $body: | + /^ + name \s+ + index_patterns + \n + test_1 \s+ + \[t\*,\ te\*\] + \n + $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.thread_pool/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.thread_pool/10_basic.yml new file mode 100644 index 0000000000000..1ce8468cb51f9 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.thread_pool/10_basic.yml @@ -0,0 +1,80 @@ +--- +"Test cat thread_pool output": + - skip: + version: " - 6.99.99" + reason: this API was changed in a backwards-incompatible fashion in 7.0.0 so we need to skip in a mixed cluster + + - do: + cat.thread_pool: {} + + - match: + $body: | + / #node_name name active queue rejected + ^ (\S+ \s+ \S+ \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/ + + - do: + cat.thread_pool: + v: true + + - match: + $body: | + /^ node_name \s+ name \s+ active \s+ queue \s+ rejected \n + (\S+ \s+ \S+ \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/ + + - do: + cat.thread_pool: + h: pid,id,h,i,po + + - match: + $body: | + / #pid id host ip port + (\d+ \s+ \S+ \s+ \S+ \s+ (\d{1,3}\.){3}\d{1,3} \s+ (\d+|-) \n)+ $/ + + - do: + cat.thread_pool: + thread_pool_patterns: write,management,flush,generic,force_merge + h: id,name,active + v: true + + - match: + $body: | + /^ id \s+ name \s+ active \n + (\S+\s+ flush \s+ \d+ \n + \S+\s+ force_merge \s+ \d+ \n + \S+\s+ generic \s+ \d+ \n + \S+\s+ management \s+ \d+ \n + \S+\s+ write \s+ \d+ \n)+ $/ + + - do: + cat.thread_pool: + thread_pool_patterns: write + h: id,name,type,active,size,queue,queue_size,rejected,largest,completed,min,max,keep_alive + v: true + + - match: + $body: | + /^ id \s+ name \s+ type \s+ active \s+ size \s+ queue \s+ queue_size \s+ rejected \s+ largest \s+ completed \s+ max \s+ keep_alive \n + (\S+ \s+ write \s+ fixed \s+ \d+ \s+ \d+ \s+ \d+ \s+ (-1|\d+) \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \S* \n)+ $/ + + - do: + cat.thread_pool: + thread_pool_patterns: fetch* + h: id,name,type,active,pool_size,queue,queue_size,rejected,largest,completed,core,max,size,keep_alive + v: true + + - match: + $body: | + /^ id \s+ name \s+ type \s+ active \s+ pool_size \s+ queue \s+ queue_size \s+ rejected \s+ largest \s+ completed \s+ core \s+ max \s+ size \s+ keep_alive \n + (\S+ \s+ fetch_shard_started \s+ scaling \s+ \d+ \s+ \d+ \s+ \d+ \s+ (-1|\d+) \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \d* \s+ \S* \n + \S+ \s+ fetch_shard_store \s+ scaling \s+ \d+ \s+ \d+ \s+ \d+ \s+ (-1|\d+) \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \d* \s+ \S* \n)+ $/ + + - do: + cat.thread_pool: + thread_pool_patterns: write,search + size: "" + + - match: + $body: | + / #node_name name active queue rejected + ^ (\S+ \s+ search \s+ \d+ \s+ \d+ \s+ \d+ \n + \S+ \s+ write \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.allocation_explain/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.allocation_explain/10_basic.yml new file mode 100644 index 0000000000000..f0fdca695b829 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.allocation_explain/10_basic.yml @@ -0,0 +1,91 @@ +"bad cluster shard allocation explanation request": + - do: + # there aren't any unassigned shards to explain + catch: /illegal_argument_exception/ + cluster.allocation_explain: {} + +--- +"cluster shard allocation explanation test": + - do: + indices.create: + index: test + + - match: { acknowledged: true } + + - do: + cluster.allocation_explain: + body: { "index": "test", "shard": 0, "primary": true } + + - match: { current_state: "started" } + - is_true: current_node.id + - match: { index: "test" } + - match: { shard: 0 } + - match: { primary: true } + - is_true: can_remain_on_current_node + - is_true: can_rebalance_cluster + - is_true: can_rebalance_to_other_node + - is_true: rebalance_explanation + +--- +"cluster shard allocation explanation test with empty request": + - do: + indices.create: + index: test + body: { "settings": { "index.number_of_shards": 1, "index.number_of_replicas": 9 } } + + - do: + cluster.allocation_explain: + include_disk_info: true + + - match: { current_state: "unassigned" } + - match: { unassigned_info.reason: "INDEX_CREATED" } + - is_true: unassigned_info.at + - match: { index: "test" } + - match: { shard: 0 } + - match: { primary: false } + - is_true: cluster_info + - is_true: can_allocate + + +--- +"Cluster shard allocation explanation test with a closed index": + - skip: + version: " - 7.1.99" + reason: closed indices are replicated starting version 7.2.0 + + - do: + indices.create: + index: test_closed + body: { "settings": { "index.number_of_shards": 1, "index.number_of_replicas": 0 } } + + - match: { acknowledged: true } + + - do: + cluster.health: + index: test_closed + wait_for_status: green + + - do: + indices.close: + index: test_closed + + - match: { acknowledged: true } + + - do: + cluster.health: + index: test_closed + wait_for_status: green + + - do: + cluster.allocation_explain: + body: { "index": "test_closed", "shard": 0, "primary": true } + + - match: { current_state: "started" } + - is_true: current_node.id + - match: { index: "test_closed" } + - match: { shard: 0 } + - match: { primary: true } + - is_true: can_remain_on_current_node + - is_true: can_rebalance_cluster + - is_true: can_rebalance_to_other_node + - is_true: rebalance_explanation diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.component_template/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.component_template/10_basic.yml new file mode 100644 index 0000000000000..f4f705d00d81e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.component_template/10_basic.yml @@ -0,0 +1,47 @@ +--- +"Basic CRUD": + - skip: + version: " - 7.6.99" + reason: only available in 7.7+ + + - do: + cluster.put_component_template: + name: test + body: + template: + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: + properties: + field: + type: keyword + aliases: + aliasname: {} + version: 2 + _meta: + foo: bar + baz: + eggplant: true + + - do: + cluster.get_component_template: + name: test + + - match: {component_templates.0.name: test} + - match: {component_templates.0.component_template.version: 2} + - match: {component_templates.0.component_template._meta: {foo: bar, baz: {eggplant: true}}} + - match: {component_templates.0.component_template.template.settings: {index: {number_of_shards: '1', number_of_replicas: '0'}}} + - match: {component_templates.0.component_template.template.mappings: {properties: {field: {type: keyword}}}} + - match: {component_templates.0.component_template.template.aliases: {aliasname: {}}} + + - do: + cluster.delete_component_template: + name: test + + - do: + catch: missing + cluster.get_component_template: + name: test + + - is_false: test diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/10_basic.yml new file mode 100644 index 0000000000000..aa6c96202eaf4 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/10_basic.yml @@ -0,0 +1,281 @@ +--- +"cluster health basic test": + - do: + cluster.health: {} + + - is_true: cluster_name + - is_false: timed_out + - gte: { number_of_nodes: 1 } + - gte: { number_of_data_nodes: 1 } + - match: { active_primary_shards: 0 } + - match: { active_shards: 0 } + - match: { relocating_shards: 0 } + - match: { initializing_shards: 0 } + - match: { unassigned_shards: 0 } + - gte: { number_of_pending_tasks: 0 } + +--- +"cluster health basic test, one index": + - do: + indices.create: + index: test_index + body: + settings: + index: + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + wait_for_no_relocating_shards: true + + - is_true: cluster_name + - is_false: timed_out + - gte: { number_of_nodes: 1 } + - gte: { number_of_data_nodes: 1 } + - gt: { active_primary_shards: 0 } + - gt: { active_shards: 0 } + - gte: { relocating_shards: 0 } + - match: { initializing_shards: 0 } + - match: { unassigned_shards: 0 } + - gte: { number_of_pending_tasks: 0 } + +--- +"cluster health basic test, one index with wait for active shards": + - do: + indices.create: + index: test_index + body: + settings: + index: + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_active_shards: 1 + wait_for_no_relocating_shards: true + + - is_true: cluster_name + - is_false: timed_out + - gte: { number_of_nodes: 1 } + - gte: { number_of_data_nodes: 1 } + - gt: { active_primary_shards: 0 } + - gt: { active_shards: 0 } + - gte: { relocating_shards: 0 } + - match: { initializing_shards: 0 } + - match: { unassigned_shards: 0 } + - gte: { number_of_pending_tasks: 0 } + +--- +"cluster health basic test, one index with wait for all active shards": + - do: + indices.create: + index: test_index + body: + settings: + index: + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_active_shards: all + wait_for_no_relocating_shards: true + + - is_true: cluster_name + - is_false: timed_out + - gte: { number_of_nodes: 1 } + - gte: { number_of_data_nodes: 1 } + - gt: { active_primary_shards: 0 } + - gt: { active_shards: 0 } + - gte: { relocating_shards: 0 } + - match: { initializing_shards: 0 } + - match: { unassigned_shards: 0 } + - gte: { number_of_pending_tasks: 0 } + +--- +"cluster health basic test, one index with wait for no initializing shards": + - skip: + version: " - 6.1.99" + reason: "wait_for_no_initializing_shards is introduced in 6.2.0" + + - do: + indices.create: + index: test_index + wait_for_active_shards: 0 + body: + settings: + index: + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_no_initializing_shards: true + + - match: { initializing_shards: 0 } + +--- +"cluster health levels": + - do: + indices.create: + index: test_index + - do: + cluster.health: + level: indices + + - is_true: indices + - is_false: indices.test_index.shards + + - do: + cluster.health: + level: shards + + - is_true: indices + - is_true: indices.test_index.shards + +--- +"cluster health with closed index (pre 7.2.0)": + - skip: + version: "7.2.0 - " + reason: "closed indices are replicated starting version 7.2.0" + + - do: + indices.create: + index: index-1 + body: + settings: + index: + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + - match: { status: green } + + - do: + indices.create: + index: index-2 + body: + settings: + index: + number_of_replicas: 50 + + - do: + cluster.health: + wait_for_status: yellow + wait_for_no_relocating_shards: true + - match: { status: yellow } + + - do: + cluster.health: + index: index-* + - match: { status: yellow } + + - do: + cluster.health: + index: index-1 + - match: { status: green } + + - do: + cluster.health: + index: index-2 + - match: { status: yellow } + + - do: + indices.close: + index: index-2 + - is_true: acknowledged + + # closing the index-2 turns the cluster health back to green + - do: + cluster.health: + wait_for_status: green + - match: { status: green } + + - do: + cluster.health: + index: index-* + - match: { status: green } + + - do: + cluster.health: + index: index-1 + - match: { status: green } + + - do: + cluster.health: + index: index-2 + - match: { status: green } + +--- +"cluster health with closed index": + - skip: + version: " - 7.1.99" + reason: "closed indices are replicated starting version 7.2.0" + + - do: + indices.create: + index: index-1 + body: + settings: + index: + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + - match: { status: green } + + - do: + indices.create: + index: index-2 + body: + settings: + index: + number_of_replicas: 50 + + - do: + cluster.health: + wait_for_status: yellow + wait_for_no_relocating_shards: true + - match: { status: yellow } + + - do: + cluster.health: + index: index-* + - match: { status: yellow } + + - do: + cluster.health: + index: index-1 + - match: { status: green } + + - do: + cluster.health: + index: index-2 + - match: { status: yellow } + + # closing the index-2 does not change the cluster health with replicated closed indices + - do: + indices.close: + index: index-2 + - is_true: acknowledged + + - do: + cluster.health: + wait_for_status: yellow + - match: { status: yellow } + + - do: + cluster.health: + index: index-* + - match: { status: yellow } + + - do: + cluster.health: + index: index-1 + - match: { status: green } + + - do: + cluster.health: + index: index-2 + - match: { status: yellow } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/20_request_timeout.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/20_request_timeout.yml new file mode 100644 index 0000000000000..66a7cb2b48dbd --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/20_request_timeout.yml @@ -0,0 +1,37 @@ +--- +"cluster health request timeout on waiting for nodes": + - do: + catch: request_timeout + cluster.health: + wait_for_nodes: 10 + timeout: 1ms + + - is_true: cluster_name + - is_true: timed_out + - gte: { number_of_nodes: 1 } + - gte: { number_of_data_nodes: 1 } + - match: { active_primary_shards: 0 } + - match: { active_shards: 0 } + - match: { relocating_shards: 0 } + - match: { initializing_shards: 0 } + - match: { unassigned_shards: 0 } + - gte: { number_of_pending_tasks: 0 } + +--- +"cluster health request timeout waiting for active shards": + - do: + catch: request_timeout + cluster.health: + timeout: 1ms + wait_for_active_shards: 5 + + - is_true: cluster_name + - is_true: timed_out + - gte: { number_of_nodes: 1 } + - gte: { number_of_data_nodes: 1 } + - match: { active_primary_shards: 0 } + - match: { active_shards: 0 } + - match: { relocating_shards: 0 } + - match: { initializing_shards: 0 } + - match: { unassigned_shards: 0 } + - gte: { number_of_pending_tasks: 0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/30_indices_options.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/30_indices_options.yml new file mode 100644 index 0000000000000..93ca5da19d2ff --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/30_indices_options.yml @@ -0,0 +1,79 @@ +setup: + + - do: + indices.create: + index: index-1 + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + indices.create: + index: index-2 + body: + settings: + number_of_shards: 2 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + indices.close: + index: index-2 + + - do: + cluster.health: + wait_for_status: green + +--- +"cluster health with expand_wildcards": + - skip: + version: " - 7.1.99" + reason: "indices options has been introduced in cluster health request starting version 7.2.0" + + - do: + cluster.health: + index: "index-*" + level: indices + expand_wildcards: open + - match: { status: green } + - match: { active_shards: 1 } + - match: { indices.index-1.status: green } + - match: { indices.index-1.active_shards: 1 } + - is_false: indices.index-2 + + - do: + cluster.health: + index: "index-*" + level: indices + expand_wildcards: closed + - match: { status: green } + - match: { active_shards: 2 } + - is_false: indices.index-1 + - match: { indices.index-2.status: green } + - match: { indices.index-2.active_shards: 2 } + + - do: + cluster.health: + index: "index-*" + level: indices + expand_wildcards: all + - match: { status: green } + - match: { active_shards: 3 } + - match: { indices.index-1.status: green } + - match: { indices.index-1.active_shards: 1 } + - match: { indices.index-2.status: green } + - match: { indices.index-2.active_shards: 2 } + + - do: + cluster.health: + index: "index-*" + level: indices + expand_wildcards: none + - match: { status: green } + - match: { active_shards: 0 } + - is_false: indices.index-1 + - is_false: indices.index-2 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.pending_tasks/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.pending_tasks/10_basic.yml new file mode 100644 index 0000000000000..f8fd8ebef170d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.pending_tasks/10_basic.yml @@ -0,0 +1,14 @@ +--- +"Test pending tasks": + - do: + cluster.pending_tasks: {} + + - is_true: tasks +--- +"Test pending tasks with local flag": + - do: + cluster.pending_tasks: + local: true + + - is_true: tasks + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.put_settings/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.put_settings/10_basic.yml new file mode 100644 index 0000000000000..825bac9f91649 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.put_settings/10_basic.yml @@ -0,0 +1,71 @@ +--- +"Test put and reset transient settings": + - do: + cluster.put_settings: + body: + transient: + cluster.routing.allocation.enable: "none" + flat_settings: true + + - match: {transient: {cluster.routing.allocation.enable: "none"}} + + - do: + cluster.get_settings: + flat_settings: true + + - match: {transient: {cluster.routing.allocation.enable: "none"}} + + - do: + cluster.put_settings: + body: + transient: + cluster.routing.allocation.enable: null + flat_settings: true + + - match: {transient: {}} + + - do: + cluster.get_settings: + flat_settings: true + + - match: {transient: {}} +--- +"Test put and reset persistent settings": + - do: + cluster.put_settings: + body: + persistent: + cluster.routing.allocation.enable: "none" + flat_settings: true + + - match: {persistent: {cluster.routing.allocation.enable: "none"}} + + - do: + cluster.get_settings: + flat_settings: true + + - match: {persistent: {cluster.routing.allocation.enable: "none"}} + + - do: + cluster.put_settings: + body: + persistent: + cluster.routing.allocation.enable: null + flat_settings: true + + - match: {persistent: {}} + + - do: + cluster.get_settings: + flat_settings: true + + - match: {persistent: {}} + +--- +"Test get a default settings": + + - do: + cluster.get_settings: + include_defaults: true + + - match: {defaults.node.attr.testattr: "test"} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.remote_info/10_info.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.remote_info/10_info.yml new file mode 100644 index 0000000000000..e11eff2b78a3c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.remote_info/10_info.yml @@ -0,0 +1,6 @@ +--- +"Get an empty remote info": + - do: + cluster.remote_info: {} + - is_true: '' + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/10_basic.yml new file mode 100644 index 0000000000000..771f647a952c7 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/10_basic.yml @@ -0,0 +1,4 @@ +--- +"Basic sanity check": + - do: + cluster.reroute: {} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/11_explain.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/11_explain.yml new file mode 100644 index 0000000000000..248b47d07a71e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/11_explain.yml @@ -0,0 +1,57 @@ +setup: + - do: + indices.create: + index: test_index + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + cluster.health: + wait_for_status: green + +--- +"Explain API with empty command list": + + - do: + cluster.reroute: + explain: true + dry_run: true + body: + commands: [] + + - match: {explanations: []} + +--- +"Explain API for non-existent node & shard": + - skip: + features: [arbitrary_key] + + - do: + nodes.info: + node_id: data:true + - set: + nodes._arbitrary_key_: node_id + + - do: + cluster.reroute: + explain: true + dry_run: true + body: + commands: + - cancel: + index: test_index + shard: 9 + node: $node_id + + - match: {explanations.0.command: cancel} + - match: + explanations.0.parameters: + index: test_index + shard: 9 + node: $node_id + allow_primary: false + - match: {explanations.0.decisions.0.decider: cancel_allocation_command} + - match: {explanations.0.decisions.0.decision: "NO"} + - is_true: explanations.0.decisions.0.explanation diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/20_response_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/20_response_filtering.yml new file mode 100644 index 0000000000000..437b78e6119a7 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/20_response_filtering.yml @@ -0,0 +1,14 @@ +--- +"Do not return metadata by default": + - do: + cluster.reroute: {} + - is_false: state.metadata +--- +"return metadata if requested": + - do: + cluster.reroute: + metric: metadata + + - is_true: state.metadata + - is_false: state.nodes + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/10_basic.yml new file mode 100644 index 0000000000000..b443e322f80f6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/10_basic.yml @@ -0,0 +1,19 @@ +--- +"get cluster state": + - do: + cluster.state: {} + + - is_true: master_node + +--- +"get cluster state returns cluster_uuid at the top level": + - skip: + version: " - 6.3.99" + reason: "cluster state including cluster_uuid at the top level is new in v6.4.0 and higher" + + - do: + cluster.state: + human: true + + - is_true: cluster_uuid + - is_true: master_node diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/20_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/20_filtering.yml new file mode 100644 index 0000000000000..88da42ee876be --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/20_filtering.yml @@ -0,0 +1,182 @@ +setup: + - do: + index: + index: testidx + id: testing_document + body: + "text" : "The quick brown fox is brown." + +--- +"Filtering the cluster state by blocks should return the blocks field even if the response is empty": + - do: + cluster.state: + metric: [ blocks ] + + - is_true: blocks + - is_false: nodes + - is_false: metadata + - is_false: routing_table + - is_false: routing_nodes + - length: { blocks: 0 } + +--- +"Filtering the cluster state by blocks should return the blocks": + - do: + indices.put_settings: + index: testidx + body: + index.blocks.read_only: true + - do: + cluster.state: + metric: [ blocks ] + + - is_true: blocks + - is_false: nodes + - is_false: metadata + - is_false: routing_table + - is_false: routing_nodes + - length: { blocks: 1 } + + - do: + indices.put_settings: + index: testidx + body: + index.blocks.read_only: false + +--- +"Filtering the cluster state by nodes only should work": + - do: + cluster.state: + metric: [ nodes ] + + - is_false: blocks + - is_true: nodes + - is_false: metadata + - is_false: routing_table + - is_false: routing_nodes + +--- +"Filtering the cluster state by metadata only should work": + - do: + cluster.state: + metric: [ metadata ] + + - is_false: blocks + - is_false: nodes + - is_true: metadata + - is_false: routing_table + - is_false: routing_nodes + + +--- +"Filtering the cluster state by routing table only should work": + - do: + cluster.state: + metric: [ routing_table ] + + - is_false: blocks + - is_false: nodes + - is_false: metadata + - is_true: routing_table + - is_false: routing_nodes + +--- +"Filtering the cluster state by routing nodes only should work": + - do: + cluster.state: + metric: [ routing_nodes ] + + - is_false: blocks + - is_false: nodes + - is_false: metadata + - is_false: routing_table + - is_true: routing_nodes + +--- +"Filtering the cluster state by indices should work in routing table and metadata": + - do: + index: + index: another + id: testing_document + body: + "text" : "The quick brown fox is brown." + + - do: + cluster.state: + metric: [ routing_table, metadata ] + index: [ testidx ] + + - is_false: metadata.indices.another + - is_false: routing_table.indices.another + - is_true: metadata.indices.testidx + - is_true: routing_table.indices.testidx + +--- +"Filtering the cluster state using _all for indices and metrics should work": + - do: + cluster.state: + metric: [ '_all' ] + index: [ '_all' ] + + - is_true: blocks + - is_true: nodes + - is_true: metadata + - is_true: routing_table + - is_true: routing_nodes + +--- +"Filtering the cluster state by indices using wildcards should work in routing table and metadata": + - do: + index: + index: index1 + id: testing_document + body: + "text" : "The quick brown fox is brown." + + - do: + index: + index: index2 + id: testing_document + body: + "text" : "The quick brown fox is brown." + + - do: + cluster.state: + metric: [ routing_table, metadata ] + index: [ index* ] + + - is_false: metadata.indices.testidx + - is_false: routing_table.indices.testidx + + - is_true: metadata.indices.index1 + - is_true: routing_table.indices.index1 + - is_true: metadata.indices.index2 + - is_true: routing_table.indices.index2 + +--- +"Filtering the cluster state returns cluster_uuid at the top level regardless of metric filters": + - skip: + version: " - 6.3.99" + reason: "cluster state including cluster_uuid at the top level is new in v6.4.0 and higher" + + # Get the current cluster_uuid + - do: + cluster.state: {} + - set: { metadata.cluster_uuid : cluster_uuid } + + - do: + cluster.state: + metric: [ master_node, version ] + + - match: { cluster_uuid: $cluster_uuid } + - is_true: master_node + - is_true: version + - is_true: state_uuid + + - do: + cluster.state: + metric: [ routing_table ] + index: testidx + + - match: { cluster_uuid: $cluster_uuid } + - is_true: routing_table diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/30_expand_wildcards.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/30_expand_wildcards.yml new file mode 100644 index 0000000000000..414620d13586d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/30_expand_wildcards.yml @@ -0,0 +1,92 @@ +setup: + + - do: + indices.create: + index: test_close_index + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + indices.create: + index: test_open_index + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + cluster.health: + wait_for_status: green + +# close one index, keep other open for later test + + - do: + indices.close: + index: test_close_index + +--- +"Test expand_wildcards parameter on closed, open indices and both": + + - do: + cluster.state: + metric: [ metadata ] + index: test* + expand_wildcards: [ closed ] + + - is_false: metadata.indices.test_open_index + - match: {metadata.indices.test_close_index.state: "close"} + + - do: + cluster.state: + metric: [ metadata ] + index: test* + expand_wildcards: [ open ] + + - match: {metadata.indices.test_open_index.state: "open"} + - is_false: metadata.indices.test_close_index + + - do: + cluster.state: + metric: [ metadata ] + index: test* + expand_wildcards: [ open,closed ] + + - match: {metadata.indices.test_open_index.state: "open"} + - match: {metadata.indices.test_close_index.state: "close"} + +--- +"Test ignore_unavailable parameter": + + - do: + cluster.state: + metric: [ metadata ] + index: foobla + ignore_unavailable: true + + - match: {metadata.indices: {}} + + - do: + catch: missing + cluster.state: + metric: [ metadata ] + index: foobla + ignore_unavailable: false + +--- +"Test allow_no_indices parameter": + + - do: + cluster.state: + metric: [ metadata ] + index: not_there* + + - match: {metadata.indices: {}} + + - do: + catch: missing + cluster.state: + metric: [ metadata ] + index: not_there* + allow_no_indices: false diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.stats/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.stats/10_basic.yml new file mode 100644 index 0000000000000..84bce35a07327 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.stats/10_basic.yml @@ -0,0 +1,145 @@ +--- +"cluster stats test": + - do: + cluster.stats: {} + + - is_true: timestamp + - is_true: cluster_name + - match: {status: green} + - gte: { indices.count: 0} + - is_true: indices.docs + - is_true: indices.store + - is_true: indices.fielddata + - is_true: indices.query_cache + - is_true: indices.completion + - is_true: indices.segments + - gte: { nodes.count.total: 1} + - gte: { nodes.count.master: 1} + - gte: { nodes.count.data: 1} + - gte: { nodes.count.ingest: 0} + - gte: { nodes.count.coordinating_only: 0} + - is_true: nodes.os + - is_true: nodes.os.mem.total_in_bytes + - is_true: nodes.os.mem.free_in_bytes + - is_true: nodes.os.mem.used_in_bytes + - gte: { nodes.os.mem.free_percent: 0 } + - gte: { nodes.os.mem.used_percent: 0 } + - is_true: nodes.process + - is_true: nodes.jvm + - is_true: nodes.fs + - is_true: nodes.plugins + - is_true: nodes.network_types + +--- +"get cluster stats returns cluster_uuid at the top level": + - skip: + version: " - 6.99.99" + reason: "cluster stats including cluster_uuid at the top level is new in v6.5.0 and higher" + + - do: + cluster.stats: {} + + - is_true: cluster_uuid + - is_true: timestamp + - is_true: cluster_name + - match: {status: green} + - gte: { indices.count: 0} + - is_true: indices.docs + - is_true: indices.store + - is_true: indices.fielddata + - is_true: indices.query_cache + - is_true: indices.completion + - is_true: indices.segments + - gte: { nodes.count.total: 1} + - gte: { nodes.count.master: 1} + - gte: { nodes.count.data: 1} + - gte: { nodes.count.ingest: 0} + - gte: { nodes.count.coordinating_only: 0} + - is_true: nodes.os + - is_true: nodes.os.mem.total_in_bytes + - is_true: nodes.os.mem.free_in_bytes + - is_true: nodes.os.mem.used_in_bytes + - gte: { nodes.os.mem.free_percent: 0 } + - gte: { nodes.os.mem.used_percent: 0 } + - is_true: nodes.process + - is_true: nodes.jvm + - is_true: nodes.fs + - is_true: nodes.plugins + - is_true: nodes.network_types + +--- +"get cluster stats returns discovery types": + - skip: + version: " - 6.99.99" + reason: "discovery types are added for v7.0.0" + + - do: + cluster.stats: {} + + - is_true: nodes.discovery_types + +--- +"get cluster stats returns packaging types": + + - skip: + version: " - 7.1.99" + reason: "packaging types are added for v7.2.0" + + - do: + cluster.stats: {} + + - is_true: nodes.packaging_types + +--- +"get cluster stats returns mapping stats": + + - skip: + version: " - 7.6.99" + reason: "mapping stats are added for v7.7.0" + + - do: + cluster.stats: {} + + - length: { indices.mappings.field_types: 0 } + + - do: + indices.create: + index: test-index1 + body: + mappings: + properties: + foo: + type: keyword + + - do: + indices.create: + index: test-index2 + body: + mappings: + properties: + foo: + type: keyword + bar: + properties: + quux: + type: integer + baz: + type: keyword + + - do: + cluster.stats: {} + + - length: { indices.mappings.field_types: 3 } + + - match: { indices.mappings.field_types.0.name: integer } + - match: { indices.mappings.field_types.0.count: 1 } + - match: { indices.mappings.field_types.0.index_count: 1 } + + - match: { indices.mappings.field_types.1.name: keyword } + - match: { indices.mappings.field_types.1.count: 3 } + - match: { indices.mappings.field_types.1.index_count: 2 } + + - match: { indices.mappings.field_types.2.name: object } + - match: { indices.mappings.field_types.2.count: 1 } + - match: { indices.mappings.field_types.2.index_count: 1 } + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/count/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/count/10_basic.yml new file mode 100644 index 0000000000000..09d96670f688e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/count/10_basic.yml @@ -0,0 +1,61 @@ +setup: + - do: + indices.create: + index: test + - do: + index: + index: test + id: 1 + body: { foo: bar } + + - do: + indices.refresh: + index: [test] + +--- +"count with body": + - do: + count: + index: test + body: + query: + match: + foo: bar + + - match: {count : 1} + + - do: + count: + index: test + body: + query: + match: + foo: test + + - match: {count : 0} + +--- +"count with empty body": +# empty body should default to match_all query + - do: + count: + index: test + body: { } + + - match: {count : 1} + + - do: + count: + index: test + + - match: {count : 1} + +--- +"count body without query element": + - do: + catch: bad_request + count: + index: test + body: + match: + foo: bar diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/count/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/count/11_basic_with_types.yml new file mode 100644 index 0000000000000..48cfc610b435e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/count/11_basic_with_types.yml @@ -0,0 +1,66 @@ +setup: + - do: + indices.create: + index: test + - do: + index: + index: test + type: test + id: 1 + body: { foo: bar } + + - do: + indices.refresh: + index: [test] + +--- +"count with body": + - do: + count: + index: test + type: test + body: + query: + match: + foo: bar + + - match: {count : 1} + + - do: + count: + index: test + body: + query: + match: + foo: test + + - match: {count : 0} + +--- +"count with empty body": +# empty body should default to match_all query + - do: + count: + index: test + type: test + body: { } + + - match: {count : 1} + + - do: + count: + index: test + type: test + + - match: {count : 1} + +--- +"count body without query element": + - do: + catch: bad_request + count: + index: test + type: test + body: + match: + foo: bar diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/count/20_query_string.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/count/20_query_string.yml new file mode 100644 index 0000000000000..66b0699a184d2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/count/20_query_string.yml @@ -0,0 +1,58 @@ +--- +"count with query_string parameters": + - do: + indices.create: + index: test + body: + mappings: + properties: + number: + type: integer + + - do: + index: + index: test + id: 1 + body: { field: foo bar} + + - do: + indices.refresh: + index: [test] + + - do: + count: + index: test + q: bar + df: field + + - match: {count : 1} + + - do: + count: + index: test + q: field:foo field:xyz + + - match: {count : 1} + + - do: + count: + index: test + q: field:foo field:xyz + default_operator: AND + + - match: {count : 0} + + - do: + count: + index: test + q: field:BA* + + - match: {count : 1} + + - do: + count: + index: test + q: number:foo + lenient: true + + - match: {count : 0} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/10_with_id.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/10_with_id.yml new file mode 100644 index 0000000000000..410b31acb7138 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/create/10_with_id.yml @@ -0,0 +1,31 @@ +--- +"Create with ID": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + create: + index: test_1 + id: 1 + body: { foo: bar } + + - match: { _index: test_1 } + - match: { _id: "1"} + - match: { _version: 1} + + - do: + get: + index: test_1 + id: 1 + + - match: { _index: test_1 } + - match: { _id: "1"} + - match: { _version: 1} + - match: { _source: { foo: bar }} + + - do: + catch: conflict + create: + index: test_1 + id: 1 + body: { foo: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/11_with_id_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/11_with_id_with_types.yml new file mode 100644 index 0000000000000..1e58c38c7b589 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/create/11_with_id_with_types.yml @@ -0,0 +1,33 @@ +--- +"Create with ID": + - do: + create: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - match: { _index: test_1 } + - match: { _type: test } + - match: { _id: "1"} + - match: { _version: 1} + + - do: + get: + index: test_1 + type: test + id: 1 + + - match: { _index: test_1 } + - match: { _type: test } + - match: { _id: "1"} + - match: { _version: 1} + - match: { _source: { foo: bar }} + + - do: + catch: conflict + create: + index: test_1 + type: test + id: 1 + body: { foo: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id.yml new file mode 100644 index 0000000000000..5280c5bb9946d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id.yml @@ -0,0 +1,10 @@ +--- +"Create without ID": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + catch: param + create: + index: test_1 + body: { foo: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id_with_types.yml new file mode 100644 index 0000000000000..ab9932819381f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id_with_types.yml @@ -0,0 +1,8 @@ +--- +"Create without ID": + - do: + catch: param + create: + index: test_1 + type: test + body: { foo: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/35_external_version.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/35_external_version.yml new file mode 100644 index 0000000000000..47dc5b6059609 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/create/35_external_version.yml @@ -0,0 +1,30 @@ +--- +"External version": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + catch: bad_request + create: + index: test + id: 1 + body: { foo: bar } + version_type: external + version: 0 + + - match: { status: 400 } + - match: { error.type: action_request_validation_exception } + - match: { error.reason: "Validation Failed: 1: create operations only support internal versioning. use index instead;" } + + - do: + catch: bad_request + create: + index: test + id: 2 + body: { foo: bar } + version_type: external + version: 5 + + - match: { status: 400 } + - match: { error.type: action_request_validation_exception } + - match: { error.reason: "Validation Failed: 1: create operations only support internal versioning. use index instead;" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/36_external_version_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/36_external_version_with_types.yml new file mode 100644 index 0000000000000..cb8c041d7102c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/create/36_external_version_with_types.yml @@ -0,0 +1,30 @@ +--- +"External version": + + - do: + catch: bad_request + create: + index: test + type: test + id: 1 + body: { foo: bar } + version_type: external + version: 0 + + - match: { status: 400 } + - match: { error.type: action_request_validation_exception } + - match: { error.reason: "Validation Failed: 1: create operations only support internal versioning. use index instead;" } + + - do: + catch: bad_request + create: + index: test + type: test + id: 2 + body: { foo: bar } + version_type: external + version: 5 + + - match: { status: 400 } + - match: { error.type: action_request_validation_exception } + - match: { error.reason: "Validation Failed: 1: create operations only support internal versioning. use index instead;" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/40_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/40_routing.yml new file mode 100644 index 0000000000000..9c048c361bd5c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/create/40_routing.yml @@ -0,0 +1,42 @@ +--- +"Routing": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + create: + index: test_1 + id: 1 + routing: 5 + body: { foo: bar } + + - do: + get: + index: test_1 + id: 1 + routing: 5 + stored_fields: [_routing] + + - match: { _id: "1"} + - match: { _routing: "5"} + + - do: + catch: missing + get: + index: test_1 + id: 1 + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/41_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/41_routing_with_types.yml new file mode 100644 index 0000000000000..752489f722c9e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/create/41_routing_with_types.yml @@ -0,0 +1,43 @@ +--- +"Routing": + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + create: + index: test_1 + type: test + id: 1 + routing: 5 + body: { foo: bar } + + - do: + get: + index: test_1 + type: test + id: 1 + routing: 5 + stored_fields: [_routing] + + - match: { _id: "1"} + - match: { _routing: "5"} + + - do: + catch: missing + get: + index: test_1 + type: test + id: 1 + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/60_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/60_refresh.yml new file mode 100644 index 0000000000000..dd8acd9f99f4f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/create/60_refresh.yml @@ -0,0 +1,86 @@ +--- +"Refresh": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + indices.create: + index: test_1 + body: + settings: + index.refresh_interval: -1 + number_of_replicas: 0 + - do: + create: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 1 }} + + - match: { hits.total: 0 } + + - do: + create: + index: test_1 + id: 2 + refresh: true + body: { foo: bar } + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 2 }} + + - match: { hits.total: 1 } + +--- +"When refresh url parameter is an empty string that means \"refresh immediately\"": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + create: + index: test_1 + id: 1 + refresh: "" + body: { foo: bar } + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 1 }} + + - match: { hits.total: 1 } + +--- +"refresh=wait_for waits until changes are visible in search": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + index: + index: create_60_refresh_1 + id: create_60_refresh_id1 + body: { foo: bar } + refresh: wait_for + - is_false: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: create_60_refresh_1 + body: + query: { term: { _id: create_60_refresh_id1 }} + - match: { hits.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/61_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/61_refresh_with_types.yml new file mode 100644 index 0000000000000..e24bdf4260340 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/create/61_refresh_with_types.yml @@ -0,0 +1,82 @@ +--- +"Refresh": + + - do: + indices.create: + index: test_1 + body: + settings: + index.refresh_interval: -1 + number_of_replicas: 0 + - do: + create: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 1 }} + + - match: { hits.total: 0 } + + - do: + create: + index: test_1 + type: test + id: 2 + refresh: true + body: { foo: bar } + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 2 }} + + - match: { hits.total: 1 } + +--- +"When refresh url parameter is an empty string that means \"refresh immediately\"": + - do: + create: + index: test_1 + type: test + id: 1 + refresh: "" + body: { foo: bar } + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 1 }} + + - match: { hits.total: 1 } + +--- +"refresh=wait_for waits until changes are visible in search": + - do: + index: + index: create_60_refresh_1 + type: test + id: create_60_refresh_id1 + body: { foo: bar } + refresh: wait_for + - is_false: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: create_60_refresh_1 + body: + query: { term: { _id: create_60_refresh_id1 }} + - match: { hits.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/70_nested.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/70_nested.yml new file mode 100644 index 0000000000000..e6d2413f16788 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/create/70_nested.yml @@ -0,0 +1,41 @@ +--- +setup: + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + indices.create: + index: test_1 + body: + settings: + index.mapping.nested_objects.limit: 2 + mappings: + properties: + nested1: + type: nested + +--- +"Indexing a doc with No. nested objects less or equal to index.mapping.nested_objects.limit should succeed": + - skip: + version: " - 6.99.99" + reason: index.mapping.nested_objects setting has been added in 7.0.0 + - do: + create: + index: test_1 + id: 1 + body: + "nested1" : [ { "foo": "bar" }, { "foo": "bar2" } ] + - match: { _version: 1} + +--- +"Indexing a doc with No. nested objects more than index.mapping.nested_objects.limit should fail": + - skip: + version: " - 6.99.99" + reason: index.mapping.nested_objects setting has been added in 7.0.0 + - do: + catch: /The number of nested documents has exceeded the allowed limit of \[2\]. This limit can be set by changing the \[index.mapping.nested_objects.limit\] index level setting\./ + create: + index: test_1 + id: 1 + body: + "nested1" : [ { "foo": "bar" }, { "foo": "bar2" }, { "foo": "bar3" } ] diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/71_nested_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/71_nested_with_types.yml new file mode 100644 index 0000000000000..755aaca448b0b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/create/71_nested_with_types.yml @@ -0,0 +1,42 @@ +--- +setup: + - do: + indices.create: + include_type_name: true + index: test_1 + body: + settings: + index.mapping.nested_objects.limit: 2 + mappings: + test_type: + properties: + nested1: + type: nested + +--- +"Indexing a doc with No. nested objects less or equal to index.mapping.nested_objects.limit should succeed": + - skip: + version: " - 6.99.99" + reason: index.mapping.nested_objects setting has been added in 7.0.0 + - do: + create: + index: test_1 + type: test_type + id: 1 + body: + "nested1" : [ { "foo": "bar" }, { "foo": "bar2" } ] + - match: { _version: 1} + +--- +"Indexing a doc with No. nested objects more than index.mapping.nested_objects.limit should fail": + - skip: + version: " - 6.99.99" + reason: index.mapping.nested_objects setting has been added in 7.0.0 + - do: + catch: /The number of nested documents has exceeded the allowed limit of \[2\]. This limit can be set by changing the \[index.mapping.nested_objects.limit\] index level setting\./ + create: + index: test_1 + type: test_type + id: 1 + body: + "nested1" : [ { "foo": "bar" }, { "foo": "bar2" }, { "foo": "bar3" } ] diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/create/TODO.txt new file mode 100644 index 0000000000000..389a47c7b7a2c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/create/TODO.txt @@ -0,0 +1,3 @@ +Tests missing for: + +# consistency diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/10_basic.yml new file mode 100644 index 0000000000000..842d749d7b14d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/10_basic.yml @@ -0,0 +1,21 @@ +--- +"Basic": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - match: { _version: 1 } + + - do: + delete: + index: test_1 + id: 1 + + - match: { _version: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/11_shard_header.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/11_shard_header.yml new file mode 100644 index 0000000000000..3fc10bc8db12d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/11_shard_header.yml @@ -0,0 +1,38 @@ +--- +"Delete check shard header": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: foobar + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: foobar + id: 1 + body: { foo: bar } + + - do: + delete: + index: foobar + id: 1 + + - match: { _index: foobar } + - match: { _type: _doc } + - match: { _id: "1"} + - match: { _version: 2} + - match: { _shards.total: 1} + - match: { _shards.successful: 1} + - match: { _shards.failed: 0} + - is_false: _shards.pending diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/12_result.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/12_result.yml new file mode 100644 index 0000000000000..13356cd938c48 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/12_result.yml @@ -0,0 +1,27 @@ +--- +"Delete result field": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + delete: + index: test_1 + id: 1 + + - match: { result: deleted } + + - do: + catch: missing + delete: + index: test_1 + id: 1 + + - match: { result: not_found } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/13_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/13_basic_with_types.yml new file mode 100644 index 0000000000000..a3671d5ac24b0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/13_basic_with_types.yml @@ -0,0 +1,19 @@ +--- +"Basic": + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - match: { _version: 1 } + + - do: + delete: + index: test_1 + type: test + id: 1 + + - match: { _version: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/14_shard_header_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/14_shard_header_with_types.yml new file mode 100644 index 0000000000000..d1bb4c0df347d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/14_shard_header_with_types.yml @@ -0,0 +1,36 @@ +--- +"Delete check shard header": + + - do: + indices.create: + index: foobar + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: foobar + type: baz + id: 1 + body: { foo: bar } + + - do: + delete: + index: foobar + type: baz + id: 1 + + - match: { _index: foobar } + - match: { _type: baz } + - match: { _id: "1"} + - match: { _version: 2} + - match: { _shards.total: 1} + - match: { _shards.successful: 1} + - match: { _shards.failed: 0} + - is_false: _shards.pending diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/15_result_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/15_result_with_types.yml new file mode 100644 index 0000000000000..d01e88be8ad0b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/15_result_with_types.yml @@ -0,0 +1,26 @@ +--- +"Delete result field": + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + delete: + index: test_1 + type: test + id: 1 + + - match: { result: deleted } + + - do: + catch: missing + delete: + index: test_1 + type: test + id: 1 + + - match: { result: not_found } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/20_cas.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/20_cas.yml new file mode 100644 index 0000000000000..f3c7b0acbcccd --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/20_cas.yml @@ -0,0 +1,31 @@ +--- +"Internal version": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - match: { _seq_no: 0 } + + - do: + catch: conflict + delete: + index: test_1 + id: 1 + if_seq_no: 2 + if_primary_term: 1 + + - do: + delete: + index: test_1 + id: 1 + if_seq_no: 0 + if_primary_term: 1 + + - match: { _seq_no: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/21_cas_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/21_cas_with_types.yml new file mode 100644 index 0000000000000..ef352a9bad6b1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/21_cas_with_types.yml @@ -0,0 +1,30 @@ +--- +"Internal version": + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - match: { _seq_no: 0 } + + - do: + catch: conflict + delete: + index: test_1 + type: test + id: 1 + if_seq_no: 2 + if_primary_term: 1 + + - do: + delete: + index: test_1 + type: test + id: 1 + if_seq_no: 0 + if_primary_term: 1 + + - match: { _seq_no: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/25_external_version.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/25_external_version.yml new file mode 100644 index 0000000000000..d7cc4fce0eda5 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/25_external_version.yml @@ -0,0 +1,33 @@ +--- +"External version": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + version_type: external + version: 5 + + - match: { _version: 5} + + - do: + catch: conflict + delete: + index: test_1 + id: 1 + version_type: external + version: 4 + + - do: + delete: + index: test_1 + id: 1 + version_type: external + version: 6 + + - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/26_external_gte_version.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/26_external_gte_version.yml new file mode 100644 index 0000000000000..ebe1680551c96 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/26_external_gte_version.yml @@ -0,0 +1,52 @@ +--- +"External GTE version": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + version_type: external_gte + version: 5 + + - match: { _version: 5} + + - do: + catch: conflict + delete: + index: test_1 + id: 1 + version_type: external_gte + version: 4 + + - do: + delete: + index: test_1 + id: 1 + version_type: external_gte + version: 6 + + - match: { _version: 6} + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + version_type: external_gte + version: 6 + + - match: { _version: 6} + + - do: + delete: + index: test_1 + id: 1 + version_type: external_gte + version: 6 + + - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/27_external_version_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/27_external_version_with_types.yml new file mode 100644 index 0000000000000..453d64d85bbc1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/27_external_version_with_types.yml @@ -0,0 +1,32 @@ +--- +"External version": + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + version_type: external + version: 5 + + - match: { _version: 5} + + - do: + catch: conflict + delete: + index: test_1 + type: test + id: 1 + version_type: external + version: 4 + + - do: + delete: + index: test_1 + type: test + id: 1 + version_type: external + version: 6 + + - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/28_external_gte_version_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/28_external_gte_version_with_types.yml new file mode 100644 index 0000000000000..70f78c17faa63 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/28_external_gte_version_with_types.yml @@ -0,0 +1,53 @@ +--- +"External GTE version": + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + version_type: external_gte + version: 5 + + - match: { _version: 5} + + - do: + catch: conflict + delete: + index: test_1 + type: test + id: 1 + version_type: external_gte + version: 4 + + - do: + delete: + index: test_1 + type: test + id: 1 + version_type: external_gte + version: 6 + + - match: { _version: 6} + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + version_type: external_gte + version: 6 + + - match: { _version: 6} + + - do: + delete: + index: test_1 + type: test + id: 1 + version_type: external_gte + version: 6 + + - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/30_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/30_routing.yml new file mode 100644 index 0000000000000..27e9350caed70 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/30_routing.yml @@ -0,0 +1,33 @@ +--- +"Routing": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + settings: + number_of_shards: 5 + - do: + index: + index: test_1 + id: 1 + routing: 5 + body: { foo: bar } + + - do: + catch: missing + delete: + index: test_1 + id: 1 + routing: 4 + + - do: + delete: + index: test_1 + id: 1 + routing: 5 + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/31_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/31_routing_with_types.yml new file mode 100644 index 0000000000000..6f67b3a03f401 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/31_routing_with_types.yml @@ -0,0 +1,32 @@ +--- +"Routing": + + - do: + indices.create: + index: test_1 + body: + settings: + number_of_shards: 5 + - do: + index: + index: test_1 + type: test + id: 1 + routing: 5 + body: { foo: bar } + + - do: + catch: missing + delete: + index: test_1 + type: test + id: 1 + routing: 4 + + - do: + delete: + index: test_1 + type: test + id: 1 + routing: 5 + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/50_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/50_refresh.yml new file mode 100644 index 0000000000000..935e0946f100b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/50_refresh.yml @@ -0,0 +1,154 @@ +--- +"Refresh": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + settings: + refresh_interval: -1 + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + refresh: true + +# If you wonder why this document get 3 as an id instead of 2, it is because the +# current routing algorithm would route 1 and 2 to the same shard while we need +# them to be different for this test to pass + - do: + index: + index: test_1 + id: 3 + body: { foo: bar } + refresh: true + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { terms: { _id: [1,3] }} + + - match: { hits.total: 2 } + + - do: + delete: + index: test_1 + id: 1 + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { terms: { _id: [1,3] }} + + - match: { hits.total: 2 } + + - do: + delete: + index: test_1 + id: 3 + refresh: true + +# If a replica shard where doc 1 is located gets initialized at this point, doc 1 +# won't be found by the following search as the shard gets automatically refreshed +# right before getting started. This is why this test only works with 0 replicas. + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { terms: { _id: [1,3] }} + + - match: { hits.total: 1 } + +--- +"When refresh url parameter is an empty string that means \"refresh immediately\"": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + refresh: true + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 1 }} + - match: { hits.total: 1 } + + - do: + delete: + index: test_1 + id: 1 + refresh: "" + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 1 }} + - match: { hits.total: 0 } + +--- +"refresh=wait_for waits until changes are visible in search": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: delete_50_refresh_1 + id: delete_50_refresh_id1 + body: { foo: bar } + refresh: true + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: delete_50_refresh_1 + body: + query: { term: { _id: delete_50_refresh_id1 }} + - match: { hits.total: 1 } + + - do: + delete: + index: delete_50_refresh_1 + id: delete_50_refresh_id1 + refresh: wait_for + - is_false: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: delete_50_refresh_1 + body: + query: { term: { _id: delete_50_refresh_id1 }} + - match: { hits.total: 0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/51_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/51_refresh_with_types.yml new file mode 100644 index 0000000000000..a901c1033f7c0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/51_refresh_with_types.yml @@ -0,0 +1,148 @@ +--- +"Refresh": + + - do: + indices.create: + index: test_1 + body: + settings: + refresh_interval: -1 + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + refresh: true + +# If you wonder why this document get 3 as an id instead of 2, it is because the +# current routing algorithm would route 1 and 2 to the same shard while we need +# them to be different for this test to pass + - do: + index: + index: test_1 + type: test + id: 3 + body: { foo: bar } + refresh: true + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { terms: { _id: [1,3] }} + + - match: { hits.total: 2 } + + - do: + delete: + index: test_1 + type: test + id: 1 + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { terms: { _id: [1,3] }} + + - match: { hits.total: 2 } + + - do: + delete: + index: test_1 + type: test + id: 3 + refresh: true + +# If a replica shard where doc 1 is located gets initialized at this point, doc 1 +# won't be found by the following search as the shard gets automatically refreshed +# right before getting started. This is why this test only works with 0 replicas. + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { terms: { _id: [1,3] }} + + - match: { hits.total: 1 } + +--- +"When refresh url parameter is an empty string that means \"refresh immediately\"": + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + refresh: true + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 1 }} + - match: { hits.total: 1 } + + - do: + delete: + index: test_1 + type: test + id: 1 + refresh: "" + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 1 }} + - match: { hits.total: 0 } + +--- +"refresh=wait_for waits until changes are visible in search": + - do: + index: + index: delete_50_refresh_1 + type: test + id: delete_50_refresh_id1 + body: { foo: bar } + refresh: true + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: delete_50_refresh_1 + body: + query: { term: { _id: delete_50_refresh_id1 }} + - match: { hits.total: 1 } + + - do: + delete: + index: delete_50_refresh_1 + type: test + id: delete_50_refresh_id1 + refresh: wait_for + - is_false: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: delete_50_refresh_1 + body: + query: { term: { _id: delete_50_refresh_id1 }} + - match: { hits.total: 0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/60_missing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/60_missing.yml new file mode 100644 index 0000000000000..b8f81080f3ee8 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/60_missing.yml @@ -0,0 +1,25 @@ +--- +"Missing document with catch": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + catch: missing + delete: + index: test_1 + id: 1 + +--- +"Missing document with ignore": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + delete: + index: test_1 + id: 1 + ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/61_missing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/61_missing_with_types.yml new file mode 100644 index 0000000000000..9cfdb48ae20aa --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/61_missing_with_types.yml @@ -0,0 +1,19 @@ +--- +"Missing document with catch": + + - do: + catch: missing + delete: + index: test_1 + type: test + id: 1 + +--- +"Missing document with ignore": + + - do: + delete: + index: test_1 + type: test + id: 1 + ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/70_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/70_mix_typeless_typeful.yml new file mode 100644 index 0000000000000..e0f20795e41ca --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/70_mix_typeless_typeful.yml @@ -0,0 +1,43 @@ +--- +"DELETE with typeless API on an index that has types": + + - skip: + version: " - 6.99.99" + reason: Typeless APIs were introduced in 7.0.0 + + - do: + indices.create: # not using include_type_name: false on purpose + include_type_name: true + index: index + body: + mappings: + not_doc: + properties: + foo: + type: "keyword" + + - do: + index: + index: index + type: not_doc + id: 1 + body: { foo: bar } + + - do: + catch: bad_request + delete: + index: index + type: some_random_type + id: 1 + + - match: { error.root_cause.0.reason: "/Rejecting.mapping.update.to.\\[index\\].as.the.final.mapping.would.have.more.than.1.type.*/" } + + - do: + delete: + index: index + id: 1 + + - match: { _index: "index" } + - match: { _type: "_doc" } + - match: { _id: "1"} + - match: { _version: 2} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/TODO.txt new file mode 100644 index 0000000000000..3124bcf6f437f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/TODO.txt @@ -0,0 +1,5 @@ +Tests missing for: + +# consistency +# timeout + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/10_basic.yml new file mode 100644 index 0000000000000..1ab90e3efa83f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/10_basic.yml @@ -0,0 +1,35 @@ +--- +"Basic": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + exists: + index: test_1 + id: 1 + + - is_false: '' + + - do: + index: + index: test_1 + id: 1 + body: { "foo": "bar" } + + - is_true: '' + + - do: + exists: + index: test_1 + id: 1 + + - is_true: '' + + - do: + exists: + index: test_1 + id: 1 + version: 1 + + - is_true: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/11_basic_with_types.yml new file mode 100644 index 0000000000000..7e4e26b6b1c1c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/11_basic_with_types.yml @@ -0,0 +1,36 @@ +--- +"Basic": + + - do: + exists: + index: test_1 + type: test + id: 1 + + - is_false: '' + + - do: + index: + index: test_1 + type: test + id: 1 + body: { "foo": "bar" } + + - is_true: '' + + - do: + exists: + index: test_1 + type: test + id: 1 + + - is_true: '' + + - do: + exists: + index: test_1 + type: test + id: 1 + version: 1 + + - is_true: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/40_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/40_routing.yml new file mode 100644 index 0000000000000..8d59c8a0535f5 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/40_routing.yml @@ -0,0 +1,41 @@ +--- +"Routing": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + id: 1 + routing: 5 + body: { foo: bar } + + - do: + exists: + index: test_1 + id: 1 + routing: 5 + + - is_true: '' + + - do: + exists: + index: test_1 + id: 1 + + - is_false: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/41_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/41_routing_with_types.yml new file mode 100644 index 0000000000000..25315628d7ece --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/41_routing_with_types.yml @@ -0,0 +1,41 @@ +--- +"Routing": + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + type: test + id: 1 + routing: 5 + body: { foo: bar } + + - do: + exists: + index: test_1 + type: test + id: 1 + routing: 5 + + - is_true: '' + + - do: + exists: + index: test_1 + type: test + id: 1 + + - is_false: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/60_realtime_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/60_realtime_refresh.yml new file mode 100644 index 0000000000000..e12a504349c4d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/60_realtime_refresh.yml @@ -0,0 +1,49 @@ +--- +"Realtime Refresh": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + settings: + index: + refresh_interval: -1 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + exists: + index: test_1 + id: 1 + realtime: false + + - is_false: '' + + - do: + exists: + index: test_1 + id: 1 + realtime: true + + - is_true: '' + + - do: + exists: + index: test_1 + id: 1 + realtime: false + refresh: true + + - is_true: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/61_realtime_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/61_realtime_refresh_with_types.yml new file mode 100644 index 0000000000000..df8c697e4a1fb --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/61_realtime_refresh_with_types.yml @@ -0,0 +1,50 @@ +--- +"Realtime Refresh": + + - do: + indices.create: + index: test_1 + body: + settings: + index: + refresh_interval: -1 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + exists: + index: test_1 + type: test + id: 1 + realtime: false + + - is_false: '' + + - do: + exists: + index: test_1 + type: test + id: 1 + realtime: true + + - is_true: '' + + - do: + exists: + index: test_1 + type: test + id: 1 + realtime: false + refresh: true + + - is_true: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/70_defaults.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/70_defaults.yml new file mode 100644 index 0000000000000..6fabdd59820cf --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/70_defaults.yml @@ -0,0 +1,18 @@ +--- +"Client-side default type": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { "foo": "bar" } + + - do: + exists: + index: test_1 + id: 1 + + - is_true: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/71_defaults_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/71_defaults_with_types.yml new file mode 100644 index 0000000000000..2db28f6634bd6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/71_defaults_with_types.yml @@ -0,0 +1,17 @@ +--- +"Client-side default type": + + - do: + index: + index: test_1 + type: test + id: 1 + body: { "foo": "bar" } + + - do: + exists: + index: test_1 + type: _all + id: 1 + + - is_true: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/TODO.txt new file mode 100644 index 0000000000000..340ff579b41e0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/TODO.txt @@ -0,0 +1,3 @@ +Tests missing for: + +# preference diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/10_basic.yml new file mode 100644 index 0000000000000..bfe8da8d91519 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/10_basic.yml @@ -0,0 +1,65 @@ +setup: + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + aliases: + alias_1: + "filter" : { "term" : { "foo" : "bar"} } + + - do: + index: + index: test_1 + id: id_1 + body: { foo: bar, title: howdy } + + - do: + indices.refresh: {} + +--- +"Basic explain": + + - do: + explain: + index: test_1 + id: id_1 + body: + query: + match_all: {} + + - is_true: matched + - match: { explanation.value: 1 } + - match: { _index: test_1 } + - match: { _type: _doc } + - match: { _id: id_1 } + +--- +"Basic explain with alias": + + - do: + explain: + index: alias_1 + id: id_1 + body: + query: + match_all: {} + + - is_true: matched + - match: { explanation.value: 1 } + - match: { _index: test_1 } + - match: { _type: _doc } + - match: { _id: id_1 } + +--- +"Explain body without query element": + - do: + catch: bad_request + explain: + index: test_1 + id: id_1 + body: + match_all: {} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/11_basic_with_types.yml new file mode 100644 index 0000000000000..5f211435ae976 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/11_basic_with_types.yml @@ -0,0 +1,66 @@ +setup: + - do: + indices.create: + index: test_1 + body: + aliases: + alias_1: + "filter" : { "term" : { "foo" : "bar"} } + + - do: + index: + index: test_1 + type: test + id: id_1 + body: { foo: bar, title: howdy } + + - do: + indices.refresh: {} + +--- +"Basic explain": + + - do: + explain: + index: test_1 + type: test + id: id_1 + body: + query: + match_all: {} + + - is_true: matched + - match: { explanation.value: 1 } + - match: { _index: test_1 } + - match: { _type: test } + - match: { _id: id_1 } + +--- +"Basic explain with alias": + + - do: + explain: + index: alias_1 + type: test + id: id_1 + body: + query: + match_all: {} + + - is_true: matched + - match: { explanation.value: 1 } + - match: { _index: test_1 } + - match: { _type: test } + - match: { _id: id_1 } + +--- +"Explain body without query element": + - do: + catch: bad_request + explain: + index: test_1 + type: test + id: id_1 + body: + match_all: {} + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/20_source_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/20_source_filtering.yml new file mode 100644 index 0000000000000..ad596f980807b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/20_source_filtering.yml @@ -0,0 +1,47 @@ +--- +"Source filtering": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } + - do: + indices.refresh: + index: test_1 + + - do: + explain: { index: test_1, id: 1, _source: false, body: { query: { match_all: {}} } } + - match: { _index: test_1 } + - match: { _type: _doc } + - match: { _id: "1" } + - is_false: get._source + + - do: + explain: { index: test_1, id: 1, _source: true, body: { query: { match_all: {}} } } + - match: { get._source.include.field1: v1 } + + - do: + explain: { index: test_1, id: 1, _source: include.field1, body: { query: { match_all: {}} } } + - match: { get._source.include.field1: v1 } + - is_false: get._source.include.field2 + + - do: + explain: { index: test_1, id: 1, _source_includes: include.field1, body: { query: { match_all: {}} } } + - match: { get._source.include.field1: v1 } + - is_false: get._source.include.field2 + + - do: + explain: { index: test_1, id: 1, _source_includes: "include.field1,include.field2", body: { query: { match_all: {}} } } + - match: { get._source.include.field1: v1 } + - match: { get._source.include.field2: v2 } + - is_false: get._source.count + + - do: + explain: { index: test_1, id: 1, _source_includes: include, _source_excludes: "*.field2", body: { query: { match_all: {}} } } + - match: { get._source.include.field1: v1 } + - is_false: get._source.include.field2 + - is_false: get._source.count diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/21_source_filtering_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/21_source_filtering_with_types.yml new file mode 100644 index 0000000000000..e13edf7be5046 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/21_source_filtering_with_types.yml @@ -0,0 +1,44 @@ +--- +"Source filtering": + - do: + index: + index: test_1 + type: test + id: 1 + body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } + - do: + indices.refresh: + index: test_1 + + - do: + explain: { index: test_1, type: test, id: 1, _source: false, body: { query: { match_all: {}} } } + - match: { _index: test_1 } + - match: { _type: test } + - match: { _id: "1" } + - is_false: get._source + + - do: + explain: { index: test_1, type: test, id: 1, _source: true, body: { query: { match_all: {}} } } + - match: { get._source.include.field1: v1 } + + - do: + explain: { index: test_1, type: test, id: 1, _source: include.field1, body: { query: { match_all: {}} } } + - match: { get._source.include.field1: v1 } + - is_false: get._source.include.field2 + + - do: + explain: { index: test_1, type: test, id: 1, _source_includes: include.field1, body: { query: { match_all: {}} } } + - match: { get._source.include.field1: v1 } + - is_false: get._source.include.field2 + + - do: + explain: { index: test_1, type: test, id: 1, _source_includes: "include.field1,include.field2", body: { query: { match_all: {}} } } + - match: { get._source.include.field1: v1 } + - match: { get._source.include.field2: v2 } + - is_false: get._source.count + + - do: + explain: { index: test_1, type: test, id: 1, _source_includes: include, _source_excludes: "*.field2", body: { query: { match_all: {}} } } + - match: { get._source.include.field1: v1 } + - is_false: get._source.include.field2 + - is_false: get._source.count diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/30_query_string.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/30_query_string.yml new file mode 100644 index 0000000000000..ac34d4c2495f2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/30_query_string.yml @@ -0,0 +1,67 @@ +--- +"explain with query_string parameters": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test + body: + mappings: + properties: + number: + type: integer + + - do: + index: + index: test + id: 1 + body: { field: foo bar} + + - do: + indices.refresh: + index: [test] + + - do: + explain: + index: test + id: 1 + q: bar + df: field + + - is_true: matched + + - do: + explain: + index: test + id: 1 + q: field:foo field:xyz + + - is_true: matched + + - do: + explain: + index: test + id: 1 + q: field:foo field:xyz + default_operator: AND + + - is_false: matched + + - do: + explain: + index: test + id: 1 + q: field:BA* + + - is_true: matched + + - do: + explain: + index: test + id: 1 + q: number:foo + lenient: true + + - is_false: matched diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/31_query_string_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/31_query_string_with_types.yml new file mode 100644 index 0000000000000..b6930688acf2d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/31_query_string_with_types.yml @@ -0,0 +1,71 @@ +--- +"explain with query_string parameters": + - do: + indices.create: + include_type_name: true + index: test + body: + mappings: + test: + properties: + number: + type: integer + + - do: + index: + index: test + type: test + id: 1 + body: { field: foo bar} + + - do: + indices.refresh: + index: [test] + + - do: + explain: + index: test + type: test + id: 1 + q: bar + df: field + + - is_true: matched + + - do: + explain: + index: test + type: test + id: 1 + q: field:foo field:xyz + + - is_true: matched + + - do: + explain: + index: test + type: test + id: 1 + q: field:foo field:xyz + default_operator: AND + + - is_false: matched + + - do: + explain: + index: test + type: test + id: 1 + q: field:BA* + + - is_true: matched + + - do: + explain: + index: test + type: test + id: 1 + q: number:foo + lenient: true + + - is_false: matched diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/40_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/40_mix_typeless_typeful.yml new file mode 100644 index 0000000000000..36fdbaa6b6f78 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/40_mix_typeless_typeful.yml @@ -0,0 +1,57 @@ +--- +"Explain with typeless API on an index that has types": + + - skip: + version: " - 6.99.99" + reason: Typeless APIs were introduced in 7.0.0 + + - do: + indices.create: # not using include_type_name: false on purpose + include_type_name: true + index: index + body: + mappings: + not_doc: + properties: + foo: + type: "keyword" + + - do: + index: + index: index + type: not_doc + id: 1 + body: { foo: bar } + + - do: + indices.refresh: {} + + - do: + catch: missing + explain: + index: index + type: some_random_type + id: 1 + body: + query: + match_all: {} + + - match: { _index: "index" } + - match: { _type: "some_random_type" } + - match: { _id: "1"} + - match: { matched: false} + + - do: + explain: + index: index + type: _doc #todo: make _explain typeless and remove this + id: 1 + body: + query: + match_all: {} + + - match: { _index: "index" } + - match: { _type: "_doc" } + - match: { _id: "1"} + - is_true: matched + - match: { explanation.value: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/TODO.txt new file mode 100644 index 0000000000000..2362d9df8d4ad --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/TODO.txt @@ -0,0 +1,6 @@ +Tests missing for: + +- everything :) + + +# preference diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/10_basic.yml new file mode 100644 index 0000000000000..d125efa73011c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/10_basic.yml @@ -0,0 +1,325 @@ +--- +setup: + - do: + indices.create: + index: test1 + body: + mappings: + properties: + text: + type: text + keyword: + type: keyword + number: + type: double + geo: + type: geo_point + misc: + type: text + object: + type: object + properties: + nested1 : + type : text + index: false + nested2: + type: float + doc_values: false + level1: + type: nested + properties: + level2: + type: object + properties: + leaf1: + type: text + index: false + + - do: + indices.create: + index: test2 + body: + mappings: + properties: + text: + type: text + keyword: + type: keyword + number: + type: double + date: + type: date + geo: + type: geo_point + object: + type: object + properties: + nested1 : + type : text + index: true + nested2: + type: float + doc_values: true + level1: + type: nested + properties: + level2: + type: object + properties: + leaf1: + type: text + index: false + - do: + indices.create: + index: test3 + body: + mappings: + properties: + text: + type: text + keyword: + type: keyword + number: + type: long + date: + type: date + geo: + type: keyword + object: + type: nested + properties: + nested1 : + type : long + index: false + nested2: + type: keyword + doc_values: false + level1: + type: object + properties: + level2: + type: object + properties: + leaf1: + type: text + index: false + +--- +"Get simple field caps": + + - do: + field_caps: + index: 'test1,test2,test3' + fields: [text, keyword, number, date, geo] + + - match: {fields.text.text.searchable: true} + - match: {fields.text.text.aggregatable: false} + - is_false: fields.text.text.indices + - is_false: fields.text.text.non_searchable_indices + - is_false: fields.text.text.non_aggregatable_indices + - match: {fields.keyword.keyword.searchable: true} + - match: {fields.keyword.keyword.aggregatable: true} + - is_false: fields.text.keyword.indices + - is_false: fields.text.keyword.non_searchable_indices + - is_false: fields.text.keyword.non_aggregatable_indices + - match: {fields.number.double.searchable: true} + - match: {fields.number.double.aggregatable: true} + - match: {fields.number.double.indices: ["test1", "test2"]} + - is_false: fields.number.double.non_searchable_indices + - is_false: fields.number.double.non_aggregatable_indices + - match: {fields.number.long.searchable: true} + - match: {fields.number.long.aggregatable: true} + - match: {fields.number.long.indices: ["test3"]} + - is_false: fields.number.long.non_searchable_indices + - is_false: fields.number.long.non_aggregatable_indices + - match: {fields.date.date.searchable: true} + - match: {fields.date.date.aggregatable: true} + - is_false: fields.date.date.indices + - is_false: fields.date.date.non_searchable_indices + - is_false: fields.date.date.non_aggregatable_indices + - match: {fields.geo.geo_point.searchable: true} + - match: {fields.geo.geo_point.aggregatable: true} + - match: {fields.geo.geo_point.indices: ["test1", "test2"]} + - is_false: fields.geo.geo_point.non_searchable_indices + - is_false: fields.geo.geo_point.non_aggregatable_indices + - match: {fields.geo.keyword.searchable: true} + - match: {fields.geo.keyword.aggregatable: true} + - match: {fields.geo.keyword.indices: ["test3"]} + - is_false: fields.geo.keyword.non_searchable_indices + - is_false: fields.geo.keyword.on_aggregatable_indices +--- +"Get date_nanos field caps": + - skip: + version: " - 6.99.99" + reason: date_nanos field mapping type has been introcued in 7.0 + + - do: + indices.create: + include_type_name: false + index: test_nanos + body: + mappings: + properties: + date_nanos: + type: date_nanos + + - do: + field_caps: + index: 'test_nanos' + fields: [date_nanos] + + - match: {fields.date_nanos.date_nanos.searchable: true} + - match: {fields.date_nanos.date_nanos.aggregatable: true} + - is_false: fields.date_nanos.date_nanos.indices + - is_false: fields.date_nanos.date_nanos.non_searchable_indices + - is_false: fields.date_nanos.date_nanos.non_aggregatable_indices + +--- +"Get leaves field caps": + + - do: + field_caps: + index: 'test1,test2,test3' + fields: object* + + - match: {fields.object\.nested1.long.searchable: false} + - match: {fields.object\.nested1.long.aggregatable: true} + - match: {fields.object\.nested1.long.indices: ["test3"]} + - is_false: fields.object\.nested1.long.non_searchable_indices + - is_false: fields.object\.nested1.long.non_aggregatable_indices + - match: {fields.object\.nested1.text.searchable: false} + - match: {fields.object\.nested1.text.aggregatable: false} + - match: {fields.object\.nested1.text.indices: ["test1", "test2"]} + - match: {fields.object\.nested1.text.non_searchable_indices: ["test1"]} + - is_false: fields.object\.nested1.text.non_aggregatable_indices + - match: {fields.object\.nested2.float.searchable: true} + - match: {fields.object\.nested2.float.aggregatable: false} + - match: {fields.object\.nested2.float.indices: ["test1", "test2"]} + - match: {fields.object\.nested2.float.non_aggregatable_indices: ["test1"]} + - is_false: fields.object\.nested2.float.non_searchable_indices + - match: {fields.object\.nested2.keyword.searchable: true} + - match: {fields.object\.nested2.keyword.aggregatable: false} + - match: {fields.object\.nested2.keyword.indices: ["test3"]} + - is_false: fields.object\.nested2.keyword.non_aggregatable_indices + - is_false: fields.object\.nested2.keyword.non_searchable_indices +--- +"Get object and nested field caps": + - skip: + version: " - 6.99.99" + reason: object and nested fields are returned since 7.0 + + - do: + field_caps: + index: 'test1,test2,test3' + fields: object*,level1* + + - match: {fields.object.object.indices: ["test1", "test2"]} + - match: {fields.object.object.searchable: false} + - match: {fields.object.object.aggregatable: false} + - is_false: fields.object.object.non_aggregatable_indices + - is_false: fields.object.object.non_searchable_indices + - match: {fields.object.nested.indices: ["test3"]} + - match: {fields.object.nested.searchable: false} + - match: {fields.object.nested.aggregatable: false} + - is_false: fields.object.nested.non_aggregatable_indices + - is_false: fields.object.nested.non_searchable_indices + - match: {fields.level1.nested.indices: ["test1", "test2"]} + - match: {fields.level1.nested.searchable: false} + - match: {fields.level1.nested.aggregatable: false} + - is_false: fields.level1.nested.non_aggregatable_indices + - is_false: fields.level1.nested.non_searchable_indices + - match: {fields.level1.object.indices: ["test3"]} + - match: {fields.level1.object.searchable: false} + - match: {fields.level1.object.aggregatable: false} + - is_false: fields.level1.object.non_aggregatable_indices + - is_false: fields.level1.object.non_searchable_indices + - match: {fields.level1\.level2.object.searchable: false} + - match: {fields.level1\.level2.object.aggregatable: false} + - is_false: fields.level1\.level2.object.indices + - is_false: fields.level1\.level2.object.non_aggregatable_indices + - is_false: fields.level1\.level2.object.non_searchable_indices + - match: {fields.level1\.level2\.leaf1.text.searchable: false} + - match: {fields.level1\.level2\.leaf1.text.aggregatable: false} + - is_false: fields.level1\.level2\.leaf1.text.indices + - is_false: fields.level1\.level2\.leaf1.text.non_aggregatable_indices + - is_false: fields.level1\.level2\.leaf1.text..non_searchable_indices +--- +"Get prefix field caps": + + - do: + field_caps: + index: _all + fields: "n*" + - match: {fields.number.double.searchable: true} + - match: {fields.number.double.aggregatable: true} + - match: {fields.number.double.indices: ["test1", "test2"]} + - is_false: fields.number.double.non_searchable_indices + - is_false: fields.number.double.non_aggregatable_indices + - match: {fields.number.long.searchable: true} + - match: {fields.number.long.aggregatable: true} + - match: {fields.number.long.indices: ["test3"]} + - is_false: fields.number.long.non_searchable_indices + - is_false: fields.number.long.non_aggregatable_indices + +--- +"Mix in non-existing field field caps": + + - do: + field_caps: + index: 'test1,test2,test3' + fields: [text, keyword, no_such_field, number, geo] + + - match: {fields.text.text.searchable: true} + - match: {fields.text.text.aggregatable: false} + - is_false: fields.text.text.indices + - is_false: fields.text.text.non_searchable_indices + - is_false: fields.text.text.non_aggregatable_indices + - match: {fields.keyword.keyword.searchable: true} + - match: {fields.keyword.keyword.aggregatable: true} + - is_false: fields.text.keyword.indices + - is_false: fields.text.keyword.non_searchable_indices + - is_false: fields.text.keyword.non_aggregatable_indices + - match: {fields.number.double.searchable: true} + - match: {fields.number.double.aggregatable: true} + - match: {fields.number.double.indices: ["test1", "test2"]} + - is_false: fields.number.double.non_searchable_indices + - is_false: fields.number.double.non_aggregatable_indices + - match: {fields.number.long.searchable: true} + - match: {fields.number.long.aggregatable: true} + - match: {fields.number.long.indices: ["test3"]} + - is_false: fields.number.long.non_searchable_indices + - is_false: fields.number.long.non_aggregatable_indices + - match: {fields.geo.geo_point.searchable: true} + - match: {fields.geo.geo_point.aggregatable: true} + - match: {fields.geo.geo_point.indices: ["test1", "test2"]} + - is_false: fields.geo.geo_point.non_searchable_indices + - is_false: fields.geo.geo_point.non_aggregatable_indices + - match: {fields.geo.keyword.searchable: true} + - match: {fields.geo.keyword.aggregatable: true} + - match: {fields.geo.keyword.indices: ["test3"]} + - is_false: fields.geo.keyword.non_searchable_indices + - is_false: fields.geo.keyword.on_aggregatable_indices + +--- +"Field caps with include_unmapped": + - skip: + version: " - 7.1.99" + reason: include_unmapped has been added in 7.2.0 + + - do: + field_caps: + include_unmapped: true + index: 'test1,test2,test3' + fields: [text, misc] + + - match: {fields.text.text.searchable: true} + - match: {fields.text.text.aggregatable: false} + - is_false: fields.text.text.indices + - is_false: fields.text.text.non_searchable_indices + - is_false: fields.text.text.non_aggregatable_indices + - match: {fields.misc.text.searchable: true} + - match: {fields.misc.text.aggregatable: false} + - match: {fields.misc.text.indices: ["test1"]} + - match: {fields.misc.unmapped.searchable: false} + - match: {fields.misc.unmapped.aggregatable: false} + - match: {fields.misc.unmapped.indices: ["test2", "test3"]} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/20_meta.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/20_meta.yml new file mode 100644 index 0000000000000..f299e72d00d0e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/20_meta.yml @@ -0,0 +1,65 @@ +--- +"Merge metadata across multiple indices": + + - skip: + version: " - 7.5.99" + reason: Metadata support was added in 7.6 + + - do: + indices.create: + index: test1 + body: + mappings: + properties: + latency: + type: long + meta: + unit: ms + metric_type: gauge + + - do: + indices.create: + index: test2 + body: + mappings: + properties: + latency: + type: long + meta: + unit: ns + metric_type: gauge + + - do: + indices.create: + index: test3 + + - do: + field_caps: + index: test3 + fields: [latency] + + - is_false: fields.latency.long.meta.unit + + - do: + field_caps: + index: test1 + fields: [latency] + + - match: {fields.latency.long.meta.unit: ["ms"]} + - match: {fields.latency.long.meta.metric_type: ["gauge"]} + + - do: + field_caps: + index: test1,test3 + fields: [latency] + + - match: {fields.latency.long.meta.unit: ["ms"]} + - match: {fields.latency.long.meta.metric_type: ["gauge"]} + + - do: + field_caps: + index: test1,test2,test3 + fields: [latency] + + - match: {fields.latency.long.meta.unit: ["ms", "ns"]} + - match: {fields.latency.long.meta.metric_type: ["gauge"]} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/100_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/100_mix_typeless_typeful.yml new file mode 100644 index 0000000000000..d13229dbffbc6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/100_mix_typeless_typeful.yml @@ -0,0 +1,47 @@ +--- +"GET with typeless API on an index that has types": + + - skip: + version: " - 6.99.99" + reason: Typeless APIs were introduced in 7.0.0 + + - do: + indices.create: # not using include_type_name: false on purpose + include_type_name: true + index: index + body: + mappings: + not_doc: + properties: + foo: + type: "keyword" + + - do: + index: + index: index + type: not_doc + id: 1 + body: { foo: bar } + + - do: + catch: missing + get: + index: index + type: some_random_type + id: 1 + + - match: { _index: "index" } + - match: { _type: "some_random_type" } + - match: { _id: "1"} + - match: { found: false} + + - do: + get: + index: index + id: 1 + + - match: { _index: "index" } + - match: { _type: "_doc" } + - match: { _id: "1"} + - match: { _version: 1} + - match: { _source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/10_basic.yml new file mode 100644 index 0000000000000..9183c70c29bce --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/10_basic.yml @@ -0,0 +1,22 @@ +--- +"Basic": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 中文 + body: { "foo": "Hello: 中文" } + + - do: + get: + index: test_1 + id: 中文 + + - match: { _index: test_1 } + - match: { _type: _doc } + - match: { _id: 中文 } + - match: { _source: { foo: "Hello: 中文" } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/11_basic_with_types.yml new file mode 100644 index 0000000000000..0689f714d6416 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/11_basic_with_types.yml @@ -0,0 +1,31 @@ +--- +"Basic": + + - do: + index: + index: test_1 + type: test + id: 中文 + body: { "foo": "Hello: 中文" } + + - do: + get: + index: test_1 + type: test + id: 中文 + + - match: { _index: test_1 } + - match: { _type: test } + - match: { _id: 中文 } + - match: { _source: { foo: "Hello: 中文" } } + + - do: + get: + index: test_1 + type: _all + id: 中文 + + - match: { _index: test_1 } + - match: { _type: test } + - match: { _id: 中文 } + - match: { _source: { foo: "Hello: 中文" } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/15_default_values.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/15_default_values.yml new file mode 100644 index 0000000000000..67065270665cf --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/15_default_values.yml @@ -0,0 +1,22 @@ +--- +"Default values": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + index: + index: test_1 + id: 1 + body: { "foo": "bar" } + + - do: + get: + index: test_1 + id: 1 + + - match: { _index: test_1 } + - match: { _type: _doc } + - match: { _id: '1' } + - match: { _source: { foo: "bar" } } + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/16_default_values_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/16_default_values_with_types.yml new file mode 100644 index 0000000000000..5e08112253ef0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/16_default_values_with_types.yml @@ -0,0 +1,21 @@ +--- +"Default values": + + - do: + index: + index: test_1 + type: test + id: 1 + body: { "foo": "bar" } + + - do: + get: + index: test_1 + type: _all + id: 1 + + - match: { _index: test_1 } + - match: { _type: test } + - match: { _id: '1' } + - match: { _source: { foo: "bar" } } + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/20_stored_fields.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/20_stored_fields.yml new file mode 100644 index 0000000000000..ab27842e4516e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/20_stored_fields.yml @@ -0,0 +1,57 @@ +--- +"Stored fields": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + indices.create: + index: test_1 + body: + mappings: + properties: + foo: + type: keyword + store: true + count: + type: integer + store: true + + - do: + index: + index: test_1 + id: 1 + body: { "foo": "bar", "count": 1 } + - do: + get: + index: test_1 + id: 1 + stored_fields: foo + + - match: { _index: test_1 } + - match: { _type: _doc } + - match: { _id: '1' } + - match: { fields.foo: [bar] } + - is_false: _source + + - do: + get: + index: test_1 + id: 1 + stored_fields: [foo, count] + + - match: { fields.foo: [bar] } + - match: { fields.count: [1] } + - is_false: _source + + - do: + get: + index: test_1 + id: 1 + stored_fields: [foo, count, _source] + + - match: { fields.foo: [bar] } + - match: { fields.count: [1] } + - match: { _source.foo: bar } + + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/21_stored_fields_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/21_stored_fields_with_types.yml new file mode 100644 index 0000000000000..d1862fc0340d8 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/21_stored_fields_with_types.yml @@ -0,0 +1,60 @@ +--- +"Stored fields": + + - do: + indices.create: + include_type_name: true + index: test_1 + body: + mappings: + test: + properties: + foo: + type: keyword + store: true + count: + type: integer + store: true + + - do: + index: + index: test_1 + type: test + id: 1 + body: { "foo": "bar", "count": 1 } + - do: + get: + index: test_1 + type: test + id: 1 + stored_fields: foo + + - match: { _index: test_1 } + - match: { _type: test } + - match: { _id: '1' } + - match: { fields.foo: [bar] } + - is_false: _source + + - do: + get: + index: test_1 + type: test + id: 1 + stored_fields: [foo, count] + + - match: { fields.foo: [bar] } + - match: { fields.count: [1] } + - is_false: _source + + - do: + get: + index: test_1 + type: test + id: 1 + stored_fields: [foo, count, _source] + + - match: { fields.foo: [bar] } + - match: { fields.count: [1] } + - match: { _source.foo: bar } + + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/40_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/40_routing.yml new file mode 100644 index 0000000000000..9ba546d6ef942 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/40_routing.yml @@ -0,0 +1,44 @@ +--- +"Routing": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + id: 1 + routing: 5 + body: { foo: bar } + + - do: + get: + index: test_1 + id: 1 + routing: 5 + stored_fields: [_routing] + + - match: { _id: "1"} + - match: { _routing: "5"} + + - do: + catch: missing + get: + index: test_1 + id: 1 + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/41_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/41_routing_with_types.yml new file mode 100644 index 0000000000000..276346cda4f98 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/41_routing_with_types.yml @@ -0,0 +1,43 @@ +--- +"Routing": + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + type: test + id: 1 + routing: 5 + body: { foo: bar } + + - do: + get: + index: test_1 + type: test + id: 1 + routing: 5 + stored_fields: [_routing] + + - match: { _id: "1"} + - match: { _routing: "5"} + + - do: + catch: missing + get: + index: test_1 + type: test + id: 1 + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/50_with_headers.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/50_with_headers.yml new file mode 100644 index 0000000000000..38130cee59810 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/50_with_headers.yml @@ -0,0 +1,25 @@ +--- +"REST test with headers": + - skip: + features: ["headers", "yaml"] + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + index: + index: test_1 + id: 1 + body: { "body": "foo" } + + - do: + headers: + Accept: application/yaml + get: + index: test_1 + id: 1 + + - match: {_index: "test_1"} + - match: { _type: _doc } + - match: {_id: "1"} + - match: {_version: 1} + - match: {found: true} + - match: { _source: { body: foo }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/51_with_headers_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/51_with_headers_with_types.yml new file mode 100644 index 0000000000000..b88dbaafc4fb2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/51_with_headers_with_types.yml @@ -0,0 +1,26 @@ +--- +"REST test with headers": + - skip: + features: ["headers", "yaml"] + + - do: + index: + index: test_1 + type: test + id: 1 + body: { "body": "foo" } + + - do: + headers: + Accept: application/yaml + get: + index: test_1 + type: _all + id: 1 + + - match: {_index: "test_1"} + - match: {_type: "test"} + - match: {_id: "1"} + - match: {_version: 1} + - match: {found: true} + - match: { _source: { body: foo }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/60_realtime_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/60_realtime_refresh.yml new file mode 100644 index 0000000000000..ef4fa60bf1b0e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/60_realtime_refresh.yml @@ -0,0 +1,49 @@ +--- +"Realtime Refresh": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + settings: + index: + refresh_interval: -1 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + catch: missing + get: + index: test_1 + id: 1 + realtime: false + + - do: + get: + index: test_1 + id: 1 + realtime: true + + - is_true: found + + - do: + get: + index: test_1 + id: 1 + realtime: false + refresh: true + + - is_true: found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/61_realtime_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/61_realtime_refresh_with_types.yml new file mode 100644 index 0000000000000..7d02b4667efe7 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/61_realtime_refresh_with_types.yml @@ -0,0 +1,49 @@ +--- +"Realtime Refresh": + + - do: + indices.create: + index: test_1 + body: + settings: + index: + refresh_interval: -1 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + catch: missing + get: + index: test_1 + type: test + id: 1 + realtime: false + + - do: + get: + index: test_1 + type: test + id: 1 + realtime: true + + - is_true: found + + - do: + get: + index: test_1 + type: test + id: 1 + realtime: false + refresh: true + + - is_true: found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/70_source_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/70_source_filtering.yml new file mode 100644 index 0000000000000..f4a5ba39be3b8 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/70_source_filtering.yml @@ -0,0 +1,68 @@ +--- +"Source filtering": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + indices.create: + index: test_1 + body: + mappings: + properties: + count: + type: integer + store: true + + - do: + index: + index: test_1 + id: 1 + body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } + - do: + get: { index: test_1, id: 1, _source: false } + + - match: { _index: test_1 } + - match: { _type: _doc } + - match: { _id: "1" } + - is_false: _source + + - do: + get: { index: test_1, id: 1, _source: true } + - match: { _source.include.field1: v1 } + + - do: + get: { index: test_1, id: 1, _source: include.field1 } + - match: { _source.include.field1: v1 } + - is_false: _source.include.field2 + + - do: + get: { index: test_1, id: 1, _source_includes: include.field1 } + - match: { _source.include.field1: v1 } + - is_false: _source.include.field2 + + - do: + get: { index: test_1, id: 1, _source_includes: "include.field1,include.field2" } + - match: { _source.include.field1: v1 } + - match: { _source.include.field2: v2 } + - is_false: _source.count + + - do: + get: { index: test_1, id: 1, _source_includes: include, _source_excludes: "*.field2" } + - match: { _source.include.field1: v1 } + - is_false: _source.include.field2 + - is_false: _source.count + + + - do: + get: + index: test_1 + id: 1 + stored_fields: count + _source: true + + - match: { _index: test_1 } + - match: { _type: _doc } + - match: { _id: "1" } + - match: { fields.count: [1] } + - match: { _source.include.field1: v1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/71_source_filtering_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/71_source_filtering_with_types.yml new file mode 100644 index 0000000000000..3ac493c629f20 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/71_source_filtering_with_types.yml @@ -0,0 +1,69 @@ +--- +"Source filtering": + + - do: + indices.create: + include_type_name: true + index: test_1 + body: + mappings: + test: + properties: + count: + type: integer + store: true + + - do: + index: + index: test_1 + type: test + id: 1 + body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } + - do: + get: { index: test_1, type: test, id: 1, _source: false } + + - match: { _index: test_1 } + - match: { _type: test } + - match: { _id: "1" } + - is_false: _source + + - do: + get: { index: test_1, type: test, id: 1, _source: true } + - match: { _source.include.field1: v1 } + + - do: + get: { index: test_1, type: test, id: 1, _source: include.field1 } + - match: { _source.include.field1: v1 } + - is_false: _source.include.field2 + + - do: + get: { index: test_1, type: test, id: 1, _source_includes: include.field1 } + - match: { _source.include.field1: v1 } + - is_false: _source.include.field2 + + - do: + get: { index: test_1, type: test, id: 1, _source_includes: "include.field1,include.field2" } + - match: { _source.include.field1: v1 } + - match: { _source.include.field2: v2 } + - is_false: _source.count + + - do: + get: { index: test_1, type: test, id: 1, _source_includes: include, _source_excludes: "*.field2" } + - match: { _source.include.field1: v1 } + - is_false: _source.include.field2 + - is_false: _source.count + + + - do: + get: + index: test_1 + type: test + id: 1 + stored_fields: count + _source: true + + - match: { _index: test_1 } + - match: { _type: test } + - match: { _id: "1" } + - match: { fields.count: [1] } + - match: { _source.include.field1: v1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/80_missing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/80_missing.yml new file mode 100644 index 0000000000000..d7d8edfc65dcb --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/80_missing.yml @@ -0,0 +1,23 @@ +--- +"Missing document with catch": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + catch: missing + get: + index: test_1 + id: 1 + +--- +"Missing document with ignore": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + get: + index: test_1 + id: 1 + ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/81_missing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/81_missing_with_types.yml new file mode 100644 index 0000000000000..a60d11388566d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/81_missing_with_types.yml @@ -0,0 +1,19 @@ +--- +"Missing document with catch": + + - do: + catch: missing + get: + index: test_1 + type: test + id: 1 + +--- +"Missing document with ignore": + + - do: + get: + index: test_1 + type: test + id: 1 + ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/90_versions.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/90_versions.yml new file mode 100644 index 0000000000000..9037a9113e937 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/90_versions.yml @@ -0,0 +1,83 @@ +--- +"Versions": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + - match: { _version: 1} + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + - match: { _version: 2} + + - do: + get: + index: test_1 + id: 1 + version: 2 + - match: { _id: "1" } + + - do: + catch: conflict + get: + index: test_1 + id: 1 + version: 1 + + - do: + get: + index: test_1 + id: 1 + version: 2 + version_type: external + - match: { _id: "1" } + + - do: + catch: conflict + get: + index: test_1 + id: 1 + version: 10 + version_type: external + + - do: + catch: conflict + get: + index: test_1 + id: 1 + version: 1 + version_type: external + + - do: + get: + index: test_1 + id: 1 + version: 2 + version_type: external_gte + - match: { _id: "1" } + + - do: + catch: conflict + get: + index: test_1 + id: 1 + version: 10 + version_type: external_gte + + - do: + catch: conflict + get: + index: test_1 + id: 1 + version: 1 + version_type: external_gte + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/91_versions_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/91_versions_with_types.yml new file mode 100644 index 0000000000000..c6631b83b1867 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/91_versions_with_types.yml @@ -0,0 +1,89 @@ +--- +"Versions": + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + - match: { _version: 1} + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + - match: { _version: 2} + + - do: + get: + index: test_1 + type: test + id: 1 + version: 2 + - match: { _id: "1" } + + - do: + catch: conflict + get: + index: test_1 + type: test + id: 1 + version: 1 + + - do: + get: + index: test_1 + type: test + id: 1 + version: 2 + version_type: external + - match: { _id: "1" } + + - do: + catch: conflict + get: + index: test_1 + type: test + id: 1 + version: 10 + version_type: external + + - do: + catch: conflict + get: + index: test_1 + type: test + id: 1 + version: 1 + version_type: external + + - do: + get: + index: test_1 + type: test + id: 1 + version: 2 + version_type: external_gte + - match: { _id: "1" } + + - do: + catch: conflict + get: + index: test_1 + type: test + id: 1 + version: 10 + version_type: external_gte + + - do: + catch: conflict + get: + index: test_1 + type: test + id: 1 + version: 1 + version_type: external_gte + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/get/TODO.txt new file mode 100644 index 0000000000000..340ff579b41e0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get/TODO.txt @@ -0,0 +1,3 @@ +Tests missing for: + +# preference diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/10_basic.yml new file mode 100644 index 0000000000000..6f81c430c883a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/10_basic.yml @@ -0,0 +1,26 @@ +--- +"Basic": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { "foo": "bar" } + + - do: + get_source: + index: test_1 + id: 1 + + - match: { '': { foo: bar } } + + - do: + get_source: + index: test_1 + id: 1 + + - match: { '': { foo: bar } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/11_basic_with_types.yml new file mode 100644 index 0000000000000..1446f569e86d8 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/11_basic_with_types.yml @@ -0,0 +1,17 @@ +--- +"Basic with types": + + - do: + index: + index: test_1 + type: test + id: 1 + body: { "foo": "bar" } + + - do: + get_source: + index: test_1 + type: test + id: 1 + + - match: { '': { foo: bar } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/15_default_values.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/15_default_values.yml new file mode 100644 index 0000000000000..57c11a1ca10e2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/15_default_values.yml @@ -0,0 +1,20 @@ +--- +"Default values": + + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { "foo": "bar" } + + - do: + get_source: + index: test_1 + id: 1 + + - match: { '': { foo: bar } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/16_default_values_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/16_default_values_with_types.yml new file mode 100644 index 0000000000000..e2de7a9f0007c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/16_default_values_with_types.yml @@ -0,0 +1,16 @@ +--- +"Default values": + - do: + index: + index: test_1 + type: test + id: 1 + body: { "foo": "bar" } + + - do: + get_source: + index: test_1 + type: test + id: 1 + + - match: { '': { foo: bar } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/40_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/40_routing.yml new file mode 100644 index 0000000000000..6425f70f26aad --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/40_routing.yml @@ -0,0 +1,42 @@ +--- +"Routing": + + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + id: 1 + routing: 5 + body: { foo: bar } + + - do: + get_source: + index: test_1 + id: 1 + routing: 5 + + - match: { '': {foo: bar}} + + - do: + catch: missing + get_source: + index: test_1 + id: 1 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/41_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/41_routing_with_types.yml new file mode 100644 index 0000000000000..db53a33ba597e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/41_routing_with_types.yml @@ -0,0 +1,42 @@ +--- +"Routing": + + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + type: test + id: 1 + routing: 5 + body: { foo: bar } + + - do: + get_source: + index: test_1 + type: test + id: 1 + routing: 5 + + - match: { '': {foo: bar}} + + - do: + catch: missing + get_source: + index: test_1 + type: test + id: 1 + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/60_realtime_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/60_realtime_refresh.yml new file mode 100644 index 0000000000000..d39b07a6ce5f7 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/60_realtime_refresh.yml @@ -0,0 +1,48 @@ +--- +"Realtime": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + settings: + refresh_interval: -1 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + catch: missing + get_source: + index: test_1 + id: 1 + realtime: false + + - do: + get_source: + index: test_1 + id: 1 + realtime: true + + - match: { '': {foo: bar}} + + - do: + get_source: + index: test_1 + id: 1 + realtime: false + refresh: true + + - match: { '': {foo: bar}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/61_realtime_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/61_realtime_refresh_with_types.yml new file mode 100644 index 0000000000000..f5b406de28b4a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/61_realtime_refresh_with_types.yml @@ -0,0 +1,49 @@ +--- +"Realtime": + + - do: + indices.create: + index: test_1 + body: + settings: + refresh_interval: -1 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + catch: missing + get_source: + index: test_1 + type: test + id: 1 + realtime: false + + - do: + get_source: + index: test_1 + type: test + id: 1 + realtime: true + + - match: { '': {foo: bar}} + + - do: + get_source: + index: test_1 + type: test + id: 1 + realtime: false + refresh: true + + - match: { '': {foo: bar}} + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/70_source_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/70_source_filtering.yml new file mode 100644 index 0000000000000..2665458cea95d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/70_source_filtering.yml @@ -0,0 +1,30 @@ +--- +"Source filtering": + + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } + + - do: + get_source: { index: test_1, id: 1, _source_includes: include.field1 } + - match: { include.field1: v1 } + - is_false: include.field2 + + - do: + get_source: { index: test_1, id: 1, _source_includes: "include.field1,include.field2" } + - match: { include.field1: v1 } + - match: { include.field2: v2 } + - is_false: count + + - do: + get_source: { index: test_1, id: 1, _source_includes: include, _source_excludes: "*.field2" } + - match: { include.field1: v1 } + - is_false: include.field2 + - is_false: count diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/71_source_filtering_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/71_source_filtering_with_types.yml new file mode 100644 index 0000000000000..b4f20fee53be2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/71_source_filtering_with_types.yml @@ -0,0 +1,27 @@ +--- +"Source filtering": + + + - do: + index: + index: test_1 + type: test + id: 1 + body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } + + - do: + get_source: { index: test_1, type: test, id: 1, _source_includes: include.field1 } + - match: { include.field1: v1 } + - is_false: include.field2 + + - do: + get_source: { index: test_1, type: test, id: 1, _source_includes: "include.field1,include.field2" } + - match: { include.field1: v1 } + - match: { include.field2: v2 } + - is_false: count + + - do: + get_source: { index: test_1, type: test, id: 1, _source_includes: include, _source_excludes: "*.field2" } + - match: { include.field1: v1 } + - is_false: include.field2 + - is_false: count diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/80_missing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/80_missing.yml new file mode 100644 index 0000000000000..b704fc2612007 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/80_missing.yml @@ -0,0 +1,27 @@ +--- +"Missing document with catch": + + - skip: + features: warnings + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + catch: missing + get_source: + index: test_1 + id: 1 + +--- +"Missing document with ignore": + + - skip: + features: warnings + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + get_source: + index: test_1 + id: 1 + ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/81_missing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/81_missing_with_types.yml new file mode 100644 index 0000000000000..16eb5ea51e898 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/81_missing_with_types.yml @@ -0,0 +1,19 @@ +--- +"Missing document with catch": + + - do: + catch: missing + get_source: + index: test_1 + type: test + id: 1 + +--- +"Missing document with ignore": + + - do: + get_source: + index: test_1 + type: test + id: 1 + ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/85_source_missing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/85_source_missing.yml new file mode 100644 index 0000000000000..c214bf87d3997 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/85_source_missing.yml @@ -0,0 +1,38 @@ +--- +setup: + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + mappings: + _source: { enabled: false } + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + +--- +"Missing document source with catch": + + - do: + catch: missing + get_source: + index: test_1 + id: 1 + +--- +"Missing document source with ignore": + + - do: + get_source: + index: test_1 + id: 1 + ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/86_source_missing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/86_source_missing_with_types.yml new file mode 100644 index 0000000000000..d7cfced5164ec --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/86_source_missing_with_types.yml @@ -0,0 +1,39 @@ +--- +setup: + + - do: + indices.create: + include_type_name: true + index: test_1 + body: + mappings: + test: + _source: { enabled: false } + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + +--- +"Missing document source with catch": + + - do: + catch: missing + get_source: + index: test_1 + type: test + id: 1 + +--- +"Missing document source with ignore": + + - do: + get_source: + index: test_1 + type: test + id: 1 + ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/TODO.txt new file mode 100644 index 0000000000000..340ff579b41e0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/TODO.txt @@ -0,0 +1,3 @@ +Tests missing for: + +# preference diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/10_with_id.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/10_with_id.yml new file mode 100644 index 0000000000000..a129dcab80d9a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/10_with_id.yml @@ -0,0 +1,35 @@ +--- +"Index with ID": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test-weird-index-中文 + id: 1 + body: { foo: bar } + + - match: { _index: test-weird-index-中文 } + - match: { _type: _doc } + - match: { _id: "1"} + - match: { _version: 1} + + - do: + get: + index: test-weird-index-中文 + id: 1 + + - match: { _index: test-weird-index-中文 } + - match: { _type: _doc } + - match: { _id: "1"} + - match: { _version: 1} + - match: { _source: { foo: bar }} + + - do: + catch: bad_request + index: + index: idx + id: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + body: { foo: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/11_with_id_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/11_with_id_with_types.yml new file mode 100644 index 0000000000000..daac81849fb5e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/11_with_id_with_types.yml @@ -0,0 +1,34 @@ +--- +"Index with ID": + + - do: + index: + index: test-weird-index-中文 + type: weird.type + id: 1 + body: { foo: bar } + + - match: { _index: test-weird-index-中文 } + - match: { _type: weird.type } + - match: { _id: "1"} + - match: { _version: 1} + + - do: + get: + index: test-weird-index-中文 + type: weird.type + id: 1 + + - match: { _index: test-weird-index-中文 } + - match: { _type: weird.type } + - match: { _id: "1"} + - match: { _version: 1} + - match: { _source: { foo: bar }} + + - do: + catch: bad_request + index: + index: idx + type: type + id: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + body: { foo: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/12_result.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/12_result.yml new file mode 100644 index 0000000000000..f8a50415a95ef --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/12_result.yml @@ -0,0 +1,22 @@ +--- +"Index result field": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + index: + index: test_index + id: 1 + body: { foo: bar } + + - match: { result: created } + + - do: + index: + index: test_index + id: 1 + body: { foo: bar } + op_type: index + + - match: { result: updated } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/13_result_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/13_result_with_types.yml new file mode 100644 index 0000000000000..45ebe0bbd3dc1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/13_result_with_types.yml @@ -0,0 +1,21 @@ +--- +"Index result field": + + - do: + index: + index: test_index + type: test + id: 1 + body: { foo: bar } + + - match: { result: created } + + - do: + index: + index: test_index + type: test + id: 1 + body: { foo: bar } + op_type: index + + - match: { result: updated } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/15_without_id.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/15_without_id.yml new file mode 100644 index 0000000000000..073a4704b4ef8 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/15_without_id.yml @@ -0,0 +1,28 @@ +--- +"Index without ID": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + body: { foo: bar } + + - is_true: _id + - match: { _index: test_1 } + - match: { _type: _doc } + - match: { _version: 1 } + - set: { _id: id } + + - do: + get: + index: test_1 + id: '$id' + + - match: { _index: test_1 } + - match: { _type: _doc } + - match: { _id: $id } + - match: { _version: 1 } + - match: { _source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/16_without_id_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/16_without_id_with_types.yml new file mode 100644 index 0000000000000..3fff0512b9602 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/16_without_id_with_types.yml @@ -0,0 +1,26 @@ +--- +"Index without ID": + + - do: + index: + index: test_1 + type: test + body: { foo: bar } + + - is_true: _id + - match: { _index: test_1 } + - match: { _type: test } + - match: { _version: 1 } + - set: { _id: id } + + - do: + get: + index: test_1 + type: test + id: '$id' + + - match: { _index: test_1 } + - match: { _type: test } + - match: { _id: $id } + - match: { _version: 1 } + - match: { _source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/20_optype.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/20_optype.yml new file mode 100644 index 0000000000000..c33a86093acab --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/20_optype.yml @@ -0,0 +1,30 @@ +--- +"Optype": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + op_type: create + body: { foo: bar } + + - do: + catch: conflict + index: + index: test_1 + id: 1 + op_type: create + body: { foo: bar } + + - do: + index: + index: test_1 + id: 1 + op_type: index + body: { foo: bar } + + - match: { _version: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/21_optype_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/21_optype_with_types.yml new file mode 100644 index 0000000000000..60ae26d46d07d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/21_optype_with_types.yml @@ -0,0 +1,29 @@ +--- +"Optype": + + - do: + index: + index: test_1 + type: test + id: 1 + op_type: create + body: { foo: bar } + + - do: + catch: conflict + index: + index: test_1 + type: test + id: 1 + op_type: create + body: { foo: bar } + + - do: + index: + index: test_1 + type: test + id: 1 + op_type: index + body: { foo: bar } + + - match: { _version: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/30_cas.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/30_cas.yml new file mode 100644 index 0000000000000..550582e9816eb --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/30_cas.yml @@ -0,0 +1,50 @@ +--- +"Compare And Swap Sequence Numbers": + + - skip: + version: " - 6.99.99" + reason: typesless api was introduces in 7.0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + - match: { _version: 1} + - set: { _seq_no: seqno } + - set: { _primary_term: primary_term } + + - do: + get: + index: test_1 + id: 1 + - match: { _seq_no: $seqno } + - match: { _primary_term: $primary_term } + + - do: + catch: conflict + index: + index: test_1 + id: 1 + if_seq_no: 10000 + if_primary_term: $primary_term + body: { foo: bar2 } + + - do: + catch: conflict + index: + index: test_1 + id: 1 + if_seq_no: $seqno + if_primary_term: 1000 + body: { foo: bar2 } + + - do: + index: + index: test_1 + id: 1 + if_seq_no: $seqno + if_primary_term: $primary_term + body: { foo: bar2 } + + - match: { _version: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/35_external_version.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/35_external_version.yml new file mode 100644 index 0000000000000..89aaa190af384 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/35_external_version.yml @@ -0,0 +1,54 @@ +--- +"External version": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + version_type: external + version: 0 + + - match: { _version: 0 } + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + version_type: external + version: 5 + + - match: { _version: 5 } + + - do: + catch: conflict + index: + index: test_1 + id: 1 + body: { foo: bar } + version_type: external + version: 5 + + - do: + catch: conflict + index: + index: test_1 + id: 1 + body: { foo: bar } + version_type: external + version: 0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + version_type: external + version: 6 + + - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/36_external_gte_version.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/36_external_gte_version.yml new file mode 100644 index 0000000000000..82421227adb7f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/36_external_gte_version.yml @@ -0,0 +1,55 @@ +--- +"External GTE version": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + version_type: external_gte + version: 0 + + - match: { _version: 0} + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + version_type: external_gte + version: 5 + + - match: { _version: 5} + + - do: + catch: conflict + index: + index: test_1 + id: 1 + body: { foo: bar } + version_type: external_gte + version: 0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar2 } + version_type: external_gte + version: 5 + + - match: { _version: 5} + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar2 } + version_type: external_gte + version: 6 + + - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/37_external_version_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/37_external_version_with_types.yml new file mode 100644 index 0000000000000..f17e6b749319d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/37_external_version_with_types.yml @@ -0,0 +1,55 @@ +--- +"External version": + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + version_type: external + version: 0 + + - match: { _version: 0 } + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + version_type: external + version: 5 + + - match: { _version: 5 } + + - do: + catch: conflict + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + version_type: external + version: 5 + + - do: + catch: conflict + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + version_type: external + version: 0 + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + version_type: external + version: 6 + + - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/38_external_gte_version_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/38_external_gte_version_with_types.yml new file mode 100644 index 0000000000000..dccbe02ea1400 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/38_external_gte_version_with_types.yml @@ -0,0 +1,56 @@ +--- +"External GTE version": + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + version_type: external_gte + version: 0 + + - match: { _version: 0} + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + version_type: external_gte + version: 5 + + - match: { _version: 5} + + - do: + catch: conflict + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + version_type: external_gte + version: 0 + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar2 } + version_type: external_gte + version: 5 + + - match: { _version: 5} + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar2 } + version_type: external_gte + version: 6 + + - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/40_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/40_routing.yml new file mode 100644 index 0000000000000..630cf39dbe65c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/40_routing.yml @@ -0,0 +1,43 @@ +--- +"Routing": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + id: 1 + routing: 5 + body: { foo: bar } + + - do: + get: + index: test_1 + id: 1 + routing: 5 + stored_fields: [_routing] + + - match: { _id: "1"} + - match: { _routing: "5"} + + - do: + catch: missing + get: + index: test_1 + id: 1 + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/41_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/41_routing_with_types.yml new file mode 100644 index 0000000000000..5b0cf94f4236b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/41_routing_with_types.yml @@ -0,0 +1,43 @@ +--- +"Routing": + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + type: test + id: 1 + routing: 5 + body: { foo: bar } + + - do: + get: + index: test_1 + type: test + id: 1 + routing: 5 + stored_fields: [_routing] + + - match: { _id: "1"} + - match: { _routing: "5"} + + - do: + catch: missing + get: + index: test_1 + type: test + id: 1 + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/60_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/60_refresh.yml new file mode 100644 index 0000000000000..e16602d7ac8b6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/60_refresh.yml @@ -0,0 +1,93 @@ +--- +"Refresh": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + settings: + index.refresh_interval: -1 + number_of_replicas: 0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 1 }} + + - match: { hits.total: 0 } + + - do: + index: + index: test_1 + id: 2 + refresh: true + body: { foo: bar } + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 2 }} + + - match: { hits.total: 1 } + +--- +"When refresh url parameter is an empty string that means \"refresh immediately\"": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + refresh: "" + body: { foo: bar } + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 1 }} + + - match: { hits.total: 1 } + +--- +"refresh=wait_for waits until changes are visible in search": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: index_60_refresh_1 + id: index_60_refresh_id1 + body: { foo: bar } + refresh: wait_for + - is_false: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: index_60_refresh_1 + body: + query: { term: { _id: index_60_refresh_id1 }} + - match: { hits.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/61_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/61_refresh_with_types.yml new file mode 100644 index 0000000000000..be44cafd43020 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/61_refresh_with_types.yml @@ -0,0 +1,83 @@ +--- +"Refresh": + + - do: + indices.create: + index: test_1 + body: + settings: + index.refresh_interval: -1 + number_of_replicas: 0 + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 1 }} + + - match: { hits.total: 0 } + + - do: + index: + index: test_1 + type: test + id: 2 + refresh: true + body: { foo: bar } + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 2 }} + + - match: { hits.total: 1 } + +--- +"When refresh url parameter is an empty string that means \"refresh immediately\"": + - do: + index: + index: test_1 + type: test + id: 1 + refresh: "" + body: { foo: bar } + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 1 }} + + - match: { hits.total: 1 } + +--- +"refresh=wait_for waits until changes are visible in search": + - do: + index: + index: index_60_refresh_1 + type: test + id: index_60_refresh_id1 + body: { foo: bar } + refresh: wait_for + - is_false: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: index_60_refresh_1 + body: + query: { term: { _id: index_60_refresh_id1 }} + - match: { hits.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/70_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/70_mix_typeless_typeful.yml new file mode 100644 index 0000000000000..f3629fbb7cc18 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/70_mix_typeless_typeful.yml @@ -0,0 +1,102 @@ +--- +"Index with typeless API on an index that has types": + + - skip: + version: " - 6.99.99" + reason: Typeless APIs were introduced in 7.0.0 + + - do: + indices.create: # not using include_type_name: false on purpose + include_type_name: true + index: index + body: + mappings: + not_doc: + properties: + foo: + type: "keyword" + + - do: + index: + index: index + id: 1 + body: { foo: bar } + + - match: { _index: "index" } + - match: { _type: "_doc" } + - match: { _id: "1"} + - match: { _version: 1} + + - do: + get: # not using typeless API on purpose + index: index + type: not_doc + id: 1 + + - match: { _index: "index" } + - match: { _type: "not_doc" } # the important bit to check + - match: { _id: "1"} + - match: { _version: 1} + - match: { _source: { foo: bar }} + + + - do: + index: + index: index + body: { foo: bar } + + - match: { _index: "index" } + - match: { _type: "_doc" } + - match: { _version: 1} + - set: { _id: id } + + - do: + get: # using typeful API on purpose + index: index + type: not_doc + id: '$id' + + - match: { _index: "index" } + - match: { _type: "not_doc" } # the important bit to check + - match: { _id: $id} + - match: { _version: 1} + - match: { _source: { foo: bar }} + +--- +"Index call that introduces new field mappings": + + - skip: + version: " - 6.99.99" + reason: Typeless APIs were introduced in 7.0.0 + + - do: + indices.create: # not using include_type_name: false on purpose + include_type_name: true + index: index + body: + mappings: + not_doc: + properties: + foo: + type: "keyword" + - do: + index: + index: index + id: 2 + body: { new_field: value } + + - match: { _index: "index" } + - match: { _type: "_doc" } + - match: { _id: "2" } + - match: { _version: 1 } + + - do: + get: # using typeful API on purpose + index: index + type: not_doc + id: 2 + + - match: { _index: "index" } + - match: { _type: "not_doc" } + - match: { _id: "2" } + - match: { _version: 1} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/index/TODO.txt new file mode 100644 index 0000000000000..389a47c7b7a2c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/index/TODO.txt @@ -0,0 +1,3 @@ +Tests missing for: + +# consistency diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/10_analyze.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/10_analyze.yml new file mode 100644 index 0000000000000..a852e6d3beef1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/10_analyze.yml @@ -0,0 +1,75 @@ +"Basic test": + - do: + indices.analyze: + body: + text: Foo Bar + - length: { tokens: 2 } + - match: { tokens.0.token: foo } + - match: { tokens.1.token: bar } + +--- +"Index and field": + - do: + indices.create: + index: test + body: + mappings: + properties: + text: + type: text + analyzer: standard + + - do: + indices.analyze: + index: test + body: + field: text + text: Foo Bar! + - length: { tokens: 2 } + - match: { tokens.0.token: foo } + - match: { tokens.1.token: bar } + +--- +"Array text": + - do: + indices.analyze: + body: + text: ["Foo Bar", "Baz"] + tokenizer: standard + - length: { tokens: 3 } + - match: { tokens.0.token: Foo } + - match: { tokens.1.token: Bar } + - match: { tokens.2.token: Baz } + +--- +"Detail response with Analyzer": + - do: + indices.analyze: + body: + text: This is troubled + analyzer: standard + explain: true + - length: { detail.analyzer.tokens: 3 } + - match: { detail.analyzer.name: standard } + - match: { detail.analyzer.tokens.0.token: this } + - match: { detail.analyzer.tokens.1.token: is } + - match: { detail.analyzer.tokens.2.token: troubled } + +--- +"Custom filter in request": + - do: + indices.analyze: + body: + text: foo bar buzz + tokenizer: standard + explain: true + filter: + - type: stop + stopwords: ["foo", "buzz"] + - length: { detail.tokenizer.tokens: 3 } + - length: { detail.tokenfilters.0.tokens: 1 } + - match: { detail.tokenizer.name: standard } + - match: { detail.tokenizer.tokens.0.token: foo } + - match: { detail.tokenizer.tokens.1.token: bar } + - match: { detail.tokenizer.tokens.2.token: buzz } + - match: { detail.tokenfilters.0.tokens.0.token: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/20_analyze_limit.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/20_analyze_limit.yml new file mode 100644 index 0000000000000..87d3b77aee329 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/20_analyze_limit.yml @@ -0,0 +1,52 @@ +--- +setup: + - do: + indices.create: + index: test_1 + body: + settings: + index.analyze.max_token_count: 3 + +--- +"_analyze with No. generated tokens less than or equal to index.analyze.max_token_count should succeed": + - skip: + version: " - 6.99.99" + reason: index.analyze.max_token_count setting has been added in 7.0.0 + - do: + indices.analyze: + index: test_1 + body: + text: This should succeed + analyzer: standard + - length: { tokens: 3 } + - match: { tokens.0.token: this } + - match: { tokens.1.token: should } + - match: { tokens.2.token: succeed } + +--- +"_analyze with No. generated tokens more than index.analyze.max_token_count should fail": + - skip: + version: " - 6.99.99" + reason: index.analyze.max_token_count setting has been added in 7.0.0 + - do: + catch: /The number of tokens produced by calling _analyze has exceeded the allowed maximum of \[3\]. This limit can be set by changing the \[index.analyze.max_token_count\] index level setting\./ + indices.analyze: + index: test_1 + body: + text: This should fail as it exceeds limit + analyzer: standard + + +--- +"_analyze with explain with No. generated tokens more than index.analyze.max_token_count should fail": + - skip: + version: " - 6.99.99" + reason: index.analyze.max_token_count setting has been added in 7.0.0 + - do: + catch: /The number of tokens produced by calling _analyze has exceeded the allowed maximum of \[3\]. This limit can be set by changing the \[index.analyze.max_token_count\] index level setting\./ + indices.analyze: + index: test_1 + body: + text: This should fail as it exceeds limit + analyzer: standard + explain: true diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clear_cache/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clear_cache/10_basic.yml new file mode 100644 index 0000000000000..099226e41e6d3 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clear_cache/10_basic.yml @@ -0,0 +1,20 @@ +--- +"clear_cache test": + - do: + indices.clear_cache: {} + +--- +"clear_cache with request set to false": + - do: + indices.clear_cache: + request: false + +--- +"clear_cache with fielddata set to true": + - skip: + version: " - 6.2.99" + reason: fielddata was deprecated before 6.3.0 + + - do: + indices.clear_cache: + fielddata: true diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/10_basic.yml new file mode 100644 index 0000000000000..412d29905ffc2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/10_basic.yml @@ -0,0 +1,111 @@ +--- +setup: + - do: + indices.create: + index: source + wait_for_active_shards: 1 + body: + settings: + index.number_of_shards: 2 + index.number_of_replicas: 0 + - do: + index: + index: source + id: "1" + body: { "foo": "hello world" } + + - do: + index: + index: source + id: "2" + body: { "foo": "hello world 2" } + + - do: + index: + index: source + id: "3" + body: { "foo": "hello world 3" } + +--- +"Clone index via API": + - skip: + version: " - 7.3.99" + reason: index cloning was added in 7.4.0 + # make it read-only + - do: + indices.put_settings: + index: source + body: + index.blocks.write: true + index.number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + index: source + + # now we do the actual clone + - do: + indices.clone: + index: "source" + target: "target" + wait_for_active_shards: 1 + master_timeout: 10s + body: + settings: + index.number_of_replicas: 0 + index.number_of_shards: 2 + + - do: + cluster.health: + wait_for_status: green + + - do: + get: + index: target + id: "1" + + - match: { _index: target } + - match: { _type: _doc } + - match: { _id: "1" } + - match: { _source: { foo: "hello world" } } + + + - do: + get: + index: target + id: "2" + + - match: { _index: target } + - match: { _type: _doc } + - match: { _id: "2" } + - match: { _source: { foo: "hello world 2" } } + + + - do: + get: + index: target + id: "3" + + - match: { _index: target } + - match: { _type: _doc } + - match: { _id: "3" } + - match: { _source: { foo: "hello world 3" } } + +--- +"Create illegal clone indices": + - skip: + version: " - 7.3.99" + reason: index cloning was added in 7.4.0 + # try to do an illegal clone with illegal number_of_shards + - do: + catch: /illegal_argument_exception/ + indices.clone: + index: "source" + target: "target" + wait_for_active_shards: 1 + master_timeout: 10s + body: + settings: + index.number_of_replicas: 0 + index.number_of_shards: 6 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml new file mode 100644 index 0000000000000..625f574fa73de --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml @@ -0,0 +1,65 @@ +--- +"Clone index ignores target template mapping": + - skip: + version: " - 7.3.99" + reason: index cloning was added in 7.4.0 + # create index + - do: + indices.create: + index: source + wait_for_active_shards: 1 + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: + properties: + count: + type: text + + # index document + - do: + index: + index: source + id: "1" + body: { "count": "1" } + + # create template matching shrink target + - do: + indices.put_template: + name: tpl1 + body: + index_patterns: targ* + mappings: + properties: + count: + type: integer + + # make it read-only + - do: + indices.put_settings: + index: source + body: + index.blocks.write: true + index.number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + index: source + + # now we do the actual clone + - do: + indices.clone: + index: "source" + target: "target" + wait_for_active_shards: 1 + master_timeout: 10s + body: + settings: + index.number_of_shards: 1 + index.number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml new file mode 100644 index 0000000000000..503cc15609072 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml @@ -0,0 +1,61 @@ +--- +"Copy settings during clone index": + - skip: + version: " - 7.3.99" + reason: index cloning was added in 7.4.0 + features: [arbitrary_key] + + - do: + nodes.info: + node_id: data:true + - set: + nodes._arbitrary_key_: node_id + + - do: + indices.create: + index: source + wait_for_active_shards: 1 + body: + settings: + index.number_of_replicas: 0 + index.number_of_shards: 1 + index.merge.scheduler.max_merge_count: 4 + + # make it read-only + - do: + indices.put_settings: + index: source + body: + index.blocks.write: true + index.number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + index: source + + # now we do an actual clone and copy settings + - do: + indices.clone: + index: "source" + target: "copy-settings-target" + wait_for_active_shards: 1 + master_timeout: 10s + body: + settings: + index.number_of_replicas: 0 + index.number_of_shards: 1 + index.merge.scheduler.max_thread_count: 2 + + - do: + cluster.health: + wait_for_status: green + + - do: + indices.get_settings: + index: "copy-settings-target" + + # settings should be copied + - match: { copy-settings-target.settings.index.merge.scheduler.max_merge_count: "4" } + - match: { copy-settings-target.settings.index.merge.scheduler.max_thread_count: "2" } + - match: { copy-settings-target.settings.index.blocks.write: "true" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/10_basic.yml new file mode 100644 index 0000000000000..cab825734f68e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/10_basic.yml @@ -0,0 +1,173 @@ +--- +"Create index with mappings": + + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0.0 + - do: + indices.create: + index: test_index + body: + mappings: + {} + + - do: + indices.get_mapping: + index: test_index + + - is_true: test_index.mappings + +--- +"Create index with settings": + + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0.0 + - do: + indices.create: + index: test_index + body: + settings: + number_of_replicas: "0" + + - do: + indices.get_settings: + index: test_index + + - match: { test_index.settings.index.number_of_replicas: "0"} + +--- +"Create index": + + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0.0 + - do: + indices.create: + index: test_index + + - match: { acknowledged: true } + - match: { index: "test_index"} + +--- +"Create index with wait_for_active_shards set to all": + + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0.0 + - do: + indices.create: + index: test_index + wait_for_active_shards: all + body: + settings: + number_of_replicas: "0" + + - match: { acknowledged: true } + - match: { shards_acknowledged: true } + +--- +"Create index with aliases": + + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0.0 + - do: + indices.create: + index: test_index + body: + mappings: + properties: + field: + type: text + aliases: + test_alias: {} + test_blias: + routing: b + test_clias: + filter: + term: + field : value + + - do: + indices.get_alias: + index: test_index + + - match: {test_index.aliases.test_blias.search_routing: b} + - match: {test_index.aliases.test_blias.index_routing: b} + - is_false: test_index.aliases.test_blias.filter + - match: {test_index.aliases.test_clias.filter.term.field: value} + - is_false: test_index.aliases.test_clias.index_routing + - is_false: test_index.aliases.test_clias.search_routing + +--- +"Create index with write aliases": + - skip: + version: " - 6.99.99" + reason: is_write_index is not implemented in ES <= 6.x + - do: + indices.create: + index: test_index + body: + aliases: + test_alias: {} + test_blias: + is_write_index: false + test_clias: + is_write_index: true + + - do: + indices.get_alias: + index: test_index + + - is_false: test_index.aliases.test_alias.is_write_index + - is_false: test_index.aliases.test_blias.is_write_index + - is_true: test_index.aliases.test_clias.is_write_index + +--- +"Create index with invalid mappings": + - do: + catch: /illegal_argument_exception/ + indices.create: + index: test_index + body: + mappings: + properties: + "": + type: keyword + +--- +"Create index with explicit _doc type": + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0 + - do: + catch: bad_request + indices.create: + index: test_index + body: + mappings: + _doc: + properties: + field: + type: keyword + + - match: { error.type: "illegal_argument_exception" } + - match: { error.reason: "The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true." } + +--- +"Create index without soft deletes": + - skip: + version: " - 7.5.99" + reason: "indices without soft deletes are deprecated in 7.6" + features: "warnings" + + - do: + warnings: + - Creating indices with soft-deletes disabled is deprecated and will be removed in future Elasticsearch versions. + Please do not specify value for setting [index.soft_deletes.enabled] of index [test_index]. + indices.create: + index: test_index + body: + settings: + soft_deletes.enabled: false diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/11_basic_with_types.yml new file mode 100644 index 0000000000000..f5aeb53751119 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/11_basic_with_types.yml @@ -0,0 +1,143 @@ +--- +"Create index with mappings": + + - do: + indices.create: + include_type_name: true + index: test_index + body: + mappings: + type_1: {} + + - do: + indices.get_mapping: + include_type_name: true + index: test_index + + - is_true: test_index.mappings.type_1 + +--- +"Create index with settings": + + - do: + indices.create: + include_type_name: true + index: test_index + body: + settings: + number_of_replicas: "0" + + - do: + indices.get_settings: + index: test_index + + - match: { test_index.settings.index.number_of_replicas: "0"} + +--- +"Create index": + + - do: + indices.create: + include_type_name: true + index: test_index + + - match: { acknowledged: true } + - match: { index: "test_index"} + +--- +"Create index with wait_for_active_shards set to all": + + - do: + indices.create: + include_type_name: true + index: test_index + wait_for_active_shards: all + body: + settings: + number_of_replicas: "0" + + - match: { acknowledged: true } + - match: { shards_acknowledged: true } + +--- +"Create index with aliases": + + - do: + indices.create: + include_type_name: true + index: test_index + body: + mappings: + type_1: + properties: + field: + type: text + aliases: + test_alias: {} + test_blias: + routing: b + test_clias: + filter: + term: + field : value + + - do: + indices.get_alias: + index: test_index + + - match: {test_index.aliases.test_blias.search_routing: b} + - match: {test_index.aliases.test_blias.index_routing: b} + - is_false: test_index.aliases.test_blias.filter + - match: {test_index.aliases.test_clias.filter.term.field: value} + - is_false: test_index.aliases.test_clias.index_routing + - is_false: test_index.aliases.test_clias.search_routing + +--- +"Create index with write aliases": + - skip: + version: " - 6.99.99" + reason: is_write_index is not implemented in ES <= 6.x + - do: + indices.create: + include_type_name: true + index: test_index + body: + aliases: + test_alias: {} + test_blias: + is_write_index: false + test_clias: + is_write_index: true + + - do: + indices.get_alias: + index: test_index + + - is_false: test_index.aliases.test_alias.is_write_index + - is_false: test_index.aliases.test_blias.is_write_index + - is_true: test_index.aliases.test_clias.is_write_index + +--- +"Create index with no type mappings": + - do: + catch: /illegal_argument_exception/ + indices.create: + include_type_name: true + index: test_index + body: + mappings: + "" : {} + +--- +"Create index with invalid mappings": + - do: + catch: /illegal_argument_exception/ + indices.create: + include_type_name: true + index: test_index + body: + mappings: + test_type: + properties: + "": + type: keyword diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/20_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/20_mix_typeless_typeful.yml new file mode 100644 index 0000000000000..a05134866628b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/20_mix_typeless_typeful.yml @@ -0,0 +1,140 @@ +--- +"Create a typeless index while there is a typed template": + + - skip: + version: " - 6.6.99" + reason: Merging typeless/typed mappings/templates was added in 6.7 + + - do: + indices.put_template: + include_type_name: true + name: test_template + body: + index_patterns: test-* + mappings: + my_type: + properties: + foo: + type: keyword + + - do: + indices.create: + index: test-1 + body: + mappings: + properties: + bar: + type: "long" + + - do: + indices.get_mapping: + include_type_name: true + index: test-1 + + - is_true: test-1.mappings._doc # the index creation call won + - is_false: test-1.mappings.my_type + - is_true: test-1.mappings._doc.properties.foo + - is_true: test-1.mappings._doc.properties.bar + +--- +"Create a typed index while there is a typeless template": + + - skip: + version: " - 6.6.99" + reason: Merging typeless/typed mappings/templates was added in 6.7 + + - do: + indices.put_template: + include_type_name: false + name: test_template + body: + index_patterns: test-* + mappings: + properties: + foo: + type: keyword + + - do: + indices.create: + include_type_name: true + index: test-1 + body: + mappings: + my_type: + properties: + bar: + type: "long" + + - do: + indices.get_mapping: + include_type_name: true + index: test-1 + + - is_true: test-1.mappings.my_type # the index creation call won + - is_false: test-1.mappings._doc + - is_true: test-1.mappings.my_type.properties.foo + - is_true: test-1.mappings.my_type.properties.bar + +--- +"Implicitly create a typed index while there is a typeless template": + + - skip: + version: " - 6.99.99" + reason: include_type_name only supported as of 6.7 + + - do: + indices.put_template: + include_type_name: false + name: test_template + body: + index_patterns: test-* + mappings: + properties: + foo: + type: keyword + + - do: + catch: /the final mapping would have more than 1 type/ + index: + index: test-1 + type: my_type + body: { bar: 42 } + +--- +"Implicitly create a typeless index while there is a typed template": + + - skip: + version: " - 6.99.99" + reason: needs typeless index operations to work on typed indices + + - do: + indices.put_template: + include_type_name: true + name: test_template + body: + index_patterns: test-* + mappings: + my_type: + properties: + foo: + type: keyword + + - do: + index: + index: test-1 + body: { bar: 42 } + +# ensures dynamic mapping update is visible to get_mapping + - do: + cluster.health: + wait_for_events: normal + + - do: + indices.get_mapping: + include_type_name: true + index: test-1 + + - is_true: test-1.mappings.my_type # the template is honored + - is_false: test-1.mappings._doc + - is_true: test-1.mappings.my_type.properties.foo + - is_true: test-1.mappings.my_type.properties.bar diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.data_stream/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.data_stream/10_basic.yml new file mode 100644 index 0000000000000..2861c443bfa8e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.data_stream/10_basic.yml @@ -0,0 +1,33 @@ +--- +"Create data stream": + - skip: + version: " - 7.6.99" + reason: available only in 7.7+ + + - do: + indices.create_data_stream: + name: simple-data-stream1 + body: + timestamp_field: "@timestamp" + - is_true: acknowledged + + - do: + indices.create_data_stream: + name: simple-data-stream2 + body: + timestamp_field: "@timestamp2" + - is_true: acknowledged + + - do: + indices.get_data_streams: {} + - match: { 0.name: simple-data-stream1 } + - match: { 0.timestamp_field: '@timestamp' } + - match: { 0.indices: [] } + - match: { 1.name: simple-data-stream2 } + - match: { 1.timestamp_field: '@timestamp2' } + - match: { 1.indices: [] } + + - do: + indices.delete_data_stream: + name: simple-data-stream2 + - is_true: acknowledged diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete/10_basic.yml new file mode 100644 index 0000000000000..e43c835ae96f2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete/10_basic.yml @@ -0,0 +1,100 @@ +setup: + - do: + indices.create: + index: index + body: + aliases: + alias: {} + - do: + indices.create: + index: index2 +--- +"Delete index against alias": + - do: + catch: bad_request + indices.delete: + index: alias + - do: + indices.get: + index: index,index2 + - is_true: index + - is_true: index2 +--- +"Delete index against alias - ignore unavailable": + - do: + indices.delete: + index: alias + ignore_unavailable: true + - do: + indices.get: + index: index,index2 + - is_true: index + - is_true: index2 +--- +"Delete index against alias - multiple indices": + - do: + catch: bad_request + indices.delete: + index: alias,index2 + - do: + indices.get: + index: index,index2 + - is_true: index + - is_true: index2 +--- +"Delete index against alias - ignore unavailable - multiple indices": + - do: + indices.delete: + index: alias,index2 + ignore_unavailable: true + - do: + indices.get: + index: index,index2 + ignore_unavailable: true + - is_true: index + - is_false: index2 +--- +"Delete index against wildcard matching alias": + - do: + indices.delete: + index: alia* + - do: + indices.get: + index: index,index2 + - is_true: index + - is_true: index2 +--- +"Delete index against wildcard matching alias - disallow no indices": + - do: + catch: missing + indices.delete: + index: alia* + allow_no_indices: false + - do: + indices.get: + index: index,index2 + - is_true: index + - is_true: index2 +--- +"Delete index against wildcard matching alias - multiple indices": + - do: + indices.delete: + index: alia*,index2 + - do: + indices.get: + index: index,index2 + ignore_unavailable: true + - is_true: index + - is_false: index2 +--- +"Delete index against wildcard matching alias - disallow no indices - multiple indices": + - do: + catch: missing + indices.delete: + index: index2,alia* + allow_no_indices: false + - do: + indices.get: + index: index,index2 + - is_true: index + - is_true: index2 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/10_basic.yml new file mode 100644 index 0000000000000..74684901579a4 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/10_basic.yml @@ -0,0 +1,33 @@ +--- +"Basic test for delete alias": + - do: + indices.create: + index: testind + + - do: + indices.put_alias: + index: testind + name: testali + body: + routing: "routing value" + + - do: + indices.get_alias: + name: testali + + - match: {testind.aliases.testali.search_routing: "routing value"} + - match: {testind.aliases.testali.index_routing: "routing value"} + + - do: + indices.delete_alias: + index: testind + name: testali + + - do: + catch: missing + indices.get_alias: + index: testind + name: testali + + - match: { 'status': 404 } + - match: { 'error': 'alias [testali] missing' } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml new file mode 100644 index 0000000000000..d1d01cbaaa7e6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml @@ -0,0 +1,224 @@ +--- +setup: + + - do: + indices.create: + index: test_index1 + + - do: + indices.create: + index: test_index2 + + - do: + indices.create: + index: foo + + - do: + indices.put_alias: + name: alias1 + index: + - test_index1 + - foo + body: + routing: "routing value" + - do: + indices.put_alias: + name: alias2 + index: + - test_index2 + - foo + body: + routing: "routing value" + +--- +"check setup": + - do: + indices.get_alias: + name: alias1 + + - match: {test_index1.aliases.alias1.search_routing: "routing value"} + - match: {foo.aliases.alias1.search_routing: "routing value"} + + - do: + indices.get_alias: + name: alias2 + + - match: {test_index2.aliases.alias2.search_routing: "routing value"} + - match: {foo.aliases.alias2.search_routing: "routing value"} + +--- +"check delete with _all index": + - do: + indices.delete_alias: + index: _all + name: alias1 + + - do: + catch: missing + indices.get_alias: + name: alias1 + - do: + indices.get_alias: + name: alias2 + + - match: {test_index2.aliases.alias2.search_routing: "routing value"} + - match: {foo.aliases.alias2.search_routing: "routing value"} + +--- +"check delete with * index": + - do: + indices.delete_alias: + index: "*" + name: alias1 + + - do: + catch: missing + indices.get_alias: + name: alias1 + - do: + indices.get_alias: + name: alias2 + + - match: {test_index2.aliases.alias2.search_routing: "routing value"} + - match: {foo.aliases.alias2.search_routing: "routing value"} + +--- +"check delete with index list": + - do: + indices.delete_alias: + index: "test_index1,test_index2" + name: alias1 + + - do: + indices.get_alias: + name: alias1 + + - match: {foo.aliases.alias1.search_routing: "routing value"} + - is_false: test_index1 + - is_false: test_index2 + + - do: + indices.get_alias: + name: alias2 + + - match: {test_index2.aliases.alias2.search_routing: "routing value"} + - match: {foo.aliases.alias2.search_routing: "routing value"} + +--- +"check delete with prefix* index": + - do: + indices.delete_alias: + index: "test_*" + name: alias1 + + - do: + indices.get_alias: + name: alias1 + + - match: {foo.aliases.alias1.search_routing: "routing value"} + - is_false: test_index1 + - is_false: test_index2 + + - do: + indices.get_alias: + name: alias2 + + - match: {test_index2.aliases.alias2.search_routing: "routing value"} + - match: {foo.aliases.alias2.search_routing: "routing value"} + + +--- +"check delete with index list and * aliases": + - do: + indices.delete_alias: + index: "test_index1,test_index2" + name: "*" + + - do: + indices.get_alias: + name: alias1 + + - match: {foo.aliases.alias1.search_routing: "routing value"} + - is_false: test_index1 + - is_false: test_index2 + + - do: + indices.get_alias: + name: alias2 + + - match: {foo.aliases.alias2.search_routing: "routing value"} + - is_false: test_index1 + - is_false: test_index2 + +--- +"check delete with index list and _all aliases": + - do: + indices.delete_alias: + index: "test_index1,test_index2" + name: _all + + - do: + indices.get_alias: + name: alias1 + + - match: {foo.aliases.alias1.search_routing: "routing value"} + - is_false: test_index1 + - is_false: test_index2 + + - do: + indices.get_alias: + name: alias2 + + - match: {foo.aliases.alias2.search_routing: "routing value"} + - is_false: test_index1 + - is_false: test_index2 + +--- +"check delete with index list and wildcard aliases": + - do: + indices.delete_alias: + index: "test_index1,test_index2" + name: "*1" + + - do: + indices.get_alias: + name: alias1 + + - match: {foo.aliases.alias1.search_routing: "routing value"} + - is_false: test_index1 + - is_false: test_index2 + + - do: + indices.get_alias: + name: alias2 + + - match: {test_index2.aliases.alias2.search_routing: "routing value"} + - match: {foo.aliases.alias2.search_routing: "routing value"} + +--- +"check 404 on no matching alias": + - do: + catch: missing + indices.delete_alias: + index: "*" + name: "non_existent" + + - do: + catch: missing + indices.delete_alias: + index: "non_existent" + name: "alias1" + + +--- +"check delete with blank index and blank alias": + - do: + catch: param + indices.delete_alias: + name: "alias1" + + - do: + catch: param + indices.delete_alias: + index: "test_index1" + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/10_basic.yml new file mode 100644 index 0000000000000..e8bbb806d1d10 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/10_basic.yml @@ -0,0 +1,25 @@ +--- +"Test indices.exists": + - do: + indices.exists: + index: test_index + + - is_false: '' + + - do: + indices.create: + index: test_index + + - do: + indices.exists: + index: test_index + + - is_true: '' +--- +"Test indices.exists with local flag": + - do: + indices.exists: + index: test_index + local: true + + - is_false: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/20_read_only_index.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/20_read_only_index.yml new file mode 100644 index 0000000000000..24d2dcdc08f84 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/20_read_only_index.yml @@ -0,0 +1,30 @@ +--- +"Test indices.exists on a read only index": + + - do: + indices.create: + index: test_index_ro + + - do: + indices.put_settings: + index: test_index_ro + body: + index.blocks.read_only: true + + - do: + indices.exists: + index: test_index_ro + + - is_true: '' + + - do: + indices.put_settings: + index: test_index_ro + body: + index.blocks.read_only: false + + - do: + indices.exists: + index: test_index_ro + + - is_true: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_alias/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_alias/10_basic.yml new file mode 100644 index 0000000000000..fba0512ca372f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_alias/10_basic.yml @@ -0,0 +1,45 @@ +--- +"Test indices.exists_alias": + - do: + indices.exists_alias: + name: test_alias + + - is_false: '' + + - do: + indices.create: + index: test_index + + - do: + indices.put_alias: + index: test_index + name: test_alias + + - do: + indices.exists_alias: + name: test_alias + + - is_true: '' + + - do: + indices.exists_alias: + index: test_index + name: test_alias + + - is_true: '' + + - do: + indices.exists_alias: + index: test_index1 + name: test_alias + + - is_false: '' + +--- +"Test indices.exists_alias with local flag": + - do: + indices.exists_alias: + name: test_alias + local: true + + - is_false: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_template/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_template/10_basic.yml new file mode 100644 index 0000000000000..67592a013e8f1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_template/10_basic.yml @@ -0,0 +1,40 @@ +--- +setup: + - do: + indices.delete_template: + name: test + ignore: [404] +--- +"Test indices.exists_template": + + - do: + indices.exists_template: + name: test + + - is_false: '' + + - do: + indices.put_template: + name: test + body: + index_patterns: ['test-*'] + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + indices.exists_template: + name: test + master_timeout: 1m + + - is_true: '' + +--- +"Test indices.exists_template with local flag": + - do: + indices.exists_template: + name: test + local: true + + - is_false: '' + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.flush/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.flush/10_basic.yml new file mode 100644 index 0000000000000..79e8197f41542 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.flush/10_basic.yml @@ -0,0 +1,89 @@ +--- +"Index synced flush rest test": + - skip: + version: " - 7.5.99" + reason: "synced flush is deprecated in 7.6" + features: "warnings" + - do: + indices.create: + index: testing + body: + settings: + index: + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + - do: + warnings: + - Synced flush is deprecated and will be removed in 8.0. Use flush at _/flush or /{index}/_flush instead. + indices.flush_synced: + index: testing + + - is_false: _shards.failed + + - do: + indices.stats: {level: shards} + + - is_true: indices.testing.shards.0.0.commit.user_data.sync_id + +--- +"Flush stats": + - skip: + version: " - 6.2.99" + reason: periodic flush stats is introduced in 6.3.0 + - do: + indices.create: + index: test + body: + settings: + number_of_shards: 1 + index.translog.flush_threshold_size: 160b + - do: + indices.flush: + index: test + - do: + indices.stats: { index: test } + - match: { indices.test.primaries.flush.periodic: 0 } + - match: { indices.test.primaries.flush.total: 1 } + - do: + index: + index: test + type: doc + id: 1 + body: { "message": "a long message to make a periodic flush happen after this index operation" } + - do: + indices.stats: { index: test } + # periodic flush is async + - gte: { indices.test.primaries.flush.periodic: 0 } + - gte: { indices.test.primaries.flush.total: 1 } + +--- +"Flush parameters validation": + - skip: + version: " - 7.1.99" + reason: flush parameters validation is introduced in 7.2.0 + - do: + indices.create: + index: test + body: + settings: + number_of_shards: 1 + - do: + catch: /action_request_validation_exception.+ wait_if_ongoing must be true for a force flush/ + indices.flush: + index: test + force: true + wait_if_ongoing: false + - do: + indices.stats: { index: test } + - match: { indices.test.primaries.flush.total: 0 } + - do: + indices.flush: + index: test + force: true + wait_if_ongoing: true + - do: + indices.stats: { index: test } + - match: { indices.test.primaries.flush.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.forcemerge/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.forcemerge/10_basic.yml new file mode 100644 index 0000000000000..c71a2e5e43429 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.forcemerge/10_basic.yml @@ -0,0 +1,31 @@ +--- +"Force merge index tests": + - do: + indices.create: + index: testing + + - do: + indices.forcemerge: + index: testing + max_num_segments: 1 + +--- +"Check deprecation warning when incompatible only_expunge_deletes and max_num_segments values are both set": + - skip: + version: " - 7.3.99" + reason: "deprecation warning about only_expunge_deletes and max_num_segments added in 7.4" + features: "warnings" + + - do: + indices.create: + index: test + + - do: + warnings: + - 'setting only_expunge_deletes and max_num_segments at the same time is deprecated and will be rejected in a future version' + indices.forcemerge: + index: test + max_num_segments: 10 + only_expunge_deletes: true + + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/10_basic.yml new file mode 100644 index 0000000000000..b70bc8ebeb469 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/10_basic.yml @@ -0,0 +1,167 @@ +--- +setup: + + - do: + indices.create: + index: test_index + body: + aliases: + test_alias: {} + test_blias: {} + mappings: + properties: + foo: + type: keyword + settings: + number_of_shards: 1 + number_of_replicas: 1 + + - do: + indices.create: + index: test_index_2 + body: + settings: + number_of_shards: 1 + number_of_replicas: 2 + aliases: + test_alias: {} + test_blias: {} + + - do: + indices.create: + index: test_index_3 + body: + aliases: + test_alias: {} + test_blias: {} + + - do: + indices.close: + index: test_index_3 + + - do: + cluster.health: + wait_for_status: yellow + +--- +"Get index infos": + + - do: + indices.get: + index: test_index + + - is_true: test_index.aliases + - is_true: test_index.settings + - is_true: test_index.mappings + +--- +"Get index infos should work for wildcards": + + - do: + indices.get: + index: test_* + + - is_true: test_index.mappings + - is_true: test_index.aliases + - is_true: test_index.settings + - is_true: test_index_2.settings + - is_true: test_index_2.mappings + - is_true: test_index_2.aliases + +--- +"Get index infos with human settings should return index creation date and version in readable format": + + - do: + indices.get: + index: test_index + human: true + + - is_true: test_index.settings.index.creation_date_string + - is_true: test_index.settings.index.version.created_string + +--- +"Get index infos by default shouldn't return index creation date and version in readable format": + + - do: + indices.get: + index: test_index + + - is_false: test_index.settings.index.creation_date_string + - is_false: test_index.settings.index.version.created_string + +--- +"Missing index should throw an Error": + + - do: + catch: missing + indices.get: + index: test_not_found + +--- +"Missing index should return empty object if ignore_unavailable": + + - do: + indices.get: + index: test_not_found + ignore_unavailable: true + + - match: { $body: {} } + +--- +"Should return empty object if allow_no_indices": + + - do: + indices.get: + index: test_not* + + - match: { $body: {} } + +--- +"Should throw error if allow_no_indices=false": + + - do: + catch: missing + indices.get: + index: test_not* + allow_no_indices: false + +--- +"Should return test_index_2 if expand_wildcards=open": + + - do: + indices.get: + index: test_index_* + expand_wildcards: open + + - is_true: test_index_2.settings + - is_false: test_index_3.settings + +--- +"Should return test_index_3 if expand_wildcards=closed": + + - do: + indices.get: + index: test_index_* + expand_wildcards: closed + + - is_false: test_index_2.settings + - is_true: test_index_3.settings + +--- +"Should return test_index_2 and test_index_3 if expand_wildcards=open,closed": + + - do: + indices.get: + index: test_index_* + expand_wildcards: open,closed + + - is_true: test_index_2.settings + - is_true: test_index_3.settings + +--- +"Should return an exception when querying invalid indices": + + - do: + catch: bad_request + indices.get: + index: _foo diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/11_basic_with_types.yml new file mode 100644 index 0000000000000..413c4bcb8d28c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/11_basic_with_types.yml @@ -0,0 +1,78 @@ +--- +setup: + + - do: + indices.create: + include_type_name: true + index: test_index + body: + aliases: + test_alias: {} + test_blias: {} + mappings: + type_1: {} + settings: + number_of_shards: 1 + number_of_replicas: 1 + + - do: + indices.create: + index: test_index_2 + body: + settings: + number_of_shards: 1 + number_of_replicas: 2 + aliases: + test_alias: {} + test_blias: {} + + - do: + indices.create: + index: test_index_3 + body: + aliases: + test_alias: {} + test_blias: {} + + - do: + indices.close: + index: test_index_3 + + - do: + cluster.health: + wait_for_status: yellow + +--- +"Test include_type_name": + - skip: + version: " - 6.6.99" + reason: the include_type_name parameter is not supported before 6.7 + + - do: + indices.get: + include_type_name: true + index: test_index + + - is_true: test_index.mappings + - is_true: test_index.mappings.type_1 + + - do: + indices.get: + include_type_name: false + index: test_index + + - is_true: test_index.mappings + - is_false: test_index.mappings.type_1 + +--- +"Test include_type_name dafaults to false": + - skip: + version: " - 6.99.99" + reason: the include_type_name parameter default is different on 6.x and 7.0, so only test this on 7.0 clusters + + - do: + indices.get: + index: test_index + + - is_true: test_index.mappings + - is_false: test_index.mappings.type_1 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/10_basic.yml new file mode 100644 index 0000000000000..f3dc3ac86bc9f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/10_basic.yml @@ -0,0 +1,324 @@ +--- +setup: + + - do: + indices.create: + index: test_index + body: + aliases: + test_alias: {} + test_blias: {} + + - do: + indices.create: + index: test_index_2 + body: + aliases: + test_alias: {} + test_blias: {} + +--- +"Get all aliases via /_alias": + + - do: + indices.create: + index: test_index_3 + + - do: + indices.get_alias: {} + + - match: {test_index.aliases.test_alias: {}} + - match: {test_index.aliases.test_blias: {}} + - match: {test_index_2.aliases.test_alias: {}} + - match: {test_index_2.aliases.test_blias: {}} + - match: {test_index_3.aliases: {}} + +--- +"Get aliases via /_alias/_all": + + - do: + indices.create: + index: test_index_3 + + - do: + indices.get_alias: + name: _all + + - match: {test_index.aliases.test_alias: {}} + - match: {test_index.aliases.test_blias: {}} + - match: {test_index_2.aliases.test_alias: {}} + - match: {test_index_2.aliases.test_blias: {}} + - is_false: test_index_3 + +--- +"Get aliases via /_alias/*": + + - do: + indices.create: + index: test_index_3 + + - do: + indices.get_alias: + name: '*' + + - match: {test_index.aliases.test_alias: {}} + - match: {test_index.aliases.test_blias: {}} + - match: {test_index_2.aliases.test_alias: {}} + - match: {test_index_2.aliases.test_blias: {}} + - is_false: test_index_3 + +--- +"Get all aliases via /{index}/_alias/": + + - do: + indices.get_alias: + index: test_index + + - match: {test_index.aliases.test_alias: {}} + - match: {test_index.aliases.test_blias: {}} + - is_false: test_index_2 + +--- +"Get aliases via /_all/_alias/": + - do: + indices.create: + index: myindex + + - do: + indices.get_alias: + index: _all + + - match: {test_index.aliases.test_alias: {}} + - match: {test_index.aliases.test_blias: {}} + - match: {test_index_2.aliases.test_alias: {}} + - match: {test_index_2.aliases.test_blias: {}} + - match: {myindex.aliases: {}} + +--- +"Get aliases via /*/_alias/": + - do: + indices.create: + index: myindex + + - do: + indices.get_alias: + index: "*" + + - match: {test_index.aliases.test_alias: {}} + - match: {test_index.aliases.test_blias: {}} + - match: {test_index_2.aliases.test_alias: {}} + - match: {test_index_2.aliases.test_blias: {}} + - match: {myindex.aliases: {}} + +--- +"Get and index with no aliases via /{index}/_alias/": + - do: + indices.create: + index: myindex + + - do: + indices.get_alias: + index: myindex + + - match: {myindex.aliases: {}} + +--- +"Get specific alias via /{index}/_alias/{name}": + + - do: + indices.get_alias: + index: test_index + name: test_alias + + - match: {test_index.aliases.test_alias: {}} + - is_false: test_index.aliases.test_blias + - is_false: test_index_2 + +--- +"Get aliases via /{index}/_alias/_all": + + - do: + indices.get_alias: + index: test_index + name: _all + + - match: {test_index.aliases.test_alias: {}} + - match: {test_index.aliases.test_blias: {}} + - is_false: test_index_2 + +--- +"Get aliases via /{index}/_alias/*": + + - do: + indices.get_alias: + index: test_index + name: '*' + + - match: {test_index.aliases.test_alias: {}} + - match: {test_index.aliases.test_blias: {}} + - is_false: test_index_2 + +--- +"Get aliases via /{index}/_alias/prefix*": + - do: + indices.get_alias: + index: test_index + name: 'test_a*' + + - match: {test_index.aliases.test_alias: {}} + - is_false: test_index.aliases.test_blias + - is_false: test_index_2 + +--- +"Get aliases via /{index}/_alias/name,name": + + - do: + indices.get_alias: + index: test_index + name: 'test_alias,test_blias' + + - match: {test_index.aliases.test_alias: {}} + - match: {test_index.aliases.test_blias: {}} + - is_false: test_index_2 + +--- +"Get aliases via /_alias/{name}": + + - do: + indices.get_alias: + name: test_alias + + - match: {test_index.aliases.test_alias: {}} + - match: {test_index_2.aliases.test_alias: {}} + - is_false: test_index.aliases.test_blias + - is_false: test_index_2.aliases.test_blias + +--- +"Get aliases via /_all/_alias/{name}": + + - do: + indices.get_alias: + index: _all + name: test_alias + + - match: {test_index.aliases.test_alias: {}} + - match: {test_index_2.aliases.test_alias: {}} + - is_false: test_index.aliases.test_blias + - is_false: test_index_2.aliases.test_blias + +--- +"Get aliases via /*/_alias/{name}": + + - do: + indices.get_alias: + index: '*' + name: test_alias + + - match: {test_index.aliases.test_alias: {}} + - match: {test_index_2.aliases.test_alias: {}} + - is_false: test_index.aliases.test_blias + - is_false: test_index_2.aliases.test_blias + +--- +"Get aliases via /*suf/_alias/{name}": + + - do: + indices.get_alias: + index: '*2' + name: test_alias + + - match: {test_index_2.aliases.test_alias: {}} + - is_false: test_index.aliases.test_alias + - is_false: test_index.aliases.test_blias + - is_false: test_index_2.aliases.test_blias + +--- +"Get aliases via /name,name/_alias/{name}": + + - do: + indices.get_alias: + index: test_index,test_index_2 + name: test_alias + + - match: {test_index.aliases.test_alias: {}} + - match: {test_index_2.aliases.test_alias: {}} + - is_false: test_index.aliases.test_blias + - is_false: test_index_2.aliases.test_blias + + +--- +"Non-existent alias on an existing index returns 404": + - do: + catch: missing + indices.get_alias: + index: test_index + name: non-existent + + - match: { 'status': 404} + - match: { 'error': 'alias [non-existent] missing' } + +--- +"Existent and non-existent alias returns 404 and the existing alias": + - do: + catch: missing + indices.get_alias: + index: test_index + name: test_alias,non-existent + + - match: { 'status': 404 } + - match: { 'error': 'alias [non-existent] missing' } + - match: { test_index.aliases.test_alias: { } } + +--- +"Existent and non-existent aliases returns 404 and the existing alias": + - do: + catch: missing + indices.get_alias: + index: test_index + name: test_alias,non-existent,another-non-existent + + - match: { 'status': 404 } + - match: { 'error': 'aliases [another-non-existent,non-existent] missing' } + - match: { test_index.aliases.test_alias: { } } + +--- +"Getting alias on an non-existent index should return 404": + + - do: + catch: missing + indices.get_alias: + index: non-existent + name: foo + +--- +"Get alias with local flag": + + - do: + indices.get_alias: + local: true + + - is_true: test_index + + - is_true: test_index_2 + +--- +"Get alias against closed indices": + + - do: + indices.close: + index: test_index_2 + + - do: + indices.get_alias: + name: test_alias + + - is_true: test_index + - is_true: test_index_2 + + - do: + indices.get_alias: + name: test_alias + expand_wildcards: open + + - is_true: test_index + - is_false: test_index_2 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/20_empty.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/20_empty.yml new file mode 100644 index 0000000000000..7405d99441b39 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/20_empty.yml @@ -0,0 +1,19 @@ +--- +setup: + + - do: + indices.create: + index: test_index + + - do: + indices.create: + index: test_index_2 + +--- +"Check empty aliases when getting all aliases via /_alias": + + - do: + indices.get_alias: {} + + - match: {test_index.aliases: {}} + - match: {test_index_2.aliases: {}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/30_wildcards.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/30_wildcards.yml new file mode 100644 index 0000000000000..08b3009be0e88 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/30_wildcards.yml @@ -0,0 +1,140 @@ +--- +setup: + + - do: + indices.create: + index: test_index + body: + aliases: + test_alias_1: {} + test_alias_2: {} + test_blias_1: {} + test_blias_2: {} + test: {} + +--- +"Get aliases wildcard and inclusion": + - do: + indices.get_alias: + name: test_alias*,test_blias_1 + + - match: {test_index.aliases.test_alias_1: {}} + - match: {test_index.aliases.test_alias_2: {}} + - match: {test_index.aliases.test_blias_1: {}} + - is_false: test_index.aliases.test_blias_2 + - is_false: test_index.aliases.test + +--- +"Get aliases wildcard and simple exclusion": + - skip: + version: " - 6.99.99" + reason: Exclusions in the alias expression are not handled + - do: + indices.get_alias: + name: test_blias_2,test_alias*,-test_alias_1 + + - is_false: test_index.aliases.test_alias_1 + - match: {test_index.aliases.test_alias_2: {}} + - is_false: test_index.aliases.test_blias_1 + - match: {test_index.aliases.test_blias_2: {}} + - is_false: test_index.aliases.test + +--- +"Get aliases and wildcard exclusion": + - skip: + version: " - 6.99.99" + reason: Exclusions in the alias expression are not handled + - do: + indices.get_alias: + name: test_alias_1,test_blias_1,-test_alias* + + - is_false: test_index.aliases.test_alias_1 + - is_false: test_index.aliases.test_alias_2 + - match: {test_index.aliases.test_blias_1: {}} + - is_false: test_index.aliases.test_blias_2 + - is_false: test_index.aliases.test + + - do: + indices.get_alias: + name: test_blias_2,tes*,-test_alias* + + - is_false: test_index.aliases.test_alias_1 + - is_false: test_index.aliases.test_alias_2 + - match: {test_index.aliases.test_blias_1: {}} + - match: {test_index.aliases.test_blias_2: {}} + - match: {test_index.aliases.test: {}} + +--- +"Non-existent exclusion alias before wildcard returns 404": + - skip: + version: " - 6.99.99" + reason: Exclusions in the alias expression are not handled + - do: + catch: missing + indices.get_alias: + name: -test_alias_1,test_alias*,-test_alias_2 + + - match: { 'status': 404} + - match: { 'error': 'alias [-test_alias_1] missing' } + - match: {test_index.aliases.test_alias_1: {}} + - is_false: test_index.aliases.test_alias_2 + - is_false: test_index.aliases.test_blias_1 + - is_false: test_index.aliases.test_blias_2 + - is_false: test_index.aliases.test + + - do: + catch: missing + indices.get_alias: + name: -test_alias_1,-non-existing,test_alias*,-test + + - match: { 'status': 404} + - match: { 'error': 'aliases [-non-existing,-test_alias_1] missing' } + - match: {test_index.aliases.test_alias_1: {}} + - match: {test_index.aliases.test_alias_2: {}} + - is_false: test_index.aliases.test_blias_1 + - is_false: test_index.aliases.test_blias_2 + - is_false: test_index.aliases.test + +--- +"Missing exclusions does not fire 404": + - skip: + version: " - 6.99.99" + reason: Exclusions in the alias expression are not handled + - do: + indices.get_alias: + name: test_alias*,-non-existent,test_blias*,-test + + - match: {test_index.aliases.test_alias_1: {}} + - match: {test_index.aliases.test_alias_2: {}} + - match: {test_index.aliases.test_blias_1: {}} + - match: {test_index.aliases.test_blias_2: {}} + - is_false: test_index.aliases.test + +--- +"Exclusion of non wildcarded aliases": + - skip: + version: " - 6.99.99" + reason: Exclusions in the alias expression are not handled + - do: + indices.get_alias: + name: test_alias_1,test_blias_2,-test_alias*,-test_blias_2 + + - match: { '': {}} + +--- +"Wildcard exclusions does not trigger 404": + - skip: + version: " - 6.99.99" + reason: Exclusions in the alias expression are not handled + - do: + catch: missing + indices.get_alias: + name: -non-existent,-non-existent*,-another + + - match: { 'status': 404} + - match: { 'error': 'alias [-non-existent] missing' } + - is_false: test_index.aliases.test_alias_1 + - is_false: test_index.aliases.test_alias_2 + - is_false: test_index.aliases.test_blias_1 + - is_false: test_index.aliases.test_blias_2 + - is_false: test_index.aliases.test diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/10_basic.yml new file mode 100644 index 0000000000000..9be1f7246d5f3 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/10_basic.yml @@ -0,0 +1,54 @@ +--- +setup: + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0 + - do: + indices.create: + index: test_index + body: + mappings: + properties: + text: + type: text + +--- +"Get field mapping with no index": + + - do: + indices.get_field_mapping: + fields: text + + - match: {test_index.mappings.text.mapping.text.type: text} + +--- +"Get field mapping by index only": + - do: + indices.get_field_mapping: + index: test_index + fields: text + + - match: {test_index.mappings.text.mapping.text.type: text} + +--- +"Get field mapping by field, with another field that doesn't exist": + + - do: + indices.get_field_mapping: + index: test_index + fields: [ text , text1 ] + + - match: {test_index.mappings.text.mapping.text.type: text} + - is_false: test_index.mappings.test_type.text1 + +--- +"Get field mapping with include_defaults": + + - do: + indices.get_field_mapping: + index: test_index + fields: text + include_defaults: true + + - match: {test_index.mappings.text.mapping.text.type: text} + - match: {test_index.mappings.text.mapping.text.analyzer: default} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/11_basic_with_types.yml new file mode 100644 index 0000000000000..0a7f5fa3560ba --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/11_basic_with_types.yml @@ -0,0 +1,83 @@ +--- +setup: + - do: + indices.create: + include_type_name: true + index: test_index + body: + mappings: + test_type: + properties: + text: + type: text + +--- +"Get field mapping with no index and type": + + - do: + indices.get_field_mapping: + include_type_name: true + fields: text + + - match: {test_index.mappings.test_type.text.mapping.text.type: text} + +--- +"Get field mapping by index only": + - do: + indices.get_field_mapping: + include_type_name: true + index: test_index + fields: text + + - match: {test_index.mappings.test_type.text.mapping.text.type: text} + +--- +"Get field mapping by type & field": + + - do: + indices.get_field_mapping: + include_type_name: true + index: test_index + type: test_type + fields: text + + - match: {test_index.mappings.test_type.text.mapping.text.type: text} + +--- +"Get field mapping by type & field, with another field that doesn't exist": + + - do: + indices.get_field_mapping: + include_type_name: true + index: test_index + type: test_type + fields: [ text , text1 ] + + - match: {test_index.mappings.test_type.text.mapping.text.type: text} + - is_false: test_index.mappings.test_type.text1 + +--- +"Get field mapping with include_defaults": + + - do: + indices.get_field_mapping: + include_type_name: true + index: test_index + type: test_type + fields: text + include_defaults: true + + - match: {test_index.mappings.test_type.text.mapping.text.type: text} + - match: {test_index.mappings.test_type.text.mapping.text.analyzer: default} + +--- +"Get field mapping should work without index specifying type and fields": + + - do: + indices.get_field_mapping: + include_type_name: true + type: test_type + fields: text + + - match: {test_index.mappings.test_type.text.mapping.text.type: text} + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/20_missing_field.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/20_missing_field.yml new file mode 100644 index 0000000000000..1570ded351874 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/20_missing_field.yml @@ -0,0 +1,21 @@ +--- +"Return empty object if field doesn't exist, but type and index do": + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0 + - do: + indices.create: + index: test_index + body: + mappings: + properties: + text: + type: text + analyzer: whitespace + + - do: + indices.get_field_mapping: + index: test_index + fields: not_existent + + - match: { 'test_index.mappings': {}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/21_missing_field_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/21_missing_field_with_types.yml new file mode 100644 index 0000000000000..264d187ebd22d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/21_missing_field_with_types.yml @@ -0,0 +1,23 @@ +--- +"Return empty object if field doesn't exist, but type and index do": + + - do: + indices.create: + include_type_name: true + index: test_index + body: + mappings: + test_type: + properties: + text: + type: text + analyzer: whitespace + + - do: + indices.get_field_mapping: + include_type_name: true + index: test_index + type: test_type + fields: not_existent + + - match: { '': {}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/30_missing_type.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/30_missing_type.yml new file mode 100644 index 0000000000000..0bf3f1f7823ee --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/30_missing_type.yml @@ -0,0 +1,22 @@ +--- +"Raise 404 when type doesn't exist": + + - do: + indices.create: + include_type_name: true + index: test_index + body: + mappings: + test_type: + properties: + text: + type: text + analyzer: whitespace + + - do: + catch: missing + indices.get_field_mapping: + include_type_name: true + index: test_index + type: not_test_type + fields: text diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/40_missing_index.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/40_missing_index.yml new file mode 100644 index 0000000000000..7c7b07b587849 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/40_missing_index.yml @@ -0,0 +1,10 @@ +--- +"Raise 404 when index doesn't exist": + + - do: + catch: missing + indices.get_field_mapping: + index: test_index + fields: field + + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/50_field_wildcards.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/50_field_wildcards.yml new file mode 100644 index 0000000000000..7db61d122e7ce --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/50_field_wildcards.yml @@ -0,0 +1,133 @@ +--- +setup: + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0 + - do: + indices.create: + index: test_index + body: + mappings: + properties: + t1: + type: text + t2: + type: text + obj: + properties: + t1: + type: text + i_t1: + type: text + i_t3: + type: text + + - do: + indices.create: + index: test_index_2 + body: + mappings: + properties: + t1: + type: text + t2: + type: text + obj: + properties: + t1: + type: text + i_t1: + type: text + i_t3: + type: text + +--- +"Get field mapping with * for fields": + + - do: + indices.get_field_mapping: + fields: "*" + + - match: {test_index.mappings.t1.full_name: t1 } + - match: {test_index.mappings.t2.full_name: t2 } + - match: {test_index.mappings.obj\.t1.full_name: obj.t1 } + - match: {test_index.mappings.obj\.i_t1.full_name: obj.i_t1 } + - match: {test_index.mappings.obj\.i_t3.full_name: obj.i_t3 } + +--- +"Get field mapping with t* for fields": + + - do: + indices.get_field_mapping: + index: test_index + fields: "t*" + + - match: {test_index.mappings.t1.full_name: t1 } + - match: {test_index.mappings.t2.full_name: t2 } + - length: {test_index.mappings: 2} + +--- +"Get field mapping with *t1 for fields": + + - do: + indices.get_field_mapping: + index: test_index + fields: "*t1" + - match: {test_index.mappings.t1.full_name: t1 } + - match: {test_index.mappings.obj\.t1.full_name: obj.t1 } + - match: {test_index.mappings.obj\.i_t1.full_name: obj.i_t1 } + - length: {test_index.mappings: 3} + +--- +"Get field mapping with wildcarded relative names": + + - do: + indices.get_field_mapping: + index: test_index + fields: "obj.i_*" + - match: {test_index.mappings.obj\.i_t1.full_name: obj.i_t1 } + - match: {test_index.mappings.obj\.i_t3.full_name: obj.i_t3 } + - length: {test_index.mappings: 2} + +--- +"Get field mapping should work using '_all' for index": + + - do: + indices.get_field_mapping: + index: _all + fields: "t*" + - match: {test_index.mappings.t1.full_name: t1 } + - match: {test_index.mappings.t2.full_name: t2 } + - length: {test_index.mappings: 2} + - match: {test_index_2.mappings.t1.full_name: t1 } + - match: {test_index_2.mappings.t2.full_name: t2 } + - length: {test_index_2.mappings: 2} + +--- +"Get field mapping should work using '*' for index": + + - do: + indices.get_field_mapping: + index: '*' + fields: "t*" + - match: {test_index.mappings.t1.full_name: t1 } + - match: {test_index.mappings.t2.full_name: t2 } + - length: {test_index.mappings: 2} + - match: {test_index_2.mappings.t1.full_name: t1 } + - match: {test_index_2.mappings.t2.full_name: t2 } + - length: {test_index_2.mappings: 2} + +--- +"Get field mapping should work using comma_separated values for indices": + + - do: + indices.get_field_mapping: + index: 'test_index,test_index_2' + fields: "t*" + - match: {test_index.mappings.t1.full_name: t1 } + - match: {test_index.mappings.t2.full_name: t2 } + - length: {test_index.mappings: 2} + - match: {test_index_2.mappings.t1.full_name: t1 } + - match: {test_index_2.mappings.t2.full_name: t2 } + - length: {test_index_2.mappings: 2} + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/51_field_wildcards_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/51_field_wildcards_with_types.yml new file mode 100644 index 0000000000000..68c183e9b292e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/51_field_wildcards_with_types.yml @@ -0,0 +1,144 @@ +--- +setup: + - do: + indices.create: + include_type_name: true + index: test_index + body: + mappings: + test_type: + properties: + t1: + type: text + t2: + type: text + obj: + properties: + t1: + type: text + i_t1: + type: text + i_t3: + type: text + + - do: + indices.create: + include_type_name: true + index: test_index_2 + body: + mappings: + test_type_2: + properties: + t1: + type: text + t2: + type: text + obj: + properties: + t1: + type: text + i_t1: + type: text + i_t3: + type: text + +--- +"Get field mapping with * for fields": + + - do: + indices.get_field_mapping: + include_type_name: true + fields: "*" + + - match: {test_index.mappings.test_type.t1.full_name: t1 } + - match: {test_index.mappings.test_type.t2.full_name: t2 } + - match: {test_index.mappings.test_type.obj\.t1.full_name: obj.t1 } + - match: {test_index.mappings.test_type.obj\.i_t1.full_name: obj.i_t1 } + - match: {test_index.mappings.test_type.obj\.i_t3.full_name: obj.i_t3 } + +--- +"Get field mapping with t* for fields": + + - do: + indices.get_field_mapping: + include_type_name: true + index: test_index + fields: "t*" + + - match: {test_index.mappings.test_type.t1.full_name: t1 } + - match: {test_index.mappings.test_type.t2.full_name: t2 } + - length: {test_index.mappings.test_type: 2} + +--- +"Get field mapping with *t1 for fields": + + - do: + indices.get_field_mapping: + include_type_name: true + index: test_index + fields: "*t1" + - match: {test_index.mappings.test_type.t1.full_name: t1 } + - match: {test_index.mappings.test_type.obj\.t1.full_name: obj.t1 } + - match: {test_index.mappings.test_type.obj\.i_t1.full_name: obj.i_t1 } + - length: {test_index.mappings.test_type: 3} + +--- +"Get field mapping with wildcarded relative names": + + - do: + indices.get_field_mapping: + include_type_name: true + index: test_index + fields: "obj.i_*" + - match: {test_index.mappings.test_type.obj\.i_t1.full_name: obj.i_t1 } + - match: {test_index.mappings.test_type.obj\.i_t3.full_name: obj.i_t3 } + - length: {test_index.mappings.test_type: 2} + +--- +"Get field mapping should work using '_all' for indices and types": + + - do: + indices.get_field_mapping: + include_type_name: true + index: _all + type: _all + fields: "t*" + - match: {test_index.mappings.test_type.t1.full_name: t1 } + - match: {test_index.mappings.test_type.t2.full_name: t2 } + - length: {test_index.mappings.test_type: 2} + - match: {test_index_2.mappings.test_type_2.t1.full_name: t1 } + - match: {test_index_2.mappings.test_type_2.t2.full_name: t2 } + - length: {test_index_2.mappings.test_type_2: 2} + +--- +"Get field mapping should work using '*' for indices and types": + + - do: + indices.get_field_mapping: + include_type_name: true + index: '*' + type: '*' + fields: "t*" + - match: {test_index.mappings.test_type.t1.full_name: t1 } + - match: {test_index.mappings.test_type.t2.full_name: t2 } + - length: {test_index.mappings.test_type: 2} + - match: {test_index_2.mappings.test_type_2.t1.full_name: t1 } + - match: {test_index_2.mappings.test_type_2.t2.full_name: t2 } + - length: {test_index_2.mappings.test_type_2: 2} + +--- +"Get field mapping should work using comma_separated values for indices and types": + + - do: + indices.get_field_mapping: + include_type_name: true + index: 'test_index,test_index_2' + type: 'test_type,test_type_2' + fields: "t*" + - match: {test_index.mappings.test_type.t1.full_name: t1 } + - match: {test_index.mappings.test_type.t2.full_name: t2 } + - length: {test_index.mappings.test_type: 2} + - match: {test_index_2.mappings.test_type_2.t1.full_name: t1 } + - match: {test_index_2.mappings.test_type_2.t2.full_name: t2 } + - length: {test_index_2.mappings.test_type_2: 2} + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/60_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/60_mix_typeless_typeful.yml new file mode 100644 index 0000000000000..2b6433a3e98f8 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/60_mix_typeless_typeful.yml @@ -0,0 +1,21 @@ +--- +"GET mapping with typeless API on an index that has types": + + - do: + indices.create: # not using include_type_name: false on purpose + include_type_name: true + index: index + body: + mappings: + not_doc: + properties: + foo: + type: "keyword" + + - do: + indices.get_field_mapping: + include_type_name: false + index: index + fields: foo + + - match: { index.mappings.foo.mapping.foo.type: "keyword" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/10_basic.yml new file mode 100644 index 0000000000000..c3addd95469d4 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/10_basic.yml @@ -0,0 +1,88 @@ +--- +setup: + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0 + - do: + indices.create: + index: test_1 + body: + mappings: {} + - do: + indices.create: + index: test_2 + body: + mappings: {} +--- +"Get /{index}/_mapping with empty mappings": + + - do: + indices.create: + index: t + + - do: + indices.get_mapping: + index: t + + - match: { t.mappings: {}} + +--- +"Get /_mapping": + + - do: + indices.get_mapping: {} + + - is_true: test_1.mappings + - is_true: test_2.mappings + +--- +"Get /{index}/_mapping": + + - do: + indices.get_mapping: + index: test_1 + + - is_true: test_1.mappings + - is_false: test_2 + + + +--- +"Get /_all/_mapping": + + - do: + indices.get_mapping: + index: _all + + - is_true: test_1.mappings + - is_true: test_2.mappings + +--- +"Get /*/_mapping": + + - do: + indices.get_mapping: + index: '*' + + - is_true: test_1.mappings + - is_true: test_2.mappings + +--- +"Get /index,index/_mapping": + + - do: + indices.get_mapping: + index: test_1,test_2 + + - is_true: test_1.mappings + - is_true: test_2.mappings + +--- +"Get /index*/_mapping/": + + - do: + indices.get_mapping: + index: '*2' + + - is_true: test_2.mappings + - is_false: test_1 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/11_basic_with_types.yml new file mode 100644 index 0000000000000..598cc24f7806b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/11_basic_with_types.yml @@ -0,0 +1,158 @@ +--- +setup: + - do: + indices.create: + include_type_name: true + index: test_1 + body: + mappings: + doc: {} + - do: + indices.create: + include_type_name: true + index: test_2 + body: + mappings: + doc: {} +--- +"Get /{index}/_mapping with empty mappings": + + - do: + indices.create: + index: t + + - do: + indices.get_mapping: + include_type_name: true + index: t + + - match: { t.mappings: {}} + +--- +"Get /_mapping": + + - do: + indices.get_mapping: + include_type_name: true + + - is_true: test_1.mappings.doc + - is_true: test_2.mappings.doc + +--- +"Get /{index}/_mapping": + + - do: + indices.get_mapping: + include_type_name: true + index: test_1 + + - is_true: test_1.mappings.doc + - is_false: test_2 + + +--- +"Get /{index}/_mapping/_all": + + - do: + indices.get_mapping: + include_type_name: true + index: test_1 + type: _all + + - is_true: test_1.mappings.doc + - is_false: test_2 + +--- +"Get /{index}/_mapping/*": + + - do: + indices.get_mapping: + include_type_name: true + index: test_1 + type: '*' + + - is_true: test_1.mappings.doc + - is_false: test_2 + +--- +"Get /{index}/_mapping/{type}": + + - do: + indices.get_mapping: + include_type_name: true + index: test_1 + type: doc + + - is_true: test_1.mappings.doc + - is_false: test_2 + +--- +"Get /{index}/_mapping/{type*}": + + - do: + indices.get_mapping: + include_type_name: true + index: test_1 + type: 'd*' + + - is_true: test_1.mappings.doc + - is_false: test_2 + +--- +"Get /_mapping/{type}": + + - do: + indices.get_mapping: + include_type_name: true + type: doc + + - is_true: test_1.mappings.doc + - is_true: test_2.mappings.doc + +--- +"Get /_all/_mapping/{type}": + + - do: + indices.get_mapping: + include_type_name: true + index: _all + type: doc + + - is_true: test_1.mappings.doc + - is_true: test_2.mappings.doc + +--- +"Get /*/_mapping/{type}": + + - do: + indices.get_mapping: + include_type_name: true + index: '*' + type: doc + + - is_true: test_1.mappings.doc + - is_true: test_2.mappings.doc + +--- +"Get /index,index/_mapping/{type}": + + - do: + indices.get_mapping: + include_type_name: true + index: test_1,test_2 + type: doc + + - is_true: test_1.mappings.doc + - is_true: test_2.mappings.doc + +--- +"Get /index*/_mapping/{type}": + + - do: + indices.get_mapping: + include_type_name: true + index: '*2' + type: doc + + - is_true: test_2.mappings.doc + - is_false: test_1 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/20_missing_type.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/20_missing_type.yml new file mode 100644 index 0000000000000..f17fb6a595305 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/20_missing_type.yml @@ -0,0 +1,106 @@ +--- +"Non-existent type returns 404": + - do: + indices.create: + include_type_name: true + index: test_index + body: + mappings: + test_type: + properties: + text: + type: text + analyzer: whitespace + + - do: + catch: missing + indices.get_mapping: + include_type_name: true + index: test_index + type: not_test_type + + - match: { status: 404 } + - match: { error.reason: 'type[[not_test_type]] missing' } + +--- +"No type matching pattern returns 404": + - do: + indices.create: + include_type_name: true + index: test_index + body: + mappings: + test_type: + properties: + text: + type: text + analyzer: whitespace + + - do: + catch: missing + indices.get_mapping: + include_type_name: true + index: test_index + type: test*,not* + + - match: { status: 404 } + - match: { error: 'type [not*] missing' } + - is_true: test_index.mappings.test_type + +--- +"Existent and non-existent type returns 404 and the existing type": + - do: + indices.create: + include_type_name: true + index: test_index + body: + mappings: + test_type: + properties: + text: + type: text + analyzer: whitespace + + - do: + catch: missing + indices.get_mapping: + include_type_name: true + index: test_index + type: test_type,not_test_type + + - match: { status: 404 } + - match: { error: 'type [not_test_type] missing' } + - is_true: test_index.mappings.test_type + +--- +"Existent and non-existent types returns 404 and the existing type": + - do: + indices.create: + include_type_name: true + index: test_index + body: + mappings: + test_type: + properties: + text: + type: text + analyzer: whitespace + + - do: + catch: missing + indices.get_mapping: + include_type_name: true + index: test_index + type: test_type,not_test_type,another_not_test_type + + - match: { status: 404 } + - match: { error: 'types [another_not_test_type,not_test_type] missing' } + - is_true: test_index.mappings.test_type + +--- +"Type missing when no types exist": + - do: + catch: missing + indices.get_mapping: + include_type_name: true + type: not_test_type diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/30_missing_index.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/30_missing_index.yml new file mode 100644 index 0000000000000..5a7624265ecc9 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/30_missing_index.yml @@ -0,0 +1,35 @@ +--- +"Raise 404 when index doesn't exist": + - do: + catch: missing + indices.get_mapping: + index: test_index + +--- +"Index missing, no indexes": + - do: + catch: missing + indices.get_mapping: + index: test_index + +--- +"Index missing, ignore_unavailable=true": + - skip: + version: " - 6.99.99" + reason: ignore_unavailable was ignored in previous versions + - do: + indices.get_mapping: + index: test_index + ignore_unavailable: true + + - match: { '': {} } + +--- +"Index missing, ignore_unavailable=true, allow_no_indices=false": + - do: + catch: missing + indices.get_mapping: + index: test_index + ignore_unavailable: true + allow_no_indices: false + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/40_aliases.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/40_aliases.yml new file mode 100644 index 0000000000000..15a52b7b2db25 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/40_aliases.yml @@ -0,0 +1,25 @@ +--- +"Getting mapping for aliases should return the real index as key": + + - do: + indices.create: + index: test_index + body: + mappings: + properties: + text: + type: text + analyzer: whitespace + + - do: + indices.put_alias: + index: test_index + name: test_alias + + - do: + indices.get_mapping: + include_type_name: false + index: test_alias + + - match: {test_index.mappings.properties.text.type: text} + - match: {test_index.mappings.properties.text.analyzer: whitespace} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/50_wildcard_expansion.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/50_wildcard_expansion.yml new file mode 100644 index 0000000000000..d3f15b3292285 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/50_wildcard_expansion.yml @@ -0,0 +1,135 @@ +--- +setup: + - do: + indices.create: + index: test-xxx + body: + settings: + index: + number_of_replicas: 0 + mappings: + properties: + foo: + type: keyword + - do: + indices.create: + index: test-xxy + body: + settings: + index: + number_of_replicas: 0 + mappings: + properties: + foo2: + type: keyword + - do: + indices.create: + index: test-xyy + body: + settings: + index: + number_of_replicas: 0 + mappings: + properties: + foo3: + type: keyword + - do: + indices.create: + index: test-yyy + body: + settings: + index: + number_of_replicas: 0 + mappings: + properties: + foo4: + type: keyword + + - do: + cluster.health: + wait_for_status: green + + - do: + indices.close: + index: test-xyy + + - do: + cluster.health: + wait_for_status: green + +--- +"Get test-* with defaults": + + - do: + indices.get_mapping: + index: test-x* + + - is_true: test-xxx.mappings + - is_true: test-xxy.mappings + +--- +"Get test-* with wildcard_expansion=all": + + - do: + indices.get_mapping: + index: test-x* + expand_wildcards: all + + - is_true: test-xxx.mappings + - is_true: test-xxy.mappings + - is_true: test-xyy.mappings + +--- +"Get test-* with wildcard_expansion=open": + + - do: + indices.get_mapping: + index: test-x* + expand_wildcards: open + + - is_true: test-xxx.mappings + - is_true: test-xxy.mappings + +--- +"Get test-* with wildcard_expansion=closed": + + - do: + indices.get_mapping: + index: test-x* + expand_wildcards: closed + + - is_true: test-xyy.mappings + +--- +"Get test-* with wildcard_expansion=none": + - skip: + version: " - 6.99.99" + reason: allow_no_indices (defaults to true) was ignored in previous versions + - do: + indices.get_mapping: + index: test-x* + expand_wildcards: none + + - match: { '': {} } +--- +"Get test-* with wildcard_expansion=none allow_no_indices=false": + - skip: + version: " - 6.99.99" + reason: allow_no_indices was ignored in previous versions + - do: + catch: missing + indices.get_mapping: + index: test-x* + expand_wildcards: none + allow_no_indices: false +--- +"Get test-* with wildcard_expansion=open,closed": + + - do: + indices.get_mapping: + index: test-x* + expand_wildcards: open,closed + + - is_true: test-xxx.mappings + - is_true: test-xxy.mappings + - is_true: test-xyy.mappings diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/60_empty.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/60_empty.yml new file mode 100644 index 0000000000000..b5069295a1fa6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/60_empty.yml @@ -0,0 +1,18 @@ +--- +setup: + - do: + indices.create: + index: test_1 + + - do: + indices.create: + index: test_2 + +--- +"Check empty mapping when getting all mappings via /_mapping": + + - do: + indices.get_mapping: {} + + - match: { test_1.mappings: {}} + - match: { test_2.mappings: {}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/61_empty_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/61_empty_with_types.yml new file mode 100644 index 0000000000000..6da7f4a2c6946 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/61_empty_with_types.yml @@ -0,0 +1,20 @@ +--- +setup: + + - do: + indices.create: + index: test_1 + + - do: + indices.create: + index: test_2 + +--- +"Check empty mapping when getting all mappings via /_mapping": + + - do: + indices.get_mapping: + include_type_name: true + + - match: { test_1.mappings: {}} + - match: { test_2.mappings: {}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/70_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/70_mix_typeless_typeful.yml new file mode 100644 index 0000000000000..162a8d340d48a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/70_mix_typeless_typeful.yml @@ -0,0 +1,23 @@ +--- +"GET mapping with typeless API on an index that has types": + + - skip: + version: " - 6.99.99" + reason: include_type_name was introduced in 7.0.0 + + - do: + indices.create: # not using include_type_name: false on purpose + include_type_name: true + index: index + body: + mappings: + not_doc: + properties: + foo: + type: "keyword" + + - do: + indices.get_mapping: + index: index + + - match: { index.mappings.properties.foo.type: "keyword" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/10_basic.yml new file mode 100644 index 0000000000000..a50be32e82c6a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/10_basic.yml @@ -0,0 +1,173 @@ +--- +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_shards: 5 + number_of_replicas: 1 + - do: + indices.create: + index: test_2 + body: + settings: + number_of_shards: 3 + number_of_replicas: 0 + +--- +"Get /_settings": + + - do: + indices.get_settings: {} + + - match: { test_1.settings.index.number_of_shards: "5"} + - match: { test_1.settings.index.number_of_replicas: "1"} + - match: { test_2.settings.index.number_of_shards: "3"} + - match: { test_2.settings.index.number_of_replicas: "0"} + +--- +"Get /{index}/_settings": + + - do: + indices.get_settings: + index: test_1 + + - match: { test_1.settings.index.number_of_shards: "5"} + - match: { test_1.settings.index.number_of_replicas: "1"} + - is_false: test_2 + + +--- +"Get /{index}/_settings/_all": + + - do: + indices.get_settings: + index: test_1 + name: _all + + - match: { test_1.settings.index.number_of_shards: "5"} + - match: { test_1.settings.index.number_of_replicas: "1"} + - is_false: test_2 + +--- +"Get /{index}/_settings/*": + + - do: + indices.get_settings: + index: test_1 + name: '*' + + - match: { test_1.settings.index.number_of_shards: "5"} + - match: { test_1.settings.index.number_of_replicas: "1"} + - is_false: test_2 + +--- +"Get /{index}/_settings/{name}": + + - do: + indices.get_settings: + index: test_1 + name: index.number_of_shards + + - match: { test_1.settings.index.number_of_shards: "5"} + - is_false: test_1.settings.index.number_of_replicas + - is_false: test_2 + +--- +"Get /{index}/_settings/{name,name}": + + - do: + indices.get_settings: + index: test_1 + name: index.number_of_shards,index.number_of_replicas + + - match: { test_1.settings.index.number_of_shards: "5"} + - match: { test_1.settings.index.number_of_replicas: "1"} + - is_false: test_2 + +--- +"Get /{index}/_settings/{name*}": + + - do: + indices.get_settings: + index: test_1 + name: 'index.number_of_s*' + + - match: { test_1.settings.index.number_of_shards: "5"} + - is_false: test_1.settings.index.number_of_replicas + - is_false: test_2 + +--- +"Get /_settings/{name}": + + - do: + indices.get_settings: + name: index.number_of_shards + + - match: { test_1.settings.index.number_of_shards: "5"} + - match: { test_2.settings.index.number_of_shards: "3"} + - is_false: test_1.settings.index.number_of_replicas + - is_false: test_2.settings.index.number_of_replicas + +--- +"Get /_all/_settings/{name}": + + - do: + indices.get_settings: + index: _all + name: index.number_of_shards + + - match: { test_1.settings.index.number_of_shards: "5"} + - match: { test_2.settings.index.number_of_shards: "3"} + - is_false: test_1.settings.index.number_of_replicas + - is_false: test_2.settings.index.number_of_replicas + + +--- +"Get /*/_settings/{name}": + + - do: + indices.get_settings: + index: '*' + name: index.number_of_shards + + - match: { test_1.settings.index.number_of_shards: "5"} + - match: { test_2.settings.index.number_of_shards: "3"} + - is_false: test_1.settings.index.number_of_replicas + - is_false: test_2.settings.index.number_of_replicas + +--- +"Get /index,index/_settings/{name}": + + - do: + indices.get_settings: + index: test_1,test_2 + name: index.number_of_shards + + - match: { test_1.settings.index.number_of_shards: "5"} + - match: { test_2.settings.index.number_of_shards: "3"} + - is_false: test_1.settings.index.number_of_replicas + - is_false: test_2.settings.index.number_of_replicas + +--- +"Get /index*/_settings/{name}": + + - do: + indices.get_settings: + index: '*2' + name: index.number_of_shards + + - match: { test_2.settings.index.number_of_shards: "3"} + - is_false: test_1 + - is_false: test_2.settings.index.number_of_replicas + +--- +"Get /_settings with local flag": + + - do: + indices.get_settings: + local: true + + - is_true: test_1 + - is_true: test_2 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/20_aliases.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/20_aliases.yml new file mode 100644 index 0000000000000..da7678202ed34 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/20_aliases.yml @@ -0,0 +1,26 @@ +--- +"Getting settings for aliases should return the real index as key": + + - do: + indices.create: + index: test-index + body: + settings: + index: + refresh_interval: -1 + number_of_shards: 2 + number_of_replicas: 3 + + - do: + indices.put_alias: + index: test-index + name: test-alias + + - do: + indices.get_settings: + index: test-alias + + - match: { test-index.settings.index.number_of_replicas: "3" } + - match: { test-index.settings.index.number_of_shards: "2" } + - match: { test-index.settings.index.refresh_interval: "-1" } + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml new file mode 100644 index 0000000000000..2e3f4af03ebef --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml @@ -0,0 +1,28 @@ +--- +setup: + - do: + indices.create: + body: + settings: + index: + number_of_shards: 1 + number_of_replicas: 1 + index: test-index +--- +Test retrieval of default settings: + - skip: + version: " - 6.3.99" + reason: include_defaults will not work in mixed-mode clusters containing nodes pre-6.4 + - do: + indices.get_settings: + flat_settings: true + index: test-index + - is_false: + test-index.settings.index\.refresh_interval + - do: + indices.get_settings: + include_defaults: true + flat_settings: true + index: test-index + - match: + test-index.defaults.index\.refresh_interval: "1s" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/10_basic.yml new file mode 100644 index 0000000000000..c1aac94bf1d84 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/10_basic.yml @@ -0,0 +1,85 @@ +setup: + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0.0 + - do: + indices.put_template: + name: test + body: + index_patterns: test-* + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: + properties: + field: + type: keyword + +--- +"Get template": + + - do: + indices.get_template: + name: test + + - match: {test.index_patterns: ["test-*"]} + - match: {test.settings: {index: {number_of_shards: '1', number_of_replicas: '0'}}} + - match: {test.mappings: {properties: {field: {type: keyword}}}} + +--- +"Get template with no mappings": + + - do: + indices.put_template: + name: test_no_mappings + body: + index_patterns: test-* + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + indices.get_template: + name: test_no_mappings + + - match: {test_no_mappings.index_patterns: ["test-*"]} + - match: {test_no_mappings.settings: {index: {number_of_shards: '1', number_of_replicas: '0'}}} + - match: {test_no_mappings.mappings: {}} + +--- +"Get all templates": + + - do: + indices.put_template: + name: test2 + body: + index_patterns: test2-* + settings: + number_of_shards: 1 + + - do: + indices.get_template: {} + + - match: {test.index_patterns: ["test-*"]} + - match: {test2.index_patterns: ["test2-*"]} + +--- +"Get template with local flag": + + - do: + indices.get_template: + name: test + local: true + + - is_true: test + +--- +"Get template with flat settings and master timeout": + + - do: + indices.get_template: + name: test + flat_settings: true + master_timeout: 1m + + - match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/11_basic_with_types.yml new file mode 100644 index 0000000000000..0ecf304b1ce70 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/11_basic_with_types.yml @@ -0,0 +1,48 @@ +setup: + - do: + indices.put_template: + include_type_name: true + name: test + body: + index_patterns: test-* + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: + _doc: + properties: + field: + type: keyword + +--- +"Get template": + + - do: + indices.get_template: + include_type_name: true + name: test + + - match: {test.index_patterns: ["test-*"]} + - match: {test.settings: {index: {number_of_shards: '1', number_of_replicas: '0'}}} + - match: {test.mappings: {_doc: {properties: {field: {type: keyword}}}}} + +--- +"Get template with no mappings": + + - do: + indices.put_template: + name: test_no_mappings + body: + index_patterns: test-* + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + indices.get_template: + include_type_name: true + name: test_no_mappings + + - match: {test_no_mappings.index_patterns: ["test-*"]} + - match: {test_no_mappings.settings: {index: {number_of_shards: '1', number_of_replicas: '0'}}} + - match: {test_no_mappings.mappings: {}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/20_get_missing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/20_get_missing.yml new file mode 100644 index 0000000000000..2751f57dacb6c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/20_get_missing.yml @@ -0,0 +1,13 @@ +setup: + - do: + indices.delete_template: + name: '*' + ignore: 404 +--- +"Get missing template": + + - do: + catch: missing + indices.get_template: + name: test + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/10_basic.yml new file mode 100644 index 0000000000000..3d30f126cf671 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/10_basic.yml @@ -0,0 +1,121 @@ +--- +"Basic test for index open/close": + - do: + indices.create: + index: test_index + body: + settings: + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + indices.close: + index: test_index + - is_true: acknowledged + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + index: test_index + + - do: + indices.open: + index: test_index + - is_true: acknowledged + + - do: + cluster.health: + wait_for_status: green + + - do: + search: + rest_total_hits_as_int: true + index: test_index + +--- +"Open index with wait_for_active_shards set to all": + - skip: + version: " - 6.0.99" + reason: wait_for_active_shards parameter was added in 6.1.0 + + - do: + indices.create: + index: test_index + body: + settings: + number_of_replicas: 0 + + - do: + indices.close: + index: test_index + - is_true: acknowledged + + - do: + indices.open: + index: test_index + wait_for_active_shards: all + - is_true: acknowledged + - match: { acknowledged: true } + - match: { shards_acknowledged: true } + +--- +"Close index with wait_for_active_shards set to all": + - skip: + version: " - 7.1.99" + reason: "closed indices are replicated starting version 7.2.0" + + - do: + indices.create: + index: test_index + body: + settings: + number_of_replicas: 0 + + - do: + indices.close: + index: test_index + wait_for_active_shards: all + - is_true: acknowledged + - match: { acknowledged: true } + - match: { shards_acknowledged: true } +--- +"Close index response with result per index": + - skip: + version: " - 7.2.99" + reason: "close index response reports result per index starting version 7.3.0" + + - do: + indices.create: + index: index_1 + body: + settings: + number_of_replicas: 0 + + - do: + indices.create: + index: index_2 + body: + settings: + number_of_replicas: 0 + + - do: + indices.create: + index: index_3 + body: + settings: + number_of_replicas: 0 + + - do: + indices.close: + index: "index_*" + + - match: { acknowledged: true } + - match: { shards_acknowledged: true } + - match: { indices.index_1.closed: true } + - match: { indices.index_2.closed: true } + - match: { indices.index_3.closed: true } + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/20_multiple_indices.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/20_multiple_indices.yml new file mode 100644 index 0000000000000..bef5ea8a54651 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/20_multiple_indices.yml @@ -0,0 +1,104 @@ +setup: + - do: + indices.create: + index: test_index1 + body: + settings: + number_of_replicas: 0 + - do: + indices.create: + index: test_index2 + body: + settings: + number_of_replicas: 0 + - do: + indices.create: + index: test_index3 + body: + settings: + number_of_replicas: 0 + - do: + cluster.health: + wait_for_status: green + +--- +"All indices": + - do: + indices.close: + index: _all + - is_true: acknowledged + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + index: test_index2 + + - do: + indices.open: + index: _all + - is_true: acknowledged + + - do: + cluster.health: + wait_for_status: green + + - do: + search: + rest_total_hits_as_int: true + index: test_index2 + +--- +"Trailing wildcard": + - do: + indices.close: + index: test_* + - is_true: acknowledged + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + index: test_index2 + + - do: + indices.open: + index: test_* + - is_true: acknowledged + + - do: + cluster.health: + wait_for_status: green + + - do: + search: + rest_total_hits_as_int: true + index: test_index2 + +--- +"Only wildcard": + - do: + indices.close: + index: '*' + - is_true: acknowledged + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + index: test_index3 + + - do: + indices.open: + index: '*' + - is_true: acknowledged + + - do: + cluster.health: + wait_for_status: green + + - do: + search: + rest_total_hits_as_int: true + index: test_index3 + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/10_basic.yml new file mode 100644 index 0000000000000..dd0628ea993ee --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/10_basic.yml @@ -0,0 +1,82 @@ +--- +"Basic test for put alias": + + - do: + indices.create: + index: test_index + + - do: + indices.exists_alias: + name: test_alias + + - is_false: '' + + - do: + indices.put_alias: + index: test_index + name: test_alias + + - do: + indices.exists_alias: + name: test_alias + + - is_true: '' + + - do: + indices.get_alias: + name: test_alias + + - match: {test_index.aliases.test_alias: {}} + +--- +"Can't create alias with invalid characters": + + - do: + indices.create: + index: test_index + + - do: + catch: bad_request + indices.put_alias: + index: test_index + name: test_* + +--- +"Can't create alias with the same name as an index": + + - do: + indices.create: + index: test_index + - do: + indices.create: + index: foo + + - do: + catch: bad_request + indices.put_alias: + index: test_index + name: foo + +--- +"Can set is_write_index": + + - skip: + version: " - 6.3.99" + reason: "is_write_index is only available from 6.4.0 on" + + - do: + indices.create: + index: test_index + + - do: + indices.put_alias: + index: test_index + name: test_alias + body: + is_write_index: true + + - do: + indices.get_alias: + index: test_index + name: test_alias + - match: {test_index.aliases.test_alias: { 'is_write_index': true }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml new file mode 100644 index 0000000000000..bef57bbddf165 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml @@ -0,0 +1,116 @@ +--- +setup: +# create three indices + + - do: + indices.create: + index: test_index1 + - do: + indices.create: + index: test_index2 + - do: + indices.create: + index: foo + +--- +"put alias per index": + - do: + indices.put_alias: + index: test_index1 + name: alias + - do: + indices.put_alias: + index: test_index2 + name: alias + + - do: + indices.get_alias: + name: alias + + - match: {test_index1.aliases.alias: {}} + + - match: {test_index2.aliases.alias: {}} + + - is_false: foo + +--- +"put alias in _all index": + + - do: + indices.put_alias: + index: _all + name: alias + + - do: + indices.get_alias: + name: alias + + - match: {test_index1.aliases.alias: {}} + - match: {test_index2.aliases.alias: {}} + - match: {foo.aliases.alias: {}} + +--- +"put alias in * index": + + + - do: + indices.put_alias: + index: '*' + name: alias + + - do: + indices.get_alias: + name: alias + + - match: {test_index1.aliases.alias: {}} + - match: {test_index2.aliases.alias: {}} + - match: {foo.aliases.alias: {}} + +--- +"put alias prefix* index": + - do: + indices.put_alias: + index: "test_*" + name: alias + + - do: + indices.get_alias: + name: alias + + - match: {test_index1.aliases.alias: {}} + - match: {test_index2.aliases.alias: {}} + - is_false: foo + +--- +"put alias in list of indices": + - do: + indices.put_alias: + index: "test_index1,test_index2" + name: alias + + - do: + indices.get_alias: + name: alias + + - match: {test_index1.aliases.alias: {}} + - match: {test_index2.aliases.alias: {}} + - is_false: foo + +--- +"put alias with blank index": + + + - do: + catch: param + indices.put_alias: + name: alias + + +--- +"put alias with missing name": + + + - do: + catch: param + indices.put_alias: {} + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml new file mode 100644 index 0000000000000..338eaba8881c3 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml @@ -0,0 +1,129 @@ +--- +"Test Create and update mapping": + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0 + - do: + indices.create: + index: test_index + + - do: + indices.put_mapping: + index: test_index + body: + properties: + text1: + type: text + analyzer: whitespace + text2: + type: text + analyzer: whitespace + subfield.text3: + type: text + + - do: + indices.get_mapping: + index: test_index + + - match: {test_index.mappings.properties.text1.type: text} + - match: {test_index.mappings.properties.text1.analyzer: whitespace} + - match: {test_index.mappings.properties.text2.type: text} + - match: {test_index.mappings.properties.text2.analyzer: whitespace} + + - do: + indices.put_mapping: + index: test_index + body: + properties: + text1: + type: text + analyzer: whitespace + fields: + text_raw: + type: keyword + + + - do: + indices.get_mapping: + index: test_index + + - match: {test_index.mappings.properties.text1.type: text} + - match: {test_index.mappings.properties.subfield.properties.text3.type: text} + - match: {test_index.mappings.properties.text1.fields.text_raw.type: keyword} + +--- +"Create index with invalid mappings": + + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0 + - do: + indices.create: + index: test_index + - do: + catch: /illegal_argument_exception/ + indices.put_mapping: + index: test_index + body: + properties: + "": + type: keyword + +--- +"Put mappings with explicit _doc type": + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0 + + - do: + indices.create: + index: test_index + + - do: + catch: bad_request + indices.put_mapping: + index: test_index + body: + _doc: + properties: + field: + type: keyword + + - match: { error.type: "illegal_argument_exception" } + - match: { error.reason: "Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true." } + +--- +"Update per-field metadata": + + - skip: + version: " - 7.5.99" + reason: "Per-field meta was introduced in 7.6" + + - do: + indices.create: + index: test_index + body: + mappings: + properties: + foo: + type: keyword + meta: + bar: baz + + - do: + indices.put_mapping: + index: test_index + body: + properties: + foo: + type: keyword + meta: + baz: quux + + - do: + indices.get_mapping: + index: test_index + + - is_false: test_index.mappings.properties.foo.meta.bar + - match: { test_index.mappings.properties.foo.meta.baz: "quux" } + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/11_basic_with_types.yml new file mode 100644 index 0000000000000..5da9cd4bf707c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/11_basic_with_types.yml @@ -0,0 +1,74 @@ +--- +"Test Create and update mapping": + - do: + indices.create: + index: test_index + + - do: + indices.put_mapping: + include_type_name: true + index: test_index + type: test_type + body: + test_type: + properties: + text1: + type: text + analyzer: whitespace + text2: + type: text + analyzer: whitespace + subfield.text3: + type: text + + - do: + indices.get_mapping: + include_type_name: true + index: test_index + + - match: {test_index.mappings.test_type.properties.text1.type: text} + - match: {test_index.mappings.test_type.properties.text1.analyzer: whitespace} + - match: {test_index.mappings.test_type.properties.text2.type: text} + - match: {test_index.mappings.test_type.properties.text2.analyzer: whitespace} + + - do: + indices.put_mapping: + include_type_name: true + index: test_index + type: test_type + body: + test_type: + properties: + text1: + type: text + analyzer: whitespace + fields: + text_raw: + type: keyword + + + - do: + indices.get_mapping: + include_type_name: true + index: test_index + + - match: {test_index.mappings.test_type.properties.text1.type: text} + - match: {test_index.mappings.test_type.properties.subfield.properties.text3.type: text} + - match: {test_index.mappings.test_type.properties.text1.fields.text_raw.type: keyword} + +--- +"Create index with invalid mappings": + - do: + indices.create: + index: test_index + - do: + catch: /illegal_argument_exception/ + indices.put_mapping: + include_type_name: true + index: test_index + type: test_type + body: + test_type: + properties: + "": + type: keyword diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/20_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/20_mix_typeless_typeful.yml new file mode 100644 index 0000000000000..13cb3321841cf --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/20_mix_typeless_typeful.yml @@ -0,0 +1,83 @@ +--- +"PUT mapping with typeless API on an index that has types": + + - do: + indices.create: # not using include_type_name: false on purpose + include_type_name: true + index: index + body: + mappings: + not_doc: + properties: + foo: + type: "keyword" + + - do: + indices.put_mapping: + include_type_name: false + index: index + body: + properties: + bar: + type: "long" + + - do: + indices.get_mapping: + include_type_name: false + index: index + + - match: { index.mappings.properties.foo.type: "keyword" } + - match: { index.mappings.properties.bar.type: "long" } + + - do: + indices.put_mapping: + include_type_name: false + index: index + body: + properties: + foo: + type: "keyword" # also test no-op updates that trigger special logic wrt the mapping version + + - do: + catch: /the final mapping would have more than 1 type/ + indices.put_mapping: + include_type_name: true + index: index + type: some_other_type + body: + some_other_type: + properties: + bar: + type: "long" + + +--- +"PUT mapping with _doc on an index that has types": + + - skip: + version: " - 6.6.99" + reason: include_type_name is only supported as of 6.7 + + + - do: + indices.create: + include_type_name: true + index: index + body: + mappings: + my_type: + properties: + foo: + type: "keyword" + + - do: + catch: /the final mapping would have more than 1 type/ + indices.put_mapping: + include_type_name: true + index: index + type: _doc + body: + _doc: + properties: + bar: + type: "long" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml new file mode 100644 index 0000000000000..182ec017e0d30 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml @@ -0,0 +1,165 @@ +setup: + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0 + - do: + indices.create: + index: test_index1 + - do: + indices.create: + index: test_index2 + - do: + indices.create: + index: foo + + +--- +"put one mapping per index": + - do: + indices.put_mapping: + index: test_index1 + body: + properties: + text: + type: text + analyzer: whitespace + - do: + indices.put_mapping: + index: test_index2 + body: + properties: + text: + type: text + analyzer: whitespace + + + - do: + indices.get_mapping: {} + + - match: {test_index1.mappings.properties.text.type: text} + - match: {test_index1.mappings.properties.text.analyzer: whitespace} + + - match: {test_index2.mappings.properties.text.type: text} + - match: {test_index2.mappings.properties.text.analyzer: whitespace} + + - match: { foo.mappings: {} } + +--- +"put mapping in _all index": + + - do: + indices.put_mapping: + index: _all + body: + properties: + text: + type: text + analyzer: whitespace + + - do: + indices.get_mapping: {} + + - match: {test_index1.mappings.properties.text.type: text} + - match: {test_index1.mappings.properties.text.analyzer: whitespace} + + - match: {test_index2.mappings.properties.text.type: text} + - match: {test_index2.mappings.properties.text.analyzer: whitespace} + + - match: {foo.mappings.properties.text.type: text} + - match: {foo.mappings.properties.text.analyzer: whitespace} + +--- +"put mapping in * index": + - do: + indices.put_mapping: + index: "*" + body: + properties: + text: + type: text + analyzer: whitespace + + - do: + indices.get_mapping: {} + + - match: {test_index1.mappings.properties.text.type: text} + - match: {test_index1.mappings.properties.text.analyzer: whitespace} + + - match: {test_index2.mappings.properties.text.type: text} + - match: {test_index2.mappings.properties.text.analyzer: whitespace} + + - match: {foo.mappings.properties.text.type: text} + - match: {foo.mappings.properties.text.analyzer: whitespace} + +--- +"put mapping in prefix* index": + - do: + indices.put_mapping: + index: "test_index*" + body: + properties: + text: + type: text + analyzer: whitespace + + - do: + indices.get_mapping: {} + + - match: {test_index1.mappings.properties.text.type: text} + - match: {test_index1.mappings.properties.text.analyzer: whitespace} + + - match: {test_index2.mappings.properties.text.type: text} + - match: {test_index2.mappings.properties.text.analyzer: whitespace} + + - match: { foo.mappings: {} } + +--- +"put mapping in list of indices": + - do: + indices.put_mapping: + index: [test_index1, test_index2] + body: + properties: + text: + type: text + analyzer: whitespace + + - do: + indices.get_mapping: {} + + - match: {test_index1.mappings.properties.text.type: text} + - match: {test_index1.mappings.properties.text.analyzer: whitespace} + + - match: {test_index2.mappings.properties.text.type: text} + - match: {test_index2.mappings.properties.text.analyzer: whitespace} + + - match: { foo.mappings: {} } + +--- +"post a mapping with default analyzer twice": + + - do: + indices.put_mapping: + index: test_index1 + body: + dynamic: false + properties: + text: + analyzer: default + type: text + + - do: + indices.put_mapping: + index: test_index1 + body: + dynamic: false + properties: + text: + analyzer: default + type: text + + - do: + indices.get_mapping: {} + + - match: {test_index1.mappings.properties.text.type: text} + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options_with_types.yml new file mode 100644 index 0000000000000..6f9b6f7d9ceef --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options_with_types.yml @@ -0,0 +1,227 @@ +setup: + - do: + indices.create: + index: test_index1 + - do: + indices.create: + index: test_index2 + - do: + indices.create: + index: foo + + +--- +"put one mapping per index": + - do: + indices.put_mapping: + include_type_name: true + index: test_index1 + type: test_type + body: + test_type: + properties: + text: + type: text + analyzer: whitespace + - do: + indices.put_mapping: + include_type_name: true + index: test_index2 + type: test_type + body: + test_type: + properties: + text: + type: text + analyzer: whitespace + + + - do: + indices.get_mapping: + include_type_name: true + + - match: {test_index1.mappings.test_type.properties.text.type: text} + - match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace} + + - match: {test_index2.mappings.test_type.properties.text.type: text} + - match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace} + + - match: { foo.mappings: {} } + +--- +"put mapping in _all index": + + - do: + indices.put_mapping: + include_type_name: true + index: _all + type: test_type + body: + test_type: + properties: + text: + type: text + analyzer: whitespace + + - do: + indices.get_mapping: + include_type_name: true + + - match: {test_index1.mappings.test_type.properties.text.type: text} + - match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace} + + - match: {test_index2.mappings.test_type.properties.text.type: text} + - match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace} + + - match: {foo.mappings.test_type.properties.text.type: text} + - match: {foo.mappings.test_type.properties.text.analyzer: whitespace} + +--- +"put mapping in * index": + - do: + indices.put_mapping: + include_type_name: true + index: "*" + type: test_type + body: + test_type: + properties: + text: + type: text + analyzer: whitespace + + - do: + indices.get_mapping: + include_type_name: true + + - match: {test_index1.mappings.test_type.properties.text.type: text} + - match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace} + + - match: {test_index2.mappings.test_type.properties.text.type: text} + - match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace} + + - match: {foo.mappings.test_type.properties.text.type: text} + - match: {foo.mappings.test_type.properties.text.analyzer: whitespace} + +--- +"put mapping in prefix* index": + - do: + indices.put_mapping: + include_type_name: true + index: "test_index*" + type: test_type + body: + test_type: + properties: + text: + type: text + analyzer: whitespace + + - do: + indices.get_mapping: + include_type_name: true + + - match: {test_index1.mappings.test_type.properties.text.type: text} + - match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace} + + - match: {test_index2.mappings.test_type.properties.text.type: text} + - match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace} + + - match: { foo.mappings: {} } + +--- +"put mapping in list of indices": + - do: + indices.put_mapping: + include_type_name: true + index: [test_index1, test_index2] + type: test_type + body: + test_type: + properties: + text: + type: text + analyzer: whitespace + + - do: + indices.get_mapping: + include_type_name: true + + - match: {test_index1.mappings.test_type.properties.text.type: text} + - match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace} + + - match: {test_index2.mappings.test_type.properties.text.type: text} + - match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace} + + - match: { foo.mappings: {} } + +--- +"put mapping with blank index": + - do: + indices.put_mapping: + include_type_name: true + type: test_type + body: + test_type: + properties: + text: + type: text + analyzer: whitespace + + - do: + indices.get_mapping: + include_type_name: true + + - match: {test_index1.mappings.test_type.properties.text.type: text} + - match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace} + + - match: {test_index2.mappings.test_type.properties.text.type: text} + - match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace} + + - match: {foo.mappings.test_type.properties.text.type: text} + - match: {foo.mappings.test_type.properties.text.analyzer: whitespace} + +--- +"put mapping with missing type": + + + - do: + catch: param + indices.put_mapping: + include_type_name: true + +--- +"post a mapping with default analyzer twice": + + - do: + indices.put_mapping: + include_type_name: true + index: test_index1 + type: test_type + body: + test_type: + dynamic: false + properties: + text: + analyzer: default + type: text + + - do: + indices.put_mapping: + include_type_name: true + index: test_index1 + type: test_type + body: + test_type: + dynamic: false + properties: + text: + analyzer: default + type: text + + - do: + indices.get_mapping: + include_type_name: true + + - match: {test_index1.mappings.test_type.properties.text.type: text} + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/10_basic.yml new file mode 100644 index 0000000000000..043800916d19a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/10_basic.yml @@ -0,0 +1,123 @@ +setup: + - do: + indices.create: + index: test-index + body: + settings: + index: + number_of_replicas: 0 + +--- +"Test indices settings": + - do: + indices.get_settings: + index: test-index + flat_settings: true + + - match: + test-index.settings.index\.number_of_replicas: "0" + + - do: + indices.put_settings: + body: + number_of_replicas: 1 + + - do: + indices.get_settings: + flat_settings: false + + - match: + test-index.settings.index.number_of_replicas: "1" + +--- +"Test indices settings ignore_unavailable": + - do: + indices.put_settings: + ignore_unavailable: true + index: test-index, non-existing + body: + index.number_of_replicas: 1 + + - do: + indices.get_settings: {} + + - match: + test-index.settings.index.number_of_replicas: "1" + +--- +"Test indices settings allow_no_indices": + - do: + indices.put_settings: + expand_wildcards: open + allow_no_indices: true + index: non-existing-* + body: + number_of_replicas: 1 + +--- +"Test preserve_existing settings": + - do: + indices.put_settings: + index: test-index + body: + number_of_replicas: 0 + + - do: + indices.get_settings: + flat_settings: false + + - match: + test-index.settings.index.number_of_replicas: "0" + + - do: + indices.put_settings: + preserve_existing: true + index: test-index + body: + index.number_of_replicas: 1 + index.translog.durability: "async" + + - do: + indices.get_settings: + flat_settings: false + + - match: + test-index.settings.index.number_of_replicas: "0" + - match: + test-index.settings.index.translog.durability: "async" + + - do: + indices.close: + index: test-index + + - do: + indices.put_settings: + preserve_existing: true + index: test-index + body: + settings: + index.translog.durability: "request" + index.query_string.lenient: "true" + + - do: + indices.get_settings: + index: test-index + flat_settings: false + + - match: + test-index.settings.index.query_string.lenient: "true" + - match: + test-index.settings.index.translog.durability: "async" + + - do: + indices.open: + index: test-index + - do: + indices.get_settings: + index: test-index + flat_settings: false + + - match: + test-index.settings.index.query_string.lenient: "true" + - match: + test-index.settings.index.translog.durability: "async" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/11_reset.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/11_reset.yml new file mode 100644 index 0000000000000..ac5564fcd3ec4 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/11_reset.yml @@ -0,0 +1,25 @@ +--- +setup: + - do: + indices.create: + body: + settings: + index: + refresh_interval: 10s + index: test-index +--- +Test reset index settings: + - do: + indices.get_settings: + flat_settings: true + index: test-index + - match: + test-index.settings.index\.refresh_interval: "10s" + - do: + indices.put_settings: + body: + refresh_interval: null + - do: + indices.get_settings: + flat_settings: false + - is_false: test-index.settings.index\.refresh_interval diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/all_path_options.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/all_path_options.yml new file mode 100644 index 0000000000000..07f1956f0fcca --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/all_path_options.yml @@ -0,0 +1,113 @@ +setup: + - do: + indices.create: + index: test_index1 + - do: + indices.create: + index: test_index2 + - do: + indices.create: + index: foo + + +--- +"put settings per index": + - do: + indices.put_settings: + index: test_index1 + body: + refresh_interval: 1s + + - do: + indices.put_settings: + index: test_index2 + body: + refresh_interval: 1s + + + - do: + indices.get_settings: {} + + - match: {test_index1.settings.index.refresh_interval: 1s} + - match: {test_index2.settings.index.refresh_interval: 1s} + - is_false: foo.settings.index.refresh_interval + +--- +"put settings in _all index": + - do: + indices.put_settings: + index: _all + body: + refresh_interval: 1s + + - do: + indices.get_settings: {} + + - match: {test_index1.settings.index.refresh_interval: 1s} + - match: {test_index2.settings.index.refresh_interval: 1s} + - match: {foo.settings.index.refresh_interval: 1s} + +--- +"put settings in * index": + - do: + indices.put_settings: + index: '*' + body: + refresh_interval: 1s + + - do: + indices.get_settings: {} + + - match: {test_index1.settings.index.refresh_interval: 1s} + - match: {test_index2.settings.index.refresh_interval: 1s} + - match: {foo.settings.index.refresh_interval: 1s} + + +--- +"put settings in prefix* index": + - do: + indices.put_settings: + index: 'test*' + body: + refresh_interval: 1s + + - do: + indices.get_settings: {} + + - match: {test_index1.settings.index.refresh_interval: 1s} + - match: {test_index2.settings.index.refresh_interval: 1s} + - is_false: foo.settings.index.refresh_interval + +--- +"put settings in list of indices": + - skip: + version: "all" + reason: list of indices not implemented yet + - do: + indices.put_settings: + index: test_index1, test_index2 + body: + refresh_interval: 1s + + - do: + indices.get_settings: {} + + - match: {test_index1.settings.index.refresh_interval: 1s} + - match: {test_index2.settings.index.refresh_interval: 1s} + - is_false: foo.settings.index.refresh_interval + + +--- +"put settings in blank index": + - do: + indices.put_settings: + body: + refresh_interval: 1s + + - do: + indices.get_settings: {} + + - match: {test_index1.settings.index.refresh_interval: 1s} + - match: {test_index2.settings.index.refresh_interval: 1s} + - match: {foo.settings.index.refresh_interval: 1s} + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/10_basic.yml new file mode 100644 index 0000000000000..3850ba4150b4f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/10_basic.yml @@ -0,0 +1,261 @@ +--- +"Put template": + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0.0 + + - do: + indices.put_template: + name: test + body: + index_patterns: test-* + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: + properties: + field: + type: keyword + + - do: + indices.get_template: + name: test + flat_settings: true + + - match: {test.index_patterns: ["test-*"]} + - match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} + - match: {test.mappings: {properties: {field: {type: keyword}}}} + +--- +"Put multiple template": + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0.0 + + - do: + indices.put_template: + name: test + body: + index_patterns: [test-*, test2-*] + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: + properties: + field: + type: text + + - do: + indices.get_template: + name: test + flat_settings: true + + - match: {test.index_patterns: ["test-*", "test2-*"]} + - match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} + - match: {test.mappings: {properties: {field: {type: text}}}} + +--- +"Put template with empty mappings": + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0.0 + + - do: + indices.put_template: + name: test + body: + index_patterns: test-* + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: {} + + - do: + indices.get_template: + name: test + flat_settings: true + + - match: {test.mappings: {}} + +--- +"Put template with aliases": + + - do: + indices.put_template: + name: test + body: + index_patterns: test-* + aliases: + test_alias: {} + test_blias: { routing: b } + test_clias: { filter: { term: { user: kimchy }}} + + - do: + indices.get_template: + name: test + + - match: { test.index_patterns: ["test-*"] } + - length: { test.aliases: 3 } + - is_true: test.aliases.test_alias + - match: { test.aliases.test_blias.index_routing: "b" } + - match: { test.aliases.test_blias.search_routing: "b" } + - match: { test.aliases.test_clias.filter.term.user: "kimchy" } + +--- +"Put template create": + + - do: + indices.put_template: + name: test + create: true + body: + index_patterns: test-* + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + indices.get_template: + name: test + flat_settings: true + + - match: {test.index_patterns: ["test-*"]} + - match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} + + - do: + catch: bad_request + indices.put_template: + name: test + create: true + body: + index_patterns: test-* + settings: + number_of_shards: 1 + number_of_replicas: 0 + +--- +"Test Put Versioned Template": + + - do: + indices.put_template: + name: "my_template" + body: > + { + "version": 10, + "index_patterns": "*", + "settings": { "number_of_shards": 1 } + } + - match: { acknowledged: true } + + - do: + indices.get_template: + name: "my_template" + - match: { my_template.version: 10 } + + # Lower version + - do: + indices.put_template: + name: "my_template" + body: > + { + "version": 9, + "index_patterns": "*", + "settings": { "number_of_shards": 1 } + } + - match: { acknowledged: true } + + - do: + indices.get_template: + name: "my_template" + - match: { my_template.version: 9 } + + # Higher version + - do: + indices.put_template: + name: "my_template" + body: > + { + "version": 6789, + "index_patterns": "*", + "settings": { "number_of_shards": 1 } + } + - match: { acknowledged: true } + + - do: + indices.get_template: + name: "my_template" + - match: { my_template.version: 6789 } + + # No version + - do: + indices.put_template: + name: "my_template" + body: > + { + "index_patterns": "*", + "settings": { "number_of_shards": 1 } + } + - match: { acknowledged: true } + + - do: + indices.get_template: + name: "my_template" + - is_false: my_template.version + + # Coming back with a version + - do: + indices.put_template: + name: "my_template" + body: > + { + "version": 5385, + "index_patterns": "*", + "settings": { "number_of_shards": 1 } + } + - match: { acknowledged: true } + + - do: + indices.get_template: + name: "my_template" + - match: { my_template.version: 5385 } + + # Able to delete the versioned template + - do: + indices.delete_template: + name: "my_template" + - match: { acknowledged: true } + + - do: + catch: missing + indices.get_template: + name: "my_template" + +--- +"Put index template without index_patterns": + + - do: + catch: /index patterns are missing/ + indices.put_template: + name: test + body: {} + +--- +"Put template with explicit _doc type": + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0 + + - do: + catch: bad_request + indices.put_template: + name: test + body: + index_patterns: test-* + mappings: + _doc: + properties: + field: + type: keyword + + - match: { error.type: "illegal_argument_exception" } + - match: { error.reason: "The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true." } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/11_basic_with_types.yml new file mode 100644 index 0000000000000..fde28db3c691d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/11_basic_with_types.yml @@ -0,0 +1,74 @@ +--- +"Put template": + - do: + indices.put_template: + include_type_name: true + name: test + body: + index_patterns: test-* + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: + _doc: + properties: + field: + type: keyword + + - do: + indices.get_template: + include_type_name: true + name: test + flat_settings: true + + - match: {test.index_patterns: ["test-*"]} + - match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} + - match: {test.mappings: {_doc: {properties: {field: {type: keyword}}}}} + +--- +"Put multiple template": + - do: + indices.put_template: + include_type_name: true + name: test + body: + index_patterns: [test-*, test2-*] + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: + _doc: + properties: + field: + type: text + + - do: + indices.get_template: + include_type_name: true + name: test + flat_settings: true + + - match: {test.index_patterns: ["test-*", "test2-*"]} + - match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} + - match: {test.mappings: {_doc: {properties: {field: {type: text}}}}} + +--- +"Put template with empty mappings": + - do: + indices.put_template: + include_type_name: true + name: test + body: + index_patterns: test-* + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: {} + + - do: + indices.get_template: + include_type_name: true + name: test + flat_settings: true + + - match: {test.mappings: {}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.recovery/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.recovery/10_basic.yml new file mode 100644 index 0000000000000..4806601cec263 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.recovery/10_basic.yml @@ -0,0 +1,157 @@ +--- +"Indices recovery test": + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + indices.recovery: + index: [test_1] + human: true + + - match: { test_1.shards.0.type: "EMPTY_STORE" } + - match: { test_1.shards.0.stage: "DONE" } + - match: { test_1.shards.0.primary: true } + - match: { test_1.shards.0.start_time: /^2\d\d\d-.+/ } + - match: { test_1.shards.0.target.ip: /^\d+\.\d+\.\d+\.\d+$/ } + - gte: { test_1.shards.0.index.files.total: 0 } + - gte: { test_1.shards.0.index.files.reused: 0 } + - gte: { test_1.shards.0.index.files.recovered: 0 } + - match: { test_1.shards.0.index.files.percent: /^\d+\.\d\%$/ } + - gte: { test_1.shards.0.index.size.total_in_bytes: 0 } + - gte: { test_1.shards.0.index.size.reused_in_bytes: 0 } + - gte: { test_1.shards.0.index.size.recovered_in_bytes: 0 } + - match: { test_1.shards.0.index.size.percent: /^\d+\.\d\%$/ } + - gte: { test_1.shards.0.index.source_throttle_time_in_millis: 0 } + - gte: { test_1.shards.0.index.target_throttle_time_in_millis: 0 } + - gte: { test_1.shards.0.translog.recovered: 0 } + - gte: { test_1.shards.0.translog.total: -1 } + - gte: { test_1.shards.0.translog.total_on_start: 0 } + - gte: { test_1.shards.0.translog.total_time_in_millis: 0 } + - gte: { test_1.shards.0.verify_index.check_index_time_in_millis: 0 } + - gte: { test_1.shards.0.verify_index.total_time_in_millis: 0 } +--- +"Indices recovery test for closed index": + - skip: + version: " - 7.1.99" + reason: closed indices are replicated starting version 7.2.0 + + - do: + indices.create: + index: test_2 + body: + settings: + index: + number_of_replicas: 0 + + - do: + indices.close: + index: test_2 + - is_true: acknowledged + + - do: + cluster.health: + index: test_2 + wait_for_status: green + + - do: + indices.recovery: + index: [test_2] + human: true + + - match: { test_2.shards.0.type: "EXISTING_STORE" } + - match: { test_2.shards.0.stage: "DONE" } + - match: { test_2.shards.0.primary: true } + - match: { test_2.shards.0.start_time: /^2\d\d\d-.+/ } + - match: { test_2.shards.0.target.ip: /^\d+\.\d+\.\d+\.\d+$/ } + - gte: { test_2.shards.0.index.files.total: 0 } + - gte: { test_2.shards.0.index.files.reused: 0 } + - gte: { test_2.shards.0.index.files.recovered: 0 } + - match: { test_2.shards.0.index.files.percent: /^\d+\.\d\%$/ } + - gte: { test_2.shards.0.index.size.total_in_bytes: 0 } + - gte: { test_2.shards.0.index.size.reused_in_bytes: 0 } + - gte: { test_2.shards.0.index.size.recovered_in_bytes: 0 } + - match: { test_2.shards.0.index.size.percent: /^\d+\.\d\%$/ } + - gte: { test_2.shards.0.index.source_throttle_time_in_millis: 0 } + - gte: { test_2.shards.0.index.target_throttle_time_in_millis: 0 } + - gte: { test_2.shards.0.translog.recovered: 0 } + - gte: { test_2.shards.0.translog.total: 0 } + - gte: { test_2.shards.0.translog.total_on_start: 0 } + - gte: { test_2.shards.0.translog.total_time_in_millis: 0 } + - gte: { test_2.shards.0.verify_index.check_index_time_in_millis: 0 } + - gte: { test_2.shards.0.verify_index.total_time_in_millis: 0 } +--- +"Indices recovery test index name not matching": + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + + catch: missing + indices.recovery: + index: [foobar] + +--- +"Indices recovery test, wildcard not matching any index": + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + indices.recovery: + index: [v*] + + - match: { $body: {} } +--- +"Indices recovery test with detailed parameter": + - skip: + version: " - 7.2.99" + reason: bug with detailed parameter fixed in 7.3 + + - do: + indices.create: + index: test_3 + body: + settings: + index: + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + indices.recovery: + index: [test_3] + human: true + detailed: true + + - match: { test_3.shards.0.index.files.details: [] } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.refresh/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.refresh/10_basic.yml new file mode 100644 index 0000000000000..6e493a0cce936 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.refresh/10_basic.yml @@ -0,0 +1,58 @@ +--- +setup: + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_replicas: 0 + number_of_shards: 5 + + - do: + indices.create: + index: test_2 + body: + settings: + index: + number_of_replicas: 0 + number_of_shards: 5 + + - do: + cluster.health: + wait_for_status: green + +--- +"Indices refresh test _all": + + - do: + indices.refresh: + index: [_all] + + - match: { _shards.total: 10 } + - match: { _shards.successful: 10 } + - match: { _shards.failed: 0 } + +--- +"Indices refresh test empty array": + + + - do: + indices.refresh: + index: [] + + - match: { _shards.total: 10 } + - match: { _shards.successful: 10 } + - match: { _shards.failed: 0 } + +--- +"Indices refresh test no-match wildcard": + + - do: + indices.refresh: + index: [bla*] + + - match: { _shards.total: 0 } + - match: { _shards.successful: 0 } + - match: { _shards.failed: 0 } + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/10_basic.yml new file mode 100644 index 0000000000000..342adced0640d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/10_basic.yml @@ -0,0 +1,155 @@ +--- +"Rollover index via API": + + + # create index with alias + - do: + indices.create: + index: logs-1 + wait_for_active_shards: 1 + body: + aliases: + logs_index: {} + logs_search: {} + + # index document + - do: + index: + index: logs-1 + type: test + id: "1" + body: { "foo": "hello world" } + # make this doc visible in index stats + refresh: true + + - do: + get: + index: logs_search + type: test + id: "1" + + - match: { _index: logs-1 } + - match: { _type: test } + - match: { _id: "1" } + - match: { _source: { foo: "hello world" } } + + # perform alias rollover + - do: + indices.rollover: + alias: "logs_search" + wait_for_active_shards: 1 + body: + conditions: + max_docs: 1 + + - match: { old_index: logs-1 } + - match: { new_index: logs-000002 } + - match: { rolled_over: true } + - match: { dry_run: false } + - match: { conditions: { "[max_docs: 1]": true } } + + # ensure new index is created + - do: + indices.exists: + index: logs-000002 + + - is_true: '' + + # index into new index + - do: + index: + index: logs-000002 + type: test + id: "2" + body: { "foo": "hello world" } + + - do: + indices.refresh: {} + + # check alias points to the new index + - do: + search: + rest_total_hits_as_int: true + index: logs_search + + - match: { hits.total: 1 } + - match: { hits.hits.0._index: "logs-000002"} + +--- +"Rollover no condition matched": + # create index with alias + - do: + indices.create: + index: logs-1 + wait_for_active_shards: 1 + body: + aliases: + logs_index: {} + logs_search: {} + + # run again and verify results without rolling over + - do: + indices.rollover: + alias: "logs_search" + wait_for_active_shards: 1 + body: + conditions: + max_docs: 1 + + - match: { old_index: logs-1 } + - match: { new_index: logs-000002 } + - match: { rolled_over: false } + - match: { dry_run: false } + - match: { conditions: { "[max_docs: 1]": false } } + +--- +"Rollover with dry-run but target index exists": + + # create index with alias + - do: + indices.create: + index: logs-1 + wait_for_active_shards: 1 + body: + aliases: + logs_index: {} + logs_search: {} + + - do: + indices.create: + index: logs-000002 + + - do: + # index_already_exists_exception was renamed to resource_arleady_exists_exception in 6.0 + catch: /(index|resource)_already_exists_exception/ + indices.rollover: + dry_run: true + alias: "logs_search" + wait_for_active_shards: 1 + body: + conditions: + max_docs: 1 + + # also do it without dry_run + - do: + # index_already_exists_exception was renamed to resource_arleady_exists_exception in 6.0 + catch: /(index|resource)_already_exists_exception/ + indices.rollover: + dry_run: false + alias: "logs_search" + wait_for_active_shards: 1 + body: + conditions: + max_docs: 1 + + - do: + catch: /invalid_index_name_exception/ + indices.rollover: + new_index: invalid|index|name + dry_run: true + alias: "logs_search" + wait_for_active_shards: 1 + body: + conditions: + max_docs: 1 + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml new file mode 100644 index 0000000000000..ec9fabe02595d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml @@ -0,0 +1,57 @@ +--- +"Max docs rollover conditions matches only primary shards": + - skip: + version: "- 5.4.1" + reason: "matching docs changed from all shards to primary shards" + + # create index with alias and replica + - do: + indices.create: + index: logs-1 + wait_for_active_shards: 1 + body: + aliases: + logs_search: {} + + # index first document and wait for refresh + - do: + index: + index: logs-1 + type: test + id: "1" + body: { "foo": "hello world" } + refresh: true + + # perform alias rollover with no result + - do: + indices.rollover: + alias: "logs_search" + wait_for_active_shards: 1 + body: + conditions: + max_docs: 2 + + - match: { conditions: { "[max_docs: 2]": false } } + - match: { rolled_over: false } + + # index second document and wait for refresh + - do: + index: + index: logs-1 + type: test + id: "2" + body: { "foo": "hello world" } + refresh: true + + # perform alias rollover + - do: + indices.rollover: + alias: "logs_search" + wait_for_active_shards: 1 + body: + conditions: + max_docs: 2 + + - match: { conditions: { "[max_docs: 2]": true } } + - match: { rolled_over: true } + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/30_max_size_condition.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/30_max_size_condition.yml new file mode 100644 index 0000000000000..6e4df0f292915 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/30_max_size_condition.yml @@ -0,0 +1,60 @@ +--- +"Rollover with max_size condition": + + - skip: + version: " - 6.0.99" + reason: max_size condition is introduced in 6.1.0 + + # create index with alias and replica + - do: + indices.create: + index: logs-1 + wait_for_active_shards: 1 + body: + aliases: + logs_search: {} + + # index a document + - do: + index: + index: logs-1 + type: doc + id: "1" + body: { "foo": "hello world" } + refresh: true + + # perform alias rollover with a large max_size, no action. + - do: + indices.rollover: + alias: "logs_search" + wait_for_active_shards: 1 + body: + conditions: + max_size: 100mb + + - match: { conditions: { "[max_size: 100mb]": false } } + - match: { rolled_over: false } + + # perform alias rollover with a small max_size, got action. + - do: + indices.rollover: + alias: "logs_search" + wait_for_active_shards: 1 + body: + conditions: + max_size: 10b + + - match: { conditions: { "[max_size: 10b]": true } } + - match: { rolled_over: true } + + # perform alias rollover on an empty index, no action. + - do: + indices.rollover: + alias: "logs_search" + wait_for_active_shards: 1 + body: + conditions: + max_size: 1b + + - match: { conditions: { "[max_size: 1b]": false } } + - match: { rolled_over: false } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/40_mapping.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/40_mapping.yml new file mode 100644 index 0000000000000..47b004326a457 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/40_mapping.yml @@ -0,0 +1,72 @@ +--- +"Typeless mapping": + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0.0 + + - do: + indices.create: + index: logs-1 + body: + aliases: + logs_search: {} + + # index first document and wait for refresh + - do: + index: + index: logs-1 + id: "1" + body: { "foo": "hello world" } + refresh: true + + # index second document and wait for refresh + - do: + index: + index: logs-1 + id: "2" + body: { "foo": "hello world" } + refresh: true + + # perform alias rollover with new typeless mapping + - do: + indices.rollover: + alias: "logs_search" + body: + conditions: + max_docs: 2 + mappings: + properties: + foo2: + type: keyword + + - match: { conditions: { "[max_docs: 2]": true } } + - match: { rolled_over: true } + +--- +"Mappings with explicit _doc type": + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0 + + - do: + indices.create: + index: logs-1 + body: + aliases: + logs_search: {} + + - do: + catch: bad_request + indices.rollover: + alias: "logs_search" + body: + conditions: + max_docs: 2 + mappings: + _doc: + properties: + field: + type: keyword + + - match: { error.caused_by.type: "illegal_argument_exception" } + - match: { error.caused_by.reason: "The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true." } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/41_mapping_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/41_mapping_with_types.yml new file mode 100644 index 0000000000000..36389f3ce8bba --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/41_mapping_with_types.yml @@ -0,0 +1,47 @@ +--- +"Typeless mapping": + - skip: + version: " - 6.99.99" + reason: include_type_name defaults to true before 7.0.0 + + - do: + indices.create: + index: logs-1 + body: + aliases: + logs_search: {} + + # index first document and wait for refresh + - do: + index: + index: logs-1 + type: test + id: "1" + body: { "foo": "hello world" } + refresh: true + + # index second document and wait for refresh + - do: + index: + index: logs-1 + type: test + id: "2" + body: { "foo": "hello world" } + refresh: true + + # perform alias rollover with new typeless mapping + - do: + indices.rollover: + include_type_name: true + alias: "logs_search" + body: + conditions: + max_docs: 2 + mappings: + _doc: + properties: + foo2: + type: keyword + + - match: { conditions: { "[max_docs: 2]": true } } + - match: { rolled_over: true } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.segments/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.segments/10_basic.yml new file mode 100644 index 0000000000000..37602774474a1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.segments/10_basic.yml @@ -0,0 +1,74 @@ +--- +"no segments test": + - do: + indices.segments: + allow_no_indices: true + + - match: { _shards.total: 0} + - match: { indices: {}} + + - do: + catch: missing + indices.segments: + allow_no_indices: false + +--- +"basic segments test": + + - do: + indices.create: + index: index1 + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + - do: + index: + index: index1 + type: type + body: { foo: bar } + refresh: true + + - do: + cluster.health: + wait_for_status: green + + - do: + indices.segments: + index: index1 + + - match: { _shards.total: 1} + - match: { indices.index1.shards.0.0.routing.primary: true} + - match: { indices.index1.shards.0.0.segments._0.num_docs: 1} + +--- +"closed segments test": + - do: + indices.create: + index: index1 + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + - do: + index: + index: index1 + type: type + body: { foo: bar } + refresh: true + + - do: + indices.close: + index: index1 + + - do: + catch: bad_request + indices.segments: + index: index1 + + - do: + indices.segments: + index: index1 + ignore_unavailable: true + + - match: { _shards.total: 0} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shard_stores/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shard_stores/10_basic.yml new file mode 100644 index 0000000000000..db90bf29624a1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shard_stores/10_basic.yml @@ -0,0 +1,82 @@ +--- +"no indices test": + - do: + indices.shard_stores: + allow_no_indices: true + + - match: { indices: {}} + + - do: + catch: missing + indices.shard_stores: + allow_no_indices: false + +--- +"basic index test": + + - do: + indices.create: + index: index1 + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + - do: + index: + index: index1 + type: type + body: { foo: bar } + refresh: true + + - do: + cluster.health: + wait_for_status: green + + - do: + indices.shard_stores: + index: index1 + status: "green" + + - match: { indices.index1.shards.0.stores.0.allocation: "primary" } + +--- +"multiple indices test": + + - do: + indices.create: + index: index1 + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + - do: + indices.create: + index: index2 + body: + settings: + number_of_shards: "2" + number_of_replicas: "0" + - do: + index: + index: index1 + type: type + body: { foo: bar } + refresh: true + - do: + index: + index: index2 + type: type + body: { foo: bar } + refresh: true + - do: + cluster.health: + wait_for_status: green + + - do: + indices.shard_stores: + status: "green" + + - match: { indices.index1.shards.0.stores.0.allocation: "primary" } + - match: { indices.index2.shards.0.stores.0.allocation: "primary" } + - match: { indices.index2.shards.1.stores.0.allocation: "primary" } + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/10_basic.yml new file mode 100644 index 0000000000000..41c851b71cc6c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/10_basic.yml @@ -0,0 +1,83 @@ +--- +"Shrink index via API": + - skip: + version: " - 6.9.99" + reason: expects warnings that pre-7.0.0 will not send + features: [warnings, arbitrary_key] + + # creates an index with one document solely allocated on a particular data node + # and shrinks it into a new index with a single shard + # we don't do the relocation to a single node after the index is created + # here since in a mixed version cluster we can't identify + # which node is the one with the highest version and that is the only one that can safely + # be used to shrink the index. + + - do: + nodes.info: + node_id: data:true + - set: + nodes._arbitrary_key_: node_id + + - do: + indices.create: + index: source + wait_for_active_shards: 1 + body: + settings: + # ensure everything is allocated on the same data node + index.routing.allocation.include._id: $node_id + index.number_of_shards: 2 + index.number_of_replicas: 0 + - do: + index: + index: source + id: "1" + body: { "foo": "hello world" } + + - do: + get: + index: source + id: "1" + + - match: { _index: source } + - match: { _type: _doc } + - match: { _id: "1" } + - match: { _source: { foo: "hello world" } } + + # make it read-only + - do: + indices.put_settings: + index: source + body: + index.blocks.write: true + index.number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + index: source + + # now we do the actual shrink + - do: + indices.shrink: + index: "source" + target: "target" + wait_for_active_shards: 1 + master_timeout: 10s + body: + settings: + index.number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + get: + index: target + id: "1" + + - match: { _index: target } + - match: { _type: _doc } + - match: { _id: "1" } + - match: { _source: { foo: "hello world" } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml new file mode 100644 index 0000000000000..dec0760fc6b19 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml @@ -0,0 +1,74 @@ +--- +"Shrink index ignores target template mapping": + - skip: + version: " - 6.9.99" + reason: expects warnings that pre-7.0.0 will not send + features: [warnings, arbitrary_key] + + - do: + nodes.info: + node_id: data:true + - set: + nodes._arbitrary_key_: node_id + + # create index + - do: + indices.create: + index: source + wait_for_active_shards: 1 + body: + settings: + # ensure everything is allocated on a single node + index.routing.allocation.include._id: $node_id + index.number_of_shards: 2 + index.number_of_replicas: 0 + mappings: + properties: + count: + type: text + + # index document + - do: + index: + index: source + id: "1" + body: { "count": "1" } + + # create template matching shrink target + - do: + indices.put_template: + name: tpl1 + body: + index_patterns: targ* + mappings: + properties: + count: + type: integer + + # make it read-only + - do: + indices.put_settings: + index: source + body: + index.blocks.write: true + index.number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + index: source + + # now we do the actual shrink + - do: + indices.shrink: + index: "source" + target: "target" + wait_for_active_shards: 1 + master_timeout: 10s + body: + settings: + index.number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml new file mode 100644 index 0000000000000..7fc73ef8fd017 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml @@ -0,0 +1,105 @@ +--- +"Copy settings during shrink index": + - skip: + version: " - 6.9.99" + reason: expects warnings that pre-7.0.0 will not send + features: [warnings, arbitrary_key] + + - do: + nodes.info: + node_id: data:true + - set: + nodes._arbitrary_key_: node_id + + - do: + indices.create: + index: source + wait_for_active_shards: 1 + body: + settings: + # ensure everything is allocated on the same node + index.routing.allocation.include._id: $node_id + index.number_of_shards: 2 + index.number_of_replicas: 0 + index.merge.scheduler.max_merge_count: 4 + + # make it read-only + - do: + indices.put_settings: + index: source + body: + index.blocks.write: true + index.number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + index: source + + # now we do a actual shrink and copy settings + - do: + indices.shrink: + index: "source" + target: "copy-settings-target" + wait_for_active_shards: 1 + master_timeout: 10s + copy_settings: true + body: + settings: + index.number_of_replicas: 0 + index.merge.scheduler.max_thread_count: 2 + warnings: + - "parameter [copy_settings] is deprecated and will be removed in 8.0.0" + + - do: + cluster.health: + wait_for_status: green + + - do: + indices.get_settings: + index: "copy-settings-target" + + # settings should be copied + - match: { copy-settings-target.settings.index.merge.scheduler.max_merge_count: "4" } + - match: { copy-settings-target.settings.index.merge.scheduler.max_thread_count: "2" } + - match: { copy-settings-target.settings.index.blocks.write: "true" } + - match: { copy-settings-target.settings.index.routing.allocation.include._id: $node_id } + + # now we do a actual shrink and copy settings (by default) + - do: + indices.shrink: + index: "source" + target: "default-copy-settings-target" + wait_for_active_shards: 1 + master_timeout: 10s + body: + settings: + index.number_of_replicas: 0 + index.merge.scheduler.max_thread_count: 2 + + - do: + cluster.health: + wait_for_status: green + + - do: + indices.get_settings: + index: "default-copy-settings-target" + + # settings should be copied + - match: { default-copy-settings-target.settings.index.merge.scheduler.max_merge_count: "4" } + - match: { default-copy-settings-target.settings.index.merge.scheduler.max_thread_count: "2" } + - match: { default-copy-settings-target.settings.index.blocks.write: "true" } + - match: { default-copy-settings-target.settings.index.routing.allocation.include._id: $node_id } + + # now we do a actual shrink and try to set no copy settings + - do: + catch: /illegal_argument_exception/ + indices.shrink: + index: "source" + target: "explicit-no-copy-settings-target" + wait_for_active_shards: 1 + master_timeout: 10s + copy_settings: false + body: + settings: + index.number_of_replicas: 0 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.sort/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.sort/10_basic.yml new file mode 100644 index 0000000000000..b9089689b0cf1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.sort/10_basic.yml @@ -0,0 +1,158 @@ +--- +"Index Sort": + + - do: + indices.create: + index: test + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + index.sort.field: rank + mappings: + properties: + rank: + type: integer + + - do: + index: + index: test + id: "1" + body: { "rank": 4 } + + - do: + index: + index: test + id: "2" + body: { "rank": 1 } + + - do: + index: + index: test + id: "3" + body: { "rank": 3 } + + - do: + index: + index: test + id: "4" + body: { "rank": 2 } + + - do: + indices.refresh: + index: test + + - do: + index: + index: test + id: "5" + body: { "rank": 8 } + + - do: + index: + index: test + id: "6" + body: { "rank": 6 } + + - do: + index: + index: test + id: "7" + body: { "rank": 5 } + + - do: + index: + index: test + id: "8" + body: { "rank": 7 } + + - do: + index: + index: test + id: "8" + body: { "rank": 7 } + + - do: + indices.refresh: + index: test + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + sort: ["rank"] + size: 1 + + - match: {hits.total: 8 } + - length: {hits.hits: 1 } + - match: {hits.hits.0._id: "2" } + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + sort: ["rank"] + query: {"range": { "rank": { "from": 0 } } } + track_total_hits: false + size: 1 + + - match: {hits.total: -1 } + - length: {hits.hits: 1 } + - match: {hits.hits.0._id: "2" } + + - do: + indices.forcemerge: + index: test + max_num_segments: 1 + + - do: + indices.refresh: + index: test + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + sort: _doc + + - match: {hits.total: 8 } + - length: {hits.hits: 8 } + - match: {hits.hits.0._id: "2" } + - match: {hits.hits.1._id: "4" } + - match: {hits.hits.2._id: "3" } + - match: {hits.hits.3._id: "1" } + - match: {hits.hits.4._id: "7" } + - match: {hits.hits.5._id: "6" } + - match: {hits.hits.6._id: "8" } + - match: {hits.hits.7._id: "5" } + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + sort: ["rank"] + query: {"range": { "rank": { "from": 0 } } } + track_total_hits: false + size: 3 + + - match: {hits.total: -1 } + - length: {hits.hits: 3 } + - match: {hits.hits.0._id: "2" } + - match: {hits.hits.1._id: "4" } + - match: {hits.hits.2._id: "3" } + + - do: + catch: /disabling \[track_total_hits\] is not allowed in a scroll context/ + search: + rest_total_hits_as_int: true + index: test + scroll: 1m + body: + sort: ["rank"] + query: {"range": { "rank": { "from": 0 } } } + track_total_hits: false + size: 3 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/10_basic.yml new file mode 100644 index 0000000000000..2baa82ea78842 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/10_basic.yml @@ -0,0 +1,223 @@ +--- +setup: + - do: + indices.create: + index: source + wait_for_active_shards: 1 + body: + settings: + index.number_of_shards: 2 + index.number_of_replicas: 0 + index.number_of_routing_shards: 4 + - do: + index: + index: source + id: "1" + body: { "foo": "hello world" } + + - do: + index: + index: source + id: "2" + body: { "foo": "hello world 2" } + + - do: + index: + index: source + id: "3" + body: { "foo": "hello world 3" } + +--- +"Split index via API": + - skip: + version: " - 6.9.99" + reason: pre-7.0.0 will send warnings + features: "warnings" + + # make it read-only + - do: + indices.put_settings: + index: source + body: + index.blocks.write: true + index.number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + index: source + + # now we do the actual split + - do: + indices.split: + index: "source" + target: "target" + wait_for_active_shards: 1 + master_timeout: 10s + body: + settings: + index.number_of_replicas: 0 + index.number_of_shards: 4 + + - do: + cluster.health: + wait_for_status: green + + - do: + get: + index: target + id: "1" + + - match: { _index: target } + - match: { _type: _doc } + - match: { _id: "1" } + - match: { _source: { foo: "hello world" } } + + + - do: + get: + index: target + id: "2" + + - match: { _index: target } + - match: { _type: _doc } + - match: { _id: "2" } + - match: { _source: { foo: "hello world 2" } } + + + - do: + get: + index: target + id: "3" + + - match: { _index: target } + - match: { _type: _doc } + - match: { _id: "3" } + - match: { _source: { foo: "hello world 3" } } + + +--- +"Split from 1 to N": + - skip: + version: " - 6.99.99" + reason: automatic preparation for splitting was added in 7.0.0 + - do: + indices.create: + index: source_one_shard + wait_for_active_shards: 1 + body: + settings: + index.number_of_shards: 1 + index.number_of_replicas: 0 + - do: + index: + index: source_one_shard + id: "1" + body: { "foo": "hello world" } + + - do: + index: + index: source_one_shard + id: "2" + body: { "foo": "hello world 2" } + + - do: + index: + index: source_one_shard + id: "3" + body: { "foo": "hello world 3" } + + # make it read-only + - do: + indices.put_settings: + index: source_one_shard + body: + index.blocks.write: true + index.number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + index: source_one_shard + + # now we do the actual split from 1 to 5 + - do: + indices.split: + index: "source_one_shard" + target: "target" + wait_for_active_shards: 1 + master_timeout: 10s + body: + settings: + index.number_of_replicas: 0 + index.number_of_shards: 5 + + - do: + cluster.health: + wait_for_status: green + + - do: + get: + index: target + id: "1" + + - match: { _index: target } + - match: { _type: _doc } + - match: { _id: "1" } + - match: { _source: { foo: "hello world" } } + + + - do: + get: + index: target + id: "2" + + - match: { _index: target } + - match: { _type: _doc } + - match: { _id: "2" } + - match: { _source: { foo: "hello world 2" } } + + + - do: + get: + index: target + id: "3" + + - match: { _index: target } + - match: { _type: _doc } + - match: { _id: "3" } + - match: { _source: { foo: "hello world 3" } } + +--- +"Create illegal split indices": + - skip: + version: " - 6.9.99" + reason: pre-7.0.0 will send warnings + features: "warnings" + + # try to do an illegal split with number_of_routing_shards set + - do: + catch: /illegal_argument_exception/ + indices.split: + index: "source" + target: "target" + wait_for_active_shards: 1 + master_timeout: 10s + body: + settings: + index.number_of_replicas: 0 + index.number_of_shards: 4 + index.number_of_routing_shards: 8 + + # try to do an illegal split with illegal number_of_shards + - do: + catch: /illegal_state_exception/ + indices.split: + index: "source" + target: "target" + wait_for_active_shards: 1 + master_timeout: 10s + body: + settings: + index.number_of_replicas: 0 + index.number_of_shards: 6 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/20_source_mapping.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/20_source_mapping.yml new file mode 100644 index 0000000000000..3740167a0253a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/20_source_mapping.yml @@ -0,0 +1,68 @@ +--- +"Split index ignores target template mapping": + - skip: + version: " - 6.9.99" + reason: pre-7.0.0 will send warnings + features: "warnings" + + # create index + - do: + indices.create: + index: source + wait_for_active_shards: 1 + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + index.number_of_routing_shards: 2 + mappings: + properties: + count: + type: text + + # index document + - do: + index: + index: source + id: "1" + body: { "count": "1" } + + # create template matching shrink target + - do: + indices.put_template: + name: tpl1 + body: + index_patterns: targ* + mappings: + properties: + count: + type: integer + + # make it read-only + - do: + indices.put_settings: + index: source + body: + index.blocks.write: true + index.number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + index: source + + # now we do the actual split + - do: + indices.split: + index: "source" + target: "target" + wait_for_active_shards: 1 + master_timeout: 10s + body: + settings: + index.number_of_shards: 2 + index.number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/30_copy_settings.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/30_copy_settings.yml new file mode 100644 index 0000000000000..5893ccbc84ede --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/30_copy_settings.yml @@ -0,0 +1,108 @@ +--- +"Copy settings during split index": + - skip: + version: " - 6.9.99" + reason: expects warnings that pre-7.0.0 will not send + features: [arbitrary_key, warnings] + + - do: + nodes.info: + node_id: data:true + - set: + nodes._arbitrary_key_: node_id + + - do: + indices.create: + index: source + wait_for_active_shards: 1 + body: + settings: + # ensure everything is allocated on the same node + index.routing.allocation.include._id: $node_id + index.number_of_replicas: 0 + index.number_of_shards: 1 + index.number_of_routing_shards: 4 + index.merge.scheduler.max_merge_count: 4 + + # make it read-only + - do: + indices.put_settings: + index: source + body: + index.blocks.write: true + index.number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + index: source + + # now we do a actual split and copy settings + - do: + indices.split: + index: "source" + target: "copy-settings-target" + wait_for_active_shards: 1 + master_timeout: 10s + copy_settings: true + body: + settings: + index.number_of_replicas: 0 + index.number_of_shards: 2 + index.merge.scheduler.max_thread_count: 2 + warnings: + - "parameter [copy_settings] is deprecated and will be removed in 8.0.0" + + + - do: + cluster.health: + wait_for_status: green + + - do: + indices.get_settings: + index: "copy-settings-target" + + # settings should be copied + - match: { copy-settings-target.settings.index.merge.scheduler.max_merge_count: "4" } + - match: { copy-settings-target.settings.index.merge.scheduler.max_thread_count: "2" } + - match: { copy-settings-target.settings.index.blocks.write: "true" } + - match: { copy-settings-target.settings.index.routing.allocation.include._id: $node_id } + + # now we do a actual shrink and copy settings (by default) + - do: + indices.split: + index: "source" + target: "default-copy-settings-target" + wait_for_active_shards: 1 + master_timeout: 10s + body: + settings: + index.number_of_replicas: 0 + index.number_of_shards: 2 + index.merge.scheduler.max_thread_count: 2 + + - do: + cluster.health: + wait_for_status: green + + - do: + indices.get_settings: + index: "default-copy-settings-target" + + # settings should be copied + - match: { default-copy-settings-target.settings.index.merge.scheduler.max_merge_count: "4" } + - match: { default-copy-settings-target.settings.index.merge.scheduler.max_thread_count: "2" } + - match: { default-copy-settings-target.settings.index.blocks.write: "true" } + - match: { default-copy-settings-target.settings.index.routing.allocation.include._id: $node_id } + + - do: + catch: /illegal_argument_exception/ + indices.split: + index: "source" + target: "explicit-no-copy-settings-target" + wait_for_active_shards: 1 + master_timeout: 10s + copy_settings: false + body: + settings: + index.number_of_replicas: 0 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/10_index.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/10_index.yml new file mode 100644 index 0000000000000..1a650ee88eae6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/10_index.yml @@ -0,0 +1,116 @@ +--- +setup: + - do: + indices.create: + index: test1 + body: + settings: + number_of_shards: 5 + number_of_replicas: 1 + + - do: + indices.create: + index: test2 + body: + settings: + number_of_shards: 4 + number_of_replicas: 1 + - do: + index: + index: test1 + id: 1 + body: { "foo": "bar" } + + - do: + index: + index: test2 + id: 1 + body: { "foo": "baz" } + +--- +"Index - blank": + - do: + indices.stats: {} + + - match: { _shards.total: 18 } + - is_true: _all + - is_true: indices.test1 + - is_true: indices.test2 + +--- +"Index - all": + - skip: + version: " - 6.3.99" + reason: "uuid is only available from 6.4.0 on" + + - do: + indices.stats: { index: _all } + + - match: { _shards.total: 18 } + - is_true: _all + - is_true: indices.test1 + - is_true: indices.test1.uuid + - is_true: indices.test2 + - is_true: indices.test2.uuid + + +--- +"Index - star": + - do: + indices.stats: { index: '*' } + + - match: { _shards.total: 18 } + - is_true: _all + - is_true: indices.test1 + - is_true: indices.test2 + +--- +"Index - star, no match": + - do: + indices.stats: { index: 'bla*' } + + - match: { _shards.total: 0 } + - is_true: _all + - is_false: indices.test1 + - is_false: indices.test2 + +--- +"Index - one index": + - do: + indices.stats: { index: 'test1' } + + - match: { _shards.total: 10 } + - is_true: _all + - is_true: indices.test1 + - is_false: indices.test2 + +--- +"Index - multi-index": + - do: + indices.stats: { index: [test1, test2] } + + - match: { _shards.total: 18 } + - is_true: _all + - is_true: indices.test1 + - is_true: indices.test2 + +--- +"Index - pattern": + - do: + indices.stats: { index: '*2' } + + - match: { _shards.total: 8 } + - is_true: _all + - is_false: indices.test1 + - is_true: indices.test2 + +--- +"Indices stats unrecognized parameter": + - do: + catch: bad_request + indices.stats: + metric: [ fieldata ] + + - match: { status: 400 } + - match: { error.type: illegal_argument_exception } + - match: { error.reason: "request [/_stats/fieldata] contains unrecognized metric: [fieldata] -> did you mean [fielddata]?" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/11_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/11_metric.yml new file mode 100644 index 0000000000000..79790935beef2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/11_metric.yml @@ -0,0 +1,164 @@ +--- +setup: + + - do: + index: + index: test1 + id: 1 + body: { "foo": "bar" } + + - do: + index: + index: test2 + id: 1 + body: { "foo": "baz" } + +--- +"Metric - blank": + - do: + indices.stats: {} + + - is_true: _all.total.docs + - is_true: _all.total.store + - is_true: _all.total.indexing + - is_true: _all.total.get + - is_true: _all.total.search + - is_true: _all.total.merges + - is_true: _all.total.refresh + - is_true: _all.total.flush + - is_true: _all.total.warmer + - is_true: _all.total.query_cache + - is_true: _all.total.fielddata + - is_true: _all.total.completion + - is_true: _all.total.segments + - is_true: _all.total.translog + - is_true: _all.total.recovery + +--- +"Metric - _all": + - do: + indices.stats: { metric: _all } + + - is_true: _all.total.docs + - is_true: _all.total.store + - is_true: _all.total.indexing + - is_true: _all.total.get + - is_true: _all.total.search + - is_true: _all.total.merges + - is_true: _all.total.refresh + - is_true: _all.total.flush + - is_true: _all.total.warmer + - is_true: _all.total.query_cache + - is_true: _all.total.fielddata + - is_true: _all.total.completion + - is_true: _all.total.segments + - is_true: _all.total.translog + - is_true: _all.total.recovery + +--- +"Metric - one": + - do: + indices.stats: { metric: docs } + + - is_true: _all.total.docs + - is_false: _all.total.store + - is_false: _all.total.indexing + - is_false: _all.total.get + - is_false: _all.total.search + - is_false: _all.total.merges + - is_false: _all.total.refresh + - is_false: _all.total.flush + - is_false: _all.total.warmer + - is_false: _all.total.query_cache + - is_false: _all.total.fielddata + - is_false: _all.total.completion + - is_false: _all.total.segments + - is_false: _all.total.translog + - is_false: _all.total.recovery + +--- +"Metric - multi": + - do: + indices.stats: { metric: [ store, get, merge ] } + + - is_false: _all.total.docs + - is_true: _all.total.store + - is_false: _all.total.indexing + - is_true: _all.total.get + - is_false: _all.total.search + - is_true: _all.total.merges + - is_false: _all.total.refresh + - is_false: _all.total.flush + - is_false: _all.total.warmer + - is_false: _all.total.query_cache + - is_false: _all.total.fielddata + - is_false: _all.total.completion + - is_false: _all.total.segments + - is_false: _all.total.translog + - is_false: _all.total.recovery + + +--- +"Metric - recovery": + - do: + indices.stats: { metric: [ recovery ] } + + - is_false: _all.total.docs + - is_false: _all.total.store + - is_false: _all.total.indexing + - is_false: _all.total.get + - is_false: _all.total.search + - is_false: _all.total.merges + - is_false: _all.total.refresh + - is_false: _all.total.flush + - is_false: _all.total.warmer + - is_false: _all.total.query_cache + - is_false: _all.total.fielddata + - is_false: _all.total.completion + - is_false: _all.total.segments + - is_false: _all.total.translog + - is_true: _all.total.recovery + +--- +"Metric - _all include_segment_file_sizes": + - do: + indices.stats: { metric: _all, include_segment_file_sizes: true } + + - is_true: _all.total.docs + - is_true: _all.total.store + - is_true: _all.total.indexing + - is_true: _all.total.get + - is_true: _all.total.search + - is_true: _all.total.merges + - is_true: _all.total.refresh + - is_true: _all.total.flush + - is_true: _all.total.warmer + - is_true: _all.total.query_cache + - is_true: _all.total.fielddata + - is_true: _all.total.completion + - is_true: _all.total.segments + - is_true: _all.total.translog + - is_true: _all.total.recovery + - is_true: _all.total.segments.file_sizes + +--- +"Metric - segments include_segment_file_sizes": + - do: + indices.stats: { metric: segments, include_segment_file_sizes: true } + + - is_false: _all.total.docs + - is_false: _all.total.store + - is_false: _all.total.indexing + - is_false: _all.total.get + - is_false: _all.total.search + - is_false: _all.total.merges + - is_false: _all.total.refresh + - is_false: _all.total.flush + - is_false: _all.total.warmer + - is_false: _all.total.query_cache + - is_false: _all.total.fielddata + - is_false: _all.total.completion + - is_true: _all.total.segments + - is_false: _all.total.translog + - is_false: _all.total.recovery + - is_true: _all.total.segments.file_sizes diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/12_level.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/12_level.yml new file mode 100644 index 0000000000000..e9bd219a3e0ab --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/12_level.yml @@ -0,0 +1,68 @@ +--- +setup: + + - do: + index: + index: test1 + id: 1 + body: { "foo": "bar" } + + - do: + index: + index: test2 + id: 1 + body: { "foo": "baz" } + +--- +"Level - blank": + - do: + indices.stats: {} + + - is_true: _all.total.docs + - is_true: _all.total.docs + - is_true: indices.test1.total.docs + - is_true: indices.test1.total.docs + - is_false: indices.test1.shards + - is_true: indices.test2.total.docs + - is_true: indices.test2.total.docs + - is_false: indices.test2.shards + +--- +"Level - indices": + - do: + indices.stats: { level: indices } + + - is_true: _all.total.docs + - is_true: _all.total.docs + - is_true: indices.test1.total.docs + - is_true: indices.test1.total.docs + - is_false: indices.test1.shards + - is_true: indices.test2.total.docs + - is_true: indices.test2.total.docs + - is_false: indices.test2.shards + +--- +"Level - cluster": + - do: + indices.stats: { level: cluster } + + - is_true: _all.total.docs + - is_true: _all.total.docs + - is_false: indices + + +--- +"Level - shards": + - do: + indices.stats: { level: shards } + + - is_true: _all.total.docs + - is_true: _all.total.docs + - is_true: indices.test1.total.docs + - is_true: indices.test1.total.docs + - is_true: indices.test1.shards + - is_true: indices.test2.total.docs + - is_true: indices.test2.total.docs + - is_true: indices.test2.shards + - is_true: indices.test1.shards.0.0.commit.id + - is_true: indices.test2.shards.0.0.commit.id diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/13_fields.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/13_fields.yml new file mode 100644 index 0000000000000..42a11e467ccb3 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/13_fields.yml @@ -0,0 +1,328 @@ +--- +setup: + + - do: + indices.create: + index: test1 + wait_for_active_shards: all + body: + settings: + # Limit the number of shards so that shards are unlikely + # to be relocated or being initialized between the test + # set up and the test execution + index.number_of_shards: 3 + index.number_of_replicas: 0 + mappings: + properties: + bar: + type: text + fielddata: true + fields: + completion: + type: completion + baz: + type: text + fielddata: true + fields: + completion: + type: completion + + - do: + cluster.health: + wait_for_no_relocating_shards: true + + - do: + index: + index: test1 + id: 1 + body: { "bar": "bar", "baz": "baz" } + + - do: + index: + index: test1 + id: 2 + body: { "bar": "foo", "baz": "foo" } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + index: test1 + body: + suggest: + result: + text: "b" + completion: + field: bar.completion + + - do: + search: + rest_total_hits_as_int: true + index: test1 + body: + suggest: + result: + text: "b" + completion: + field: baz.completion + + - do: + search: + rest_total_hits_as_int: true + body: + sort: [ "bar", "baz" ] + +--- +"Fields - blank": + - do: + indices.stats: {} + + - match: { _shards.failed: 0} + - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } + - is_false: _all.total.fielddata.fields + - gt: { _all.total.completion.size_in_bytes: 0 } + - is_false: _all.total.completion.fields + +--- +"Fields - one": + - do: + indices.stats: { fields: bar } + + - match: { _shards.failed: 0} + - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } + - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } + - is_false: _all.total.fielddata.fields.baz + - gt: { _all.total.completion.size_in_bytes: 0 } + - is_false: _all.total.completion.fields.bar + +--- +"Fields - multi": + - do: + indices.stats: { fields: "bar,baz.completion" } + + - match: { _shards.failed: 0} + - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } + - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } + - is_false: _all.total.fielddata.fields.baz + - gt: { _all.total.completion.size_in_bytes: 0 } + - is_false: _all.total.completion.fields.bar\.completion + - gt: { _all.total.completion.fields.baz\.completion.size_in_bytes: 0 } + +--- +"Fields - star": + - do: + indices.stats: { fields: "*" } + + - match: { _shards.failed: 0} + - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } + - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } + - gt: { _all.total.fielddata.fields.baz.memory_size_in_bytes: 0 } + - gt: { _all.total.completion.size_in_bytes: 0 } + - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } + - gt: { _all.total.completion.fields.baz\.completion.size_in_bytes: 0 } + +--- +"Fields - pattern": + - do: + indices.stats: { fields: "bar*" } + + - match: { _shards.failed: 0} + - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } + - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } + - is_false: _all.total.fielddata.fields.baz + - gt: { _all.total.completion.size_in_bytes: 0 } + - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } + - is_false: _all.total.completion.fields.baz\.completion + +--- +"Fields - _all metric": + - do: + indices.stats: { fields: "bar*", metric: _all } + + - match: { _shards.failed: 0} + - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } + - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } + - is_false: _all.total.fielddata.fields.baz + - gt: { _all.total.completion.size_in_bytes: 0 } + - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } + - is_false: _all.total.completion.fields.baz\.completion + +--- +"Fields - fielddata metric": + - do: + indices.stats: { fields: "bar*", metric: fielddata } + + - match: { _shards.failed: 0} + - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } + - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } + - is_false: _all.total.fielddata.fields.baz + - is_false: _all.total.completion + +--- +"Fields - completion metric": + - do: + indices.stats: { fields: "bar*", metric: completion } + + - match: { _shards.failed: 0} + - is_false: _all.total.fielddata + - gt: { _all.total.completion.size_in_bytes: 0 } + - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } + - is_false: _all.total.completion.fields.baz\.completion + +--- +"Fields - multi metric": + - do: + indices.stats: { fields: "bar*" , metric: [ completion, fielddata, search ]} + + - match: { _shards.failed: 0} + - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } + - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } + - is_false: _all.total.fielddata.fields.baz + - gt: { _all.total.completion.size_in_bytes: 0 } + - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } + - is_false: _all.total.completion.fields.baz\.completion + +--- +"Fielddata fields - one": + - do: + indices.stats: { fielddata_fields: bar } + + - match: { _shards.failed: 0} + - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } + - is_false: _all.total.fielddata.fields.baz + - is_false: _all.total.completion.fields + +--- +"Fielddata fields - multi": + - do: + indices.stats: { fielddata_fields: "bar,baz,baz.completion" } + + - match: { _shards.failed: 0} + - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } + - gt: { _all.total.fielddata.fields.baz.memory_size_in_bytes: 0 } + - is_false: _all.total.completion.fields + +--- +"Fielddata fields - star": + - do: + indices.stats: { fielddata_fields: "*" } + + - match: { _shards.failed: 0} + - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } + - gt: { _all.total.fielddata.fields.baz.memory_size_in_bytes: 0 } + - is_false: _all.total.completion.fields + +--- +"Fielddata fields - pattern": + - do: + indices.stats: { fielddata_fields: "*r" } + + - match: { _shards.failed: 0} + - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } + - is_false: _all.total.fielddata.fields.baz + - is_false: _all.total.completion.fields + + +--- +"Fielddata fields - all metric": + - do: + indices.stats: { fielddata_fields: "*r", metric: _all } + + - match: { _shards.failed: 0} + - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } + - is_false: _all.total.fielddata.fields.baz + - is_false: _all.total.completion.fields + +--- +"Fielddata fields - one metric": + - do: + indices.stats: { fielddata_fields: "*r", metric: fielddata } + + - match: { _shards.failed: 0} + - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } + - is_false: _all.total.fielddata.fields.baz + - is_false: _all.total.completion.fields + + +--- +"Fielddata fields - multi metric": + - do: + indices.stats: { fielddata_fields: "*r", metric: [ fielddata, search] } + + - match: { _shards.failed: 0} + - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } + - is_false: _all.total.fielddata.fields.baz + - is_false: _all.total.completion.fields + + +--- +"Completion fields - one": + - do: + indices.stats: { completion_fields: bar.completion } + + - match: { _shards.failed: 0} + - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } + - is_false: _all.total.completion.fields.baz\.completion + - is_false: _all.total.fielddata.fields + +--- +"Completion fields - multi": + - do: + indices.stats: { completion_fields: "bar.completion,baz,baz.completion" } + + - match: { _shards.failed: 0} + - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } + - gt: { _all.total.completion.fields.baz\.completion.size_in_bytes: 0 } + - is_false: _all.total.fielddata.fields + +--- +"Completion fields - star": + - do: + indices.stats: { completion_fields: "*" } + + - match: { _shards.failed: 0} + - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } + - gt: { _all.total.completion.fields.baz\.completion.size_in_bytes: 0 } + - is_false: _all.total.fielddata.fields + +--- +"Completion - pattern": + - do: + indices.stats: { completion_fields: "*r*" } + + - match: { _shards.failed: 0} + - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } + - is_false: _all.total.completion.fields.baz\.completion + - is_false: _all.total.fielddata.fields + +--- +"Completion - all metric": + - do: + indices.stats: { completion_fields: "*r*", metric: _all } + + - match: { _shards.failed: 0} + - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } + - is_false: _all.total.completion.fields.baz\.completion + - is_false: _all.total.fielddata.fields + +--- +"Completion - one metric": + - do: + indices.stats: { completion_fields: "*r*", metric: completion } + + - match: { _shards.failed: 0} + - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } + - is_false: _all.total.completion.fields.baz\.completion + - is_false: _all.total.fielddata.fields + +--- +"Completion - multi metric": + - do: + indices.stats: { completion_fields: "*r*", metric: [ completion, search ] } + + - match: { _shards.failed: 0} + - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } + - is_false: _all.total.completion.fields.baz\.completion + - is_false: _all.total.fielddata.fields diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/14_groups.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/14_groups.yml new file mode 100644 index 0000000000000..daf55b38919b2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/14_groups.yml @@ -0,0 +1,78 @@ +--- +setup: + + - do: + index: + index: test1 + id: 1 + body: { "bar": "bar", "baz": "baz" } + + - do: + search: + rest_total_hits_as_int: true + body: + stats: [ bar, baz ] + +--- +"Groups - blank": + - do: + indices.stats: {} + + - gt: { _all.total.search.query_total: 0 } + - is_false: _all.total.search.groups + +--- +"Groups - one": + - do: + indices.stats: { groups: bar } + + - gt: { _all.total.search.groups.bar.query_total: 0 } + - is_false: _all.total.search.groups.baz + +--- +"Groups - multi": + - do: + indices.stats: { groups: "bar,baz" } + + - gt: { _all.total.search.groups.bar.query_total: 0 } + - gt: { _all.total.search.groups.baz.query_total: 0 } + +--- +"Groups - star": + - do: + indices.stats: { groups: "*" } + + - gt: { _all.total.search.groups.bar.query_total: 0 } + - gt: { _all.total.search.groups.baz.query_total: 0 } + +--- +"Groups - pattern": + - do: + indices.stats: { groups: "*r" } + + - gt: { _all.total.search.groups.bar.query_total: 0 } + - is_false: _all.total.search.groups.baz + +--- +"Groups - _all metric": + - do: + indices.stats: { groups: bar, metric: _all } + + - gt: { _all.total.search.groups.bar.query_total: 0 } + - is_false: _all.total.search.groups.baz + +--- +"Groups - search metric": + - do: + indices.stats: { groups: bar, metric: search } + + - gt: { _all.total.search.groups.bar.query_total: 0 } + - is_false: _all.total.search.groups.baz + +--- +"Groups - multi metric": + - do: + indices.stats: { groups: bar, metric: [ indexing, search] } + + - gt: { _all.total.search.groups.bar.query_total: 0 } + - is_false: _all.total.search.groups.baz diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/15_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/15_types.yml new file mode 100644 index 0000000000000..e2f31c3405707 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/15_types.yml @@ -0,0 +1,81 @@ +--- +setup: + + - do: + index: + index: test1 + type: bar + id: 1 + body: { "bar": "bar", "baz": "baz" } + + - do: + index: + index: test2 + type: baz + id: 1 + body: { "bar": "bar", "baz": "baz" } + + +--- +"Types - blank": + - do: + indices.stats: {} + + - match: { _all.primaries.indexing.index_total: 2 } + - is_false: _all.primaries.indexing.types + +--- +"Types - one": + - do: + indices.stats: { types: bar } + + - match: { _all.primaries.indexing.types.bar.index_total: 1 } + - is_false: _all.primaries.indexing.types.baz + +--- +"Types - multi": + - do: + indices.stats: { types: "bar,baz" } + + - match: { _all.primaries.indexing.types.bar.index_total: 1 } + - match: { _all.primaries.indexing.types.baz.index_total: 1 } + +--- +"Types - star": + - do: + indices.stats: { types: "*" } + + - match: { _all.primaries.indexing.types.bar.index_total: 1 } + - match: { _all.primaries.indexing.types.baz.index_total: 1 } + +--- +"Types - pattern": + - do: + indices.stats: { types: "*r" } + + - match: { _all.primaries.indexing.types.bar.index_total: 1 } + - is_false: _all.primaries.indexing.types.baz + +--- +"Types - _all metric": + - do: + indices.stats: { types: bar, metric: _all } + + - match: { _all.primaries.indexing.types.bar.index_total: 1 } + - is_false: _all.primaries.indexing.types.baz + +--- +"Types - indexing metric": + - do: + indices.stats: { types: bar, metric: indexing } + + - match: { _all.primaries.indexing.types.bar.index_total: 1 } + - is_false: _all.primaries.indexing.types.baz + +--- +"Types - multi metric": + - do: + indices.stats: { types: bar, metric: [ indexing, search ] } + + - match: { _all.primaries.indexing.types.bar.index_total: 1 } + - is_false: _all.primaries.indexing.types.baz diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/20_translog.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/20_translog.yml new file mode 100644 index 0000000000000..b6ed05610e41c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/20_translog.yml @@ -0,0 +1,280 @@ +--- +"Translog retention without soft_deletes": + - skip: + version: " - 7.5.99" + reason: "indices without soft deletes are deprecated in 7.6" + features: "warnings" + + - do: + indices.create: + index: test + body: + settings: + soft_deletes.enabled: false + warnings: + - Creating indices with soft-deletes disabled is deprecated and will be removed in future Elasticsearch versions. + Please do not specify value for setting [index.soft_deletes.enabled] of index [test]. + - do: + cluster.health: + wait_for_no_initializing_shards: true + wait_for_events: languid + - do: + indices.stats: + metric: [ translog ] + - set: { indices.test.primaries.translog.size_in_bytes: creation_size } + + - do: + index: + index: test + id: 1 + body: { "foo": "bar" } + + - do: + indices.stats: + metric: [ translog ] + - gt: { indices.test.primaries.translog.size_in_bytes: $creation_size } + - match: { indices.test.primaries.translog.operations: 1 } +# we can't check this yet as creation size will contain two empty translog generations. A single +# non empty generation with one op may be smaller or larger than that. +# - gt: { indices.test.primaries.translog.uncommitted_size_in_bytes: $creation_size } + - match: { indices.test.primaries.translog.uncommitted_operations: 1 } + + - do: + indices.flush: + index: test + + - do: + indices.stats: + metric: [ translog ] + - gt: { indices.test.primaries.translog.size_in_bytes: $creation_size } + - match: { indices.test.primaries.translog.operations: 1 } + ## creation translog size has some overhead due to an initial empty generation that will be trimmed later + - lt: { indices.test.primaries.translog.uncommitted_size_in_bytes: $creation_size } + - match: { indices.test.primaries.translog.uncommitted_operations: 0 } + + - do: + indices.put_settings: + index: test + body: + index.translog.retention.size: -1 + index.translog.retention.age: -1 + + - do: + indices.flush: + index: test + force: true # force flush as we don't have pending ops + + - do: + indices.stats: + metric: [ translog ] + ## creation translog size has some overhead due to an initial empty generation that will be trimmed later + - lte: { indices.test.primaries.translog.size_in_bytes: $creation_size } + - match: { indices.test.primaries.translog.operations: 0 } + - lte: { indices.test.primaries.translog.uncommitted_size_in_bytes: $creation_size } + - match: { indices.test.primaries.translog.uncommitted_operations: 0 } + +--- +"Translog retention with soft_deletes": + - skip: + version: " - 7.3.99" + reason: "start ignoring translog retention policy with soft-deletes enabled in 7.4" + - do: + indices.create: + index: test + body: + settings: + soft_deletes.enabled: true + - do: + cluster.health: + wait_for_no_initializing_shards: true + wait_for_events: languid + # Before 8.0, an empty shard has two empty translog files as we used the translog_generation commit tag as the minimum required + # translog generation for recovery. Here we force-flush to have a consistent translog stats for both old and new indices. + - do: + indices.flush: + index: test + force: true + wait_if_ongoing: true + - do: + indices.stats: + metric: [ translog ] + - set: { indices.test.primaries.translog.size_in_bytes: creation_size } + + - do: + index: + index: test + id: 1 + body: { "foo": "bar" } + + - do: + indices.stats: + metric: [ translog ] + - gt: { indices.test.primaries.translog.size_in_bytes: $creation_size } + - match: { indices.test.primaries.translog.operations: 1 } + - match: { indices.test.primaries.translog.uncommitted_operations: 1 } + # call flush twice to sync the global checkpoint after the last operation so that we can have the safe commit + - do: + indices.flush: + index: test + - do: + indices.flush: + index: test + - do: + indices.stats: + metric: [ translog ] + - match: { indices.test.primaries.translog.size_in_bytes: $creation_size } + - match: { indices.test.primaries.translog.operations: 0 } + - match: { indices.test.primaries.translog.uncommitted_size_in_bytes: $creation_size } + - match: { indices.test.primaries.translog.uncommitted_operations: 0 } + +--- +"Translog retention settings are deprecated": + - skip: + version: " - 7.6.99" + reason: "translog retention settings are deprecated in 7.6" + features: "warnings" + - do: + warnings: + - Translog retention settings [index.translog.retention.age] and [index.translog.retention.size] + are deprecated and effectively ignored. They will be removed in a future version. + indices.create: + index: test + body: + settings: + index.translog.retention.size: 128mb + - do: + indices.put_settings: + index: test + body: + index.number_of_replicas: 0 + - do: + warnings: + - Translog retention settings [index.translog.retention.age] and [index.translog.retention.size] + are deprecated and effectively ignored. They will be removed in a future version. + indices.put_settings: + index: test + body: + index.translog.retention.age: 1h + - do: + indices.put_settings: + index: test + body: + index.translog.retention.age: null + index.translog.retention.size: null + +--- +"Translog last modified age stats": + - skip: + version: " - 6.2.99" + reason: translog last modified age stats was added in 6.3.0 + - do: + index: + index: test + id: 1 + body: { "foo": "bar" } + + - do: + indices.stats: + metric: [ translog ] + - gte: { indices.test.primaries.translog.earliest_last_modified_age: 0 } + +--- +"Translog stats on closed indices without soft-deletes": + - skip: + version: " - 7.5.99" + reason: "indices without soft deletes are deprecated in 7.6" + features: "warnings" + + - do: + indices.create: + index: test + body: + settings: + soft_deletes.enabled: false + warnings: + - Creating indices with soft-deletes disabled is deprecated and will be removed in future Elasticsearch versions. + Please do not specify value for setting [index.soft_deletes.enabled] of index [test]. + + - do: + cluster.health: + wait_for_no_initializing_shards: true + wait_for_events: languid + - do: + index: + index: test + id: 1 + body: { "foo": "bar" } + + - do: + index: + index: test + id: 2 + body: { "foo": "bar" } + + - do: + index: + index: test + id: 3 + body: { "foo": "bar" } + + - do: + indices.stats: + metric: [ translog ] + - match: { indices.test.primaries.translog.operations: 3 } + - match: { indices.test.primaries.translog.uncommitted_operations: 3 } + + - do: + indices.close: + index: test + wait_for_active_shards: 1 + - is_true: acknowledged + + - do: + indices.stats: + metric: [ translog ] + expand_wildcards: all + forbid_closed_indices: false + - match: { indices.test.primaries.translog.operations: 3 } + - match: { indices.test.primaries.translog.uncommitted_operations: 0 } + +--- +"Translog stats on closed indices with soft-deletes": + - skip: + version: " - 7.3.99" + reason: "start ignoring translog retention policy with soft-deletes enabled in 7.4" + - do: + indices.create: + index: test + body: + settings: + soft_deletes.enabled: true + - do: + cluster.health: + wait_for_no_initializing_shards: true + wait_for_events: languid + - do: + index: + index: test + id: 1 + body: { "foo": "bar" } + - do: + indices.stats: + metric: [ translog ] + - match: { indices.test.primaries.translog.operations: 1 } + - match: { indices.test.primaries.translog.uncommitted_operations: 1 } + - do: + cluster.health: + wait_for_no_initializing_shards: true + wait_for_events: languid + - do: + indices.close: + index: test + wait_for_active_shards: 1 + - is_true: acknowledged + - do: + indices.stats: + metric: [ translog ] + expand_wildcards: all + forbid_closed_indices: false + - match: { indices.test.primaries.translog.operations: 0 } + - match: { indices.test.primaries.translog.uncommitted_operations: 0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/30_segments.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/30_segments.yml new file mode 100644 index 0000000000000..e39e019805544 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/30_segments.yml @@ -0,0 +1,63 @@ +--- +setup: + - do: + indices.create: + index: test + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_no_initializing_shards: true + +--- +"Segment Stats": + + - skip: + version: " - 7.1.99" + reason: forbid_closed_indices is not supported in ealier version + + - do: + indices.stats: + metric: [ segments ] + - set: { indices.test.primaries.segments.count: num_segments } + + - do: + index: + index: test + id: 1 + body: { "foo": "bar" } + + - do: + indices.flush: + index: test + + - do: + indices.stats: + metric: [ segments ] + - gt: { indices.test.primaries.segments.count: $num_segments } + - set: { indices.test.primaries.segments.count: num_segments_after_flush } + + - do: + indices.close: + index: test + wait_for_active_shards: "all" + + - do: + indices.stats: + metric: segments + expand_wildcards: closed + forbid_closed_indices: false + + - match: { indices.test.primaries.segments.count: 0 } + + - do: + indices.stats: + metric: segments + include_unloaded_segments: true + expand_wildcards: closed + forbid_closed_indices: false + + - match: { indices.test.primaries.segments.count: $num_segments_after_flush } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/40_updates_on_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/40_updates_on_refresh.yml new file mode 100644 index 0000000000000..73c58211c189e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/40_updates_on_refresh.yml @@ -0,0 +1,67 @@ +--- +setup: + + - do: + indices.create: + index: test1 + wait_for_active_shards: all + body: + settings: + # Limit the number of shards so that shards are unlikely + # to be relocated or being initialized between the test + # set up and the test execution + index.number_of_shards: 3 + index.number_of_replicas: 0 + mappings: + properties: + bar: + type: text + fielddata: true + fields: + completion: + type: completion + + - do: + cluster.health: + wait_for_no_relocating_shards: true + wait_for_events: languid + + - do: + index: + index: test1 + id: 1 + body: { "bar": "bar" } + + - do: + index: + index: test1 + id: 2 + body: { "bar": "foo" } + + - do: + indices.refresh: {} + +--- +"Completion stats": + - do: + indices.stats: { completion_fields: "*" } + + - match: { _shards.failed: 0} + - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } + - gt: { _all.total.completion.size_in_bytes: 0 } + - set: { _all.total.completion.size_in_bytes: original_size } + + - do: + index: + index: test1 + id: 3 + body: { "bar": "foo", "baz": "foo" } + + - do: + indices.refresh: {} + + - do: + indices.stats: { completion_fields: "*" } + + - match: { _shards.failed: 0} + - gt: { _all.total.completion.size_in_bytes: $original_size } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/10_basic.yml new file mode 100644 index 0000000000000..b7cae037b86ce --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/10_basic.yml @@ -0,0 +1,168 @@ +--- +"Basic test for aliases": + + - do: + indices.create: + index: test_index + + - do: + indices.exists_alias: + name: test_alias + + - is_false: '' + + - do: + indices.update_aliases: + body: + actions: + - add: + index: test_index + alias: test_alias + routing: routing_value + filter: + ids: + values: ["1", "2", "3"] + + - do: + indices.exists_alias: + name: test_alias + + - is_true: '' + + - do: + indices.get_alias: + index: test_index + name: test_alias + + - match: {test_index.aliases.test_alias: {filter: { ids : { values: ["1", "2", "3"]}}, 'index_routing': 'routing_value', 'search_routing': 'routing_value'}} + +--- +"Basic test for multiple aliases": + + - do: + indices.create: + index: test_index + + - do: + indices.exists_alias: + name: test_alias1 + + - is_false: '' + + - do: + indices.exists_alias: + name: test_alias2 + + - is_false: '' + + - do: + indices.update_aliases: + body: + actions: + - add: + indices: [test_index] + aliases: [test_alias1, test_alias2] + routing: routing_value + + - do: + indices.exists_alias: + name: test_alias1 + + - is_true: '' + + - do: + indices.exists_alias: + name: test_alias2 + + - is_true: '' + + - do: + indices.get_alias: + index: test_index + + - match: {test_index.aliases.test_alias1: {'index_routing': 'routing_value', 'search_routing': 'routing_value'}} + - match: {test_index.aliases.test_alias2: {'index_routing': 'routing_value', 'search_routing': 'routing_value'}} + +--- +"Remove alias": + - do: + indices.create: + index: test_index + - do: + indices.exists_alias: + name: test_alias1 + - is_false: '' + - do: + indices.exists_alias: + name: test_alias2 + - is_false: '' + - do: + indices.exists_alias: + name: test_alias3 + - is_false: '' + + - do: + indices.update_aliases: + body: + actions: + - add: + index: test_index + aliases: [test_alias1, test_alias2] + - do: + indices.exists_alias: + name: test_alias1 + - is_true: '' + - do: + indices.exists_alias: + name: test_alias2 + - is_true: '' + - do: + indices.exists_alias: + name: test_alias3 + - is_false: '' + + - do: + indices.update_aliases: + body: + actions: + - remove: + index: test_index + alias: test_alias1 + - add: + index: test_index + alias: test_alias3 + - do: + indices.exists_alias: + name: test_alias1 + - is_false: '' + - do: + indices.exists_alias: + name: test_alias2 + - is_true: '' + - do: + indices.exists_alias: + name: test_alias3 + - is_true: '' + + - do: + indices.update_aliases: + body: + actions: + - remove: + index: test_index + alias: test_alias2 + - remove: + index: test_index + alias: test_alias3 + - do: + indices.exists_alias: + name: test_alias1 + - is_false: '' + - do: + indices.exists_alias: + name: test_alias2 + - is_false: '' + - do: + indices.exists_alias: + name: test_alias3 + - is_false: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/20_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/20_routing.yml new file mode 100644 index 0000000000000..ecedcef0c1a48 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/20_routing.yml @@ -0,0 +1,135 @@ +setup: + - do: + indices.create: + index: test_index + +--- +"Routing": + + - do: + indices.update_aliases: + body: + actions: + - add: + index: test_index + alias: test_alias + routing: routing + + - do: + indices.get_alias: + index: test_index + + - match: {test_index.aliases.test_alias: {'index_routing': 'routing', 'search_routing': 'routing'}} + +--- +"Index Routing": + + - do: + indices.update_aliases: + body: + actions: + - add: + index: test_index + alias: test_alias + index_routing: index_routing + + - do: + indices.get_alias: + index: test_index + + - match: {test_index.aliases.test_alias: {'index_routing': 'index_routing'}} + +--- +"Search Routing": + + - do: + indices.update_aliases: + body: + actions: + - add: + index: test_index + alias: test_alias + search_routing: search_routing + + - do: + indices.get_alias: + index: test_index + + - match: {test_index.aliases.test_alias: {'search_routing': 'search_routing'}} + +--- +"Index, Default Routing": + + - do: + indices.update_aliases: + body: + actions: + - add: + index: test_index + alias: test_alias + index_routing: index_routing + routing: routing + + - do: + indices.get_alias: + index: test_index + + - match: {test_index.aliases.test_alias: {'index_routing': 'index_routing', 'search_routing': 'routing'}} + +--- +"Search, Default Routing": + + - do: + indices.update_aliases: + body: + actions: + - add: + index: test_index + alias: test_alias + search_routing: search_routing + routing: routing + + - do: + indices.get_alias: + index: test_index + + - match: {test_index.aliases.test_alias: {'index_routing': 'routing', 'search_routing': 'search_routing'}} + +--- +"Index, Search, Default Routing": + + - do: + indices.update_aliases: + body: + actions: + - add: + index: test_index + alias: test_alias + index_routing: index_routing + search_routing: search_routing + routing: routing + + - do: + indices.get_alias: + index: test_index + + - match: {test_index.aliases.test_alias: {'index_routing': 'index_routing', 'search_routing': 'search_routing'}} + +--- +"Numeric Routing": + + - do: + indices.update_aliases: + body: + actions: + - add: + index: test_index + alias: test_alias + routing: 5 + + - do: + indices.get_alias: + index: test_index + + - match: {test_index.aliases.test_alias: {'index_routing': '5', 'search_routing': '5'}} + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/30_remove_index_and_replace_with_alias.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/30_remove_index_and_replace_with_alias.yml new file mode 100644 index 0000000000000..ebf923e259997 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/30_remove_index_and_replace_with_alias.yml @@ -0,0 +1,35 @@ +--- +"Remove an index and replace it with an alias": + + - do: + indices.create: + index: test + - do: + indices.create: + index: test_2 + + - do: + indices.update_aliases: + body: + actions: + - add: + index: test_2 + aliases: [test, test_write] + - remove_index: + index: test + + - do: + indices.exists_alias: + name: test + - is_true: '' + + - do: + indices.exists_alias: + name: test_write + - is_true: '' + + - do: + indices.get: + index: test + # the name of the index that the alias points to, would be `test` if the index were still there + - is_true: test_2 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.upgrade/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.upgrade/10_basic.yml new file mode 100644 index 0000000000000..55070cb8c1f97 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.upgrade/10_basic.yml @@ -0,0 +1,72 @@ +--- +"Basic test for upgrade indices": + + - do: + indices.create: + index: test_index + body: + settings: + index: + number_of_replicas: 0 + + - do: + indices.upgrade: + index: test_index + + - match: {upgraded_indices.test_index.oldest_lucene_segment_version: '/(\d\.)+\d/'} + - is_true: upgraded_indices.test_index.upgrade_version + +--- +"Upgrade indices ignore unavailable": + - do: + indices.create: + index: test_index + body: + settings: + index: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + indices.upgrade: + index: ["does_not_exist", "test_index"] + ignore_unavailable: true + + - match: {_shards.total: 1} + - is_true: upgraded_indices.test_index.upgrade_version + - is_false: upgraded_indices.does_not_exist + +--- +"Upgrade indices allow no indices": + + - do: + indices.upgrade: + index: test_index + ignore_unavailable: true + allow_no_indices: true + + - match: {_shards.total: 0} + +--- +"Upgrade indices disallow no indices": + + - do: + catch: missing + indices.upgrade: + index: test_index + ignore_unavailable: true + allow_no_indices: false + +--- +"Upgrade indices disallow unavailable": + + - do: + indices.create: + index: test_index + + - do: + catch: missing + indices.upgrade: + index: ["test_index", "does_not_exist"] + ignore_unavailable: false + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/10_basic.yml new file mode 100644 index 0000000000000..2221d08c0b7e2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/10_basic.yml @@ -0,0 +1,88 @@ +setup: + - do: + indices.create: + index: testing + body: + settings: + number_of_replicas: 0 + aliases: + alias_1: + "filter" : { "match_all" : {} } + + +--- +"Validate query api": + - skip: + version: ' - 7.6.99' + reason: message changed in 7.7.0 + + - do: + indices.validate_query: + q: query string + index: testing + + - is_true: valid + + - do: + indices.validate_query: + q: query string + index: alias_1 + + - is_true: valid + + - do: + indices.validate_query: + body: + query: + invalid_query: {} + + - is_false: valid + - is_false: error + + - do: + indices.validate_query: + explain: true + body: + query: + invalid_query: {} + + - is_false: valid + - match: {error: '/.+unknown\squery\s\[invalid_query\].+/' } + + - do: + indices.validate_query: + explain: true + body: + query: + boool: {} + + - is_false: valid + - match: {error: '/.+unknown\squery\s\[boool\]\sdid\syou\smean\s\[bool\]\?.+/' } + + - do: + indices.validate_query: + explain: true + + - is_true: valid + - match: {_shards.failed: 0} + - match: {explanations.0.index: 'testing'} + - match: {explanations.0.explanation: '*:*'} + +--- +"Validate body without query element": + - do: + indices.validate_query: + body: + match_all: {} + + - is_false: valid + - is_false: error + + - do: + indices.validate_query: + explain: true + body: + match_all: {} + + - is_false: valid + - match: {error: 'org.elasticsearch.common.ParsingException: request does not support [match_all]'} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/20_query_string.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/20_query_string.yml new file mode 100644 index 0000000000000..2f74aee3a973e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/20_query_string.yml @@ -0,0 +1,50 @@ +--- +"validate_query with query_string parameters": + - do: + indices.create: + index: test + body: + mappings: + properties: + field: + type: text + number: + type: integer + + - do: + indices.validate_query: + index: test + q: bar + df: field + + - is_true: valid + + - do: + indices.validate_query: + index: test + q: field:foo field:xyz + + - is_true: valid + + - do: + indices.validate_query: + index: test + q: field:foo field:xyz + default_operator: AND + + - is_true: valid + + - do: + indices.validate_query: + index: test + q: field:BA* + + - is_true: valid + + - do: + indices.validate_query: + index: test + q: number:foo + lenient: true + + - is_true: valid diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/info/10_info.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/info/10_info.yml new file mode 100644 index 0000000000000..d0c99ee0a7c5b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/info/10_info.yml @@ -0,0 +1,9 @@ +--- +"Info": + - do: {info: {}} + - is_true: name + - is_true: cluster_name + - is_true: cluster_uuid + - is_true: tagline + - is_true: version + - is_true: version.number diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/info/20_lucene_version.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/info/20_lucene_version.yml new file mode 100644 index 0000000000000..83414fbabc565 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/info/20_lucene_version.yml @@ -0,0 +1,7 @@ +--- +"Lucene Version": + - do: {info: {}} + - is_true: version.lucene_version + + + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/ingest/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/ingest/10_basic.yml new file mode 100644 index 0000000000000..e5b9b0fd5ebca --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/ingest/10_basic.yml @@ -0,0 +1,154 @@ +--- +"Test basic pipeline crud": + - do: + ingest.put_pipeline: + id: "my_pipeline" + body: > + { + "description": "_description", + "processors": [ + ] + } + - match: { acknowledged: true } + + - do: + ingest.get_pipeline: + id: "my_pipeline" + - match: { my_pipeline.description: "_description" } + + - do: + ingest.delete_pipeline: + id: "my_pipeline" + - match: { acknowledged: true } + + - do: + catch: missing + ingest.get_pipeline: + id: "my_pipeline" + +--- +"Test Put Versioned Pipeline": + - do: + ingest.put_pipeline: + id: "my_pipeline" + body: > + { + "version": 10, + "processors": [ ] + } + - match: { acknowledged: true } + + - do: + ingest.get_pipeline: + id: "my_pipeline" + - match: { my_pipeline.version: 10 } + + # Lower version + - do: + ingest.put_pipeline: + id: "my_pipeline" + body: > + { + "version": 9, + "processors": [ ] + } + - match: { acknowledged: true } + + - do: + ingest.get_pipeline: + id: "my_pipeline" + - match: { my_pipeline.version: 9 } + + # Higher version + - do: + ingest.put_pipeline: + id: "my_pipeline" + body: > + { + "version": 6789, + "processors": [ ] + } + - match: { acknowledged: true } + + - do: + ingest.get_pipeline: + id: "my_pipeline" + - match: { my_pipeline.version: 6789 } + + # No version + - do: + ingest.put_pipeline: + id: "my_pipeline" + body: > + { + "processors": [ ] + } + - match: { acknowledged: true } + + - do: + ingest.get_pipeline: + id: "my_pipeline" + - is_false: my_pipeline.version + + # Coming back with a version + - do: + ingest.put_pipeline: + id: "my_pipeline" + body: > + { + "version": 5385, + "processors": [ ] + } + - match: { acknowledged: true } + + - do: + ingest.get_pipeline: + id: "my_pipeline" + - match: { my_pipeline.version: 5385 } + + # Able to delete the versioned pipeline + - do: + ingest.delete_pipeline: + id: "my_pipeline" + - match: { acknowledged: true } + + - do: + catch: missing + ingest.get_pipeline: + id: "my_pipeline" +--- +"Test Get All Pipelines": + - do: + ingest.put_pipeline: + id: "first_pipeline" + body: > + { + "description": "first", + "processors": [] + } + - do: + ingest.put_pipeline: + id: "second_pipeline" + body: > + { + "description": "second", + "processors": [] + } + + - do: + ingest.get_pipeline: {} + - match: { first_pipeline.description: "first" } + - match: { second_pipeline.description: "second" } + +--- +"Test invalid config": + - do: + catch: /parse_exception/ + ingest.put_pipeline: + id: "my_pipeline" + body: > + { + "description": "_description", + "processors": [], + "invalid_field" : {} + } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/10_basic.yml new file mode 100644 index 0000000000000..798d699ae80a0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/10_basic.yml @@ -0,0 +1,42 @@ +--- +"Basic multi-get": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_2 + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + indices.refresh: {} + + - do: + mget: + body: + docs: + - { _index: test_2, _id: 1} + - { _index: test_1, _id: 2} + - { _index: test_1, _id: 1} + + - is_false: docs.0.found + - match: { docs.0._index: test_2 } + - match: { docs.0._type: null } + - match: { docs.0._id: "1" } + + - is_false: docs.1.found + - match: { docs.1._index: test_1 } + - match: { docs.1._type: _doc } + - match: { docs.1._id: "2" } + + - is_true: docs.2.found + - match: { docs.2._index: test_1 } + - match: { docs.2._type: _doc } + - match: { docs.2._id: "1" } + - match: { docs.2._version: 1 } + - match: { docs.2._source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/11_default_index_type.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/11_default_index_type.yml new file mode 100644 index 0000000000000..773b7e3bcfe6b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/11_default_index_type.yml @@ -0,0 +1,44 @@ +--- +"Default index/type": + - do: + indices.create: + index: test_2 + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + mget: + index: test_1 + type: test + body: + docs: + - { _index: test_2, _id: 1} + - { _type: none, _id: 1} + - { _id: 2} + - { _id: 1} + + - is_false: docs.0.found + - match: { docs.0._index: test_2 } + - match: { docs.0._type: test } + - match: { docs.0._id: "1" } + + - is_false: docs.1.found + - match: { docs.1._index: test_1 } + - match: { docs.1._type: none } + - match: { docs.1._id: "1" } + + - is_false: docs.2.found + - match: { docs.2._index: test_1 } + - match: { docs.2._type: test } + - match: { docs.2._id: "2" } + + - is_true: docs.3.found + - match: { docs.3._index: test_1 } + - match: { docs.3._type: test } + - match: { docs.3._id: "1" } + - match: { docs.3._version: 1 } + - match: { docs.3._source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/12_non_existent_index.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/12_non_existent_index.yml new file mode 100644 index 0000000000000..a1101a903f896 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/12_non_existent_index.yml @@ -0,0 +1,33 @@ +--- +"Non-existent index": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + mget: + body: + docs: + - { _index: test_2, _id: 1} + + - is_false: docs.0.found + - match: { docs.0._index: test_2 } + - match: { docs.0._type: null } + - match: { docs.0._id: "1" } + + - do: + mget: + body: + docs: + - { _index: test_1, _id: 1} + + - is_true: docs.0.found + - match: { docs.0._index: test_1 } + - match: { docs.0._type: _doc } + - match: { docs.0._id: "1" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/13_missing_metadata.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/13_missing_metadata.yml new file mode 100644 index 0000000000000..2711bed58dbb1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/13_missing_metadata.yml @@ -0,0 +1,49 @@ +--- +"Missing metadata": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + catch: /action_request_validation_exception.+ id is missing/ + mget: + body: + docs: + - { _index: test_1 } + + - do: + catch: /action_request_validation_exception.+ index is missing/ + mget: + body: + docs: + - { _id: 1 } + + - do: + catch: /action_request_validation_exception.+ no documents to get/ + mget: + body: + docs: [] + + - do: + catch: /action_request_validation_exception.+ no documents to get/ + mget: + body: {} + + - do: + mget: + body: + docs: + - { _index: test_1, _id: 1} + + - is_true: docs.0.found + - match: { docs.0._index: test_1 } + - match: { docs.0._type: _doc } + - match: { docs.0._id: "1" } + - match: { docs.0._version: 1 } + - match: { docs.0._source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/14_alias_to_multiple_indices.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/14_alias_to_multiple_indices.yml new file mode 100644 index 0000000000000..4ee569956397c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/14_alias_to_multiple_indices.yml @@ -0,0 +1,45 @@ +--- +"Multi Get with alias that resolves to multiple indices": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + bulk: + refresh: true + body: | + {"index": {"_index": "test_1", "_type": "_doc", "_id": 1}} + { "foo": "bar" } + {"index": {"_index": "test_2", "_type": "_doc", "_id": 2}} + { "foo": "bar" } + {"index": {"_index": "test_3", "_type": "_doc", "_id": 3}} + { "foo": "bar" } + + - do: + indices.put_alias: + index: test_2 + name: test_two_and_three + + - do: + indices.put_alias: + index: test_3 + name: test_two_and_three + + - do: + mget: + body: + docs: + - { _index: test_1, _id: 1} + - { _index: test_two_and_three, _id: 2} + + - is_true: docs.0.found + - match: { docs.0._index: test_1 } + - match: { docs.0._type: _doc } + - match: { docs.0._id: "1" } + + - is_false: docs.1.found + - match: { docs.1._index: test_two_and_three } + - match: { docs.1._type: null } + - match: { docs.1._id: "2" } + - match: { docs.1.error.root_cause.0.type: "illegal_argument_exception" } + - match: { docs.1.error.root_cause.0.reason: "/Alias.\\[test_two_and_three\\].has.more.than.one.indices.associated.with.it.\\[\\[test_[23]{1},.test_[23]{1}\\]\\],.can't.execute.a.single.index.op/" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/15_ids.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/15_ids.yml new file mode 100644 index 0000000000000..fbdc9b265a95a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/15_ids.yml @@ -0,0 +1,73 @@ +--- +"IDs": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + index: + index: test_1 + id: 2 + body: { foo: baz } + + - do: + mget: + index: test_1 + body: + ids: [1, 3] + + - is_true: docs.0.found + - match: { docs.0._index: test_1 } + - match: { docs.0._type: _doc } + - match: { docs.0._id: "1" } + - match: { docs.0._version: 1 } + - match: { docs.0._source: { foo: bar }} + + - is_false: docs.1.found + - match: { docs.1._index: test_1 } + - match: { docs.1._type: _doc } + - match: { docs.1._id: "3" } + + - do: + mget: + index: test_1 + body: + ids: [1, 2] + + - is_true: docs.0.found + - match: { docs.0._index: test_1 } + - match: { docs.0._type: _doc } + - match: { docs.0._id: "1" } + - match: { docs.0._version: 1 } + - match: { docs.0._source: { foo: bar }} + + - is_true: docs.1.found + - match: { docs.1._index: test_1 } + - match: { docs.1._type: _doc } + - match: { docs.1._id: "2" } + - match: { docs.1._version: 1 } + - match: { docs.1._source: { foo: baz }} + + + - do: + catch: /action_request_validation_exception.+ no documents to get/ + mget: + index: test_1 + body: + ids: [] + + - do: + catch: /action_request_validation_exception.+ no documents to get/ + mget: + index: test_1 + body: {} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/16_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/16_basic_with_types.yml new file mode 100644 index 0000000000000..0850772ad426c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/16_basic_with_types.yml @@ -0,0 +1,45 @@ +--- +"Basic multi-get": + - do: + indices.create: + index: test_2 + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + indices.refresh: {} + + - do: + mget: + body: + docs: + - { _index: test_2, _type: test, _id: 1} + - { _index: test_1, _type: none, _id: 1} + - { _index: test_1, _type: test, _id: 2} + - { _index: test_1, _type: test, _id: 1} + + - is_false: docs.0.found + - match: { docs.0._index: test_2 } + - match: { docs.0._type: test } + - match: { docs.0._id: "1" } + + - is_false: docs.1.found + - match: { docs.1._index: test_1 } + - match: { docs.1._type: none } + - match: { docs.1._id: "1" } + + - is_false: docs.2.found + - match: { docs.2._index: test_1 } + - match: { docs.2._type: test } + - match: { docs.2._id: "2" } + + - is_true: docs.3.found + - match: { docs.3._index: test_1 } + - match: { docs.3._type: test } + - match: { docs.3._id: "1" } + - match: { docs.3._version: 1 } + - match: { docs.3._source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/17_default_index.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/17_default_index.yml new file mode 100644 index 0000000000000..d03f99be39517 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/17_default_index.yml @@ -0,0 +1,40 @@ +--- +"Default index/type": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_2 + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + mget: + index: test_1 + body: + docs: + - { _index: test_2, _id: 1} + - { _id: 2} + - { _id: 1} + + - is_false: docs.0.found + - match: { docs.0._index: test_2 } + - match: { docs.0._type: null } + - match: { docs.0._id: "1" } + + - is_false: docs.1.found + - match: { docs.1._index: test_1 } + - match: { docs.1._type: _doc } + - match: { docs.1._id: "2" } + + - is_true: docs.2.found + - match: { docs.2._index: test_1 } + - match: { docs.2._type: _doc } + - match: { docs.2._id: "1" } + - match: { docs.2._version: 1 } + - match: { docs.2._source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/18_non_existent_index_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/18_non_existent_index_with_types.yml new file mode 100644 index 0000000000000..0623464225072 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/18_non_existent_index_with_types.yml @@ -0,0 +1,30 @@ +--- +"Non-existent index": + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + mget: + body: + docs: + - { _index: test_2, _type: test, _id: 1} + + - is_false: docs.0.found + - match: { docs.0._index: test_2 } + - match: { docs.0._type: test } + - match: { docs.0._id: "1" } + + - do: + mget: + body: + docs: + - { _index: test_1, _type: test, _id: 1} + + - is_true: docs.0.found + - match: { docs.0._index: test_1 } + - match: { docs.0._type: test } + - match: { docs.0._id: "1" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/19_missing_metadata_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/19_missing_metadata_with_types.yml new file mode 100644 index 0000000000000..d7af1797f7a40 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/19_missing_metadata_with_types.yml @@ -0,0 +1,47 @@ +--- +"Missing metadata": + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + catch: /action_request_validation_exception.+ id is missing/ + mget: + body: + docs: + - { _index: test_1, _type: test} + + - do: + catch: /action_request_validation_exception.+ index is missing/ + mget: + body: + docs: + - { _type: test, _id: 1} + + - do: + catch: /action_request_validation_exception.+ no documents to get/ + mget: + body: + docs: [] + + - do: + catch: /action_request_validation_exception.+ no documents to get/ + mget: + body: {} + + - do: + mget: + body: + docs: + - { _index: test_1, _id: 1} + + - is_true: docs.0.found + - match: { docs.0._index: test_1 } + - match: { docs.0._type: test } + - match: { docs.0._id: "1" } + - match: { docs.0._version: 1 } + - match: { docs.0._source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/20_stored_fields.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/20_stored_fields.yml new file mode 100644 index 0000000000000..45460deb04e0b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/20_stored_fields.yml @@ -0,0 +1,115 @@ +--- +"Stored fields": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + mappings: + properties: + foo: + type: keyword + store: true + count: + type: integer + store: true + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + mget: + index: test_1 + body: + docs: + - { _id: 1 } + - { _id: 1, stored_fields: foo } + - { _id: 1, stored_fields: [foo] } + - { _id: 1, stored_fields: [foo, _source] } + + - is_false: docs.0.fields + - match: { docs.0._source: { foo: bar }} + + - match: { docs.1.fields.foo: [bar] } + - is_false: docs.1._source + + - match: { docs.2.fields.foo: [bar] } + - is_false: docs.2._source + + - match: { docs.3.fields.foo: [bar] } + - match: { docs.3._source: { foo: bar }} + + - do: + mget: + index: test_1 + stored_fields: foo + body: + docs: + - { _id: 1 } + - { _id: 1, stored_fields: foo } + - { _id: 1, stored_fields: [foo] } + - { _id: 1, stored_fields: [foo, _source] } + + - match: { docs.0.fields.foo: [bar] } + - is_false: docs.0._source + + - match: { docs.1.fields.foo: [bar] } + - is_false: docs.1._source + + - match: { docs.2.fields.foo: [bar] } + - is_false: docs.2._source + + - match: { docs.3.fields.foo: [bar] } + - match: { docs.3._source: { foo: bar }} + + - do: + mget: + index: test_1 + stored_fields: [foo] + body: + docs: + - { _id: 1 } + - { _id: 1, stored_fields: foo } + - { _id: 1, stored_fields: [foo] } + - { _id: 1, stored_fields: [foo, _source] } + + - match: { docs.0.fields.foo: [bar] } + - is_false: docs.0._source + + - match: { docs.1.fields.foo: [bar] } + - is_false: docs.1._source + + - match: { docs.2.fields.foo: [bar] } + - is_false: docs.2._source + + - match: { docs.3.fields.foo: [bar] } + - match: { docs.3._source: { foo: bar }} + + - do: + mget: + index: test_1 + stored_fields: [foo, _source] + body: + docs: + - { _id: 1 } + - { _id: 1, stored_fields: foo } + - { _id: 1, stored_fields: [foo] } + - { _id: 1, stored_fields: [foo, _source] } + + - match: { docs.0.fields.foo: [bar] } + - match: { docs.0._source: { foo: bar }} + + - match: { docs.1.fields.foo: [bar] } + - is_false: docs.1._source + + - match: { docs.2.fields.foo: [bar] } + - is_false: docs.2._source + + - match: { docs.3.fields.foo: [bar] } + - match: { docs.3._source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/21_alias_to_multiple_indices_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/21_alias_to_multiple_indices_with_types.yml new file mode 100644 index 0000000000000..3a0fec04738b6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/21_alias_to_multiple_indices_with_types.yml @@ -0,0 +1,42 @@ +--- +"Multi Get with alias that resolves to multiple indices": + + - do: + bulk: + refresh: true + body: | + {"index": {"_index": "test_1", "_type": "test", "_id": 1}} + { "foo": "bar" } + {"index": {"_index": "test_2", "_type": "test", "_id": 2}} + { "foo": "bar" } + {"index": {"_index": "test_3", "_type": "test", "_id": 3}} + { "foo": "bar" } + + - do: + indices.put_alias: + index: test_2 + name: test_two_and_three + + - do: + indices.put_alias: + index: test_3 + name: test_two_and_three + + - do: + mget: + body: + docs: + - { _index: test_1, _type: test, _id: 1} + - { _index: test_two_and_three, _type: test, _id: 2} + + - is_true: docs.0.found + - match: { docs.0._index: test_1 } + - match: { docs.0._type: test } + - match: { docs.0._id: "1" } + + - is_false: docs.1.found + - match: { docs.1._index: test_two_and_three } + - match: { docs.1._type: test } + - match: { docs.1._id: "2" } + - match: { docs.1.error.root_cause.0.type: "illegal_argument_exception" } + - match: { docs.1.error.root_cause.0.reason: "/Alias.\\[test_two_and_three\\].has.more.than.one.indices.associated.with.it.\\[\\[test_[23]{1},.test_[23]{1}\\]\\],.can't.execute.a.single.index.op/" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/22_ids_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/22_ids_with_types.yml new file mode 100644 index 0000000000000..6c233e4d92a9c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/22_ids_with_types.yml @@ -0,0 +1,72 @@ +--- +"IDs": + - do: + indices.create: + index: test_1 + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + index: + index: test_1 + type: test + id: 2 + body: { foo: baz } + + - do: + mget: + index: test_1 + type: test + body: + ids: [1, 3] + + - is_true: docs.0.found + - match: { docs.0._index: test_1 } + - match: { docs.0._type: test } + - match: { docs.0._id: "1" } + - match: { docs.0._version: 1 } + - match: { docs.0._source: { foo: bar }} + + - is_false: docs.1.found + - match: { docs.1._index: test_1 } + - match: { docs.1._type: test } + - match: { docs.1._id: "3" } + + - do: + mget: + index: test_1 + body: + ids: [1, 2] + + - is_true: docs.0.found + - match: { docs.0._index: test_1 } + - match: { docs.0._type: test } + - match: { docs.0._id: "1" } + - match: { docs.0._version: 1 } + - match: { docs.0._source: { foo: bar }} + + - is_true: docs.1.found + - match: { docs.1._index: test_1 } + - match: { docs.1._type: test } + - match: { docs.1._id: "2" } + - match: { docs.1._version: 1 } + - match: { docs.1._source: { foo: baz }} + + + - do: + catch: /action_request_validation_exception.+ no documents to get/ + mget: + index: test_1 + body: + ids: [] + + - do: + catch: /action_request_validation_exception.+ no documents to get/ + mget: + index: test_1 + body: {} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/23_stored_fields_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/23_stored_fields_with_types.yml new file mode 100644 index 0000000000000..05b9738d46180 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/23_stored_fields_with_types.yml @@ -0,0 +1,120 @@ +--- +"Stored fields": + + - do: + indices.create: + include_type_name: true + index: test_1 + body: + mappings: + test: + properties: + foo: + type: keyword + store: true + count: + type: integer + store: true + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + mget: + index: test_1 + type: test + body: + docs: + - { _id: 1 } + - { _id: 1, stored_fields: foo } + - { _id: 1, stored_fields: [foo] } + - { _id: 1, stored_fields: [foo, _source] } + + - is_false: docs.0.fields + - match: { docs.0._source: { foo: bar }} + + - match: { docs.1.fields.foo: [bar] } + - is_false: docs.1._source + + - match: { docs.2.fields.foo: [bar] } + - is_false: docs.2._source + + - match: { docs.3.fields.foo: [bar] } + - match: { docs.3._source: { foo: bar }} + + - do: + mget: + index: test_1 + type: test + stored_fields: foo + body: + docs: + - { _id: 1 } + - { _id: 1, stored_fields: foo } + - { _id: 1, stored_fields: [foo] } + - { _id: 1, stored_fields: [foo, _source] } + + - match: { docs.0.fields.foo: [bar] } + - is_false: docs.0._source + + - match: { docs.1.fields.foo: [bar] } + - is_false: docs.1._source + + - match: { docs.2.fields.foo: [bar] } + - is_false: docs.2._source + + - match: { docs.3.fields.foo: [bar] } + - match: { docs.3._source: { foo: bar }} + + - do: + mget: + index: test_1 + type: test + stored_fields: [foo] + body: + docs: + - { _id: 1 } + - { _id: 1, stored_fields: foo } + - { _id: 1, stored_fields: [foo] } + - { _id: 1, stored_fields: [foo, _source] } + + - match: { docs.0.fields.foo: [bar] } + - is_false: docs.0._source + + - match: { docs.1.fields.foo: [bar] } + - is_false: docs.1._source + + - match: { docs.2.fields.foo: [bar] } + - is_false: docs.2._source + + - match: { docs.3.fields.foo: [bar] } + - match: { docs.3._source: { foo: bar }} + + - do: + mget: + index: test_1 + type: test + stored_fields: [foo, _source] + body: + docs: + - { _id: 1 } + - { _id: 1, stored_fields: foo } + - { _id: 1, stored_fields: [foo] } + - { _id: 1, stored_fields: [foo, _source] } + + - match: { docs.0.fields.foo: [bar] } + - match: { docs.0._source: { foo: bar }} + + - match: { docs.1.fields.foo: [bar] } + - is_false: docs.1._source + + - match: { docs.2.fields.foo: [bar] } + - is_false: docs.2._source + + - match: { docs.3.fields.foo: [bar] } + - match: { docs.3._source: { foo: bar }} + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/40_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/40_routing.yml new file mode 100644 index 0000000000000..df2924f274bdf --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/40_routing.yml @@ -0,0 +1,45 @@ +--- +"Routing": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + id: 1 + routing: 5 + body: { foo: bar } + + - do: + mget: + index: test_1 + stored_fields: [_routing] + body: + docs: + - { _id: 1 } + - { _id: 1, routing: 4 } + - { _id: 1, routing: 5 } + + - is_false: docs.0.found + - is_false: docs.1.found + + - is_true: docs.2.found + - match: { docs.2._index: test_1 } + - match: { docs.2._type: _doc } + - match: { docs.2._id: "1" } + - match: { docs.2._routing: "5" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/41_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/41_routing_with_types.yml new file mode 100644 index 0000000000000..d550dd26657c9 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/41_routing_with_types.yml @@ -0,0 +1,44 @@ +--- +"Routing": + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + type: test + id: 1 + routing: 5 + body: { foo: bar } + + - do: + mget: + index: test_1 + type: test + stored_fields: [_routing] + body: + docs: + - { _id: 1 } + - { _id: 1, routing: 4 } + - { _id: 1, routing: 5 } + + - is_false: docs.0.found + - is_false: docs.1.found + + - is_true: docs.2.found + - match: { docs.2._index: test_1 } + - match: { docs.2._type: test } + - match: { docs.2._id: "1" } + - match: { docs.2._routing: "5" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/60_realtime_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/60_realtime_refresh.yml new file mode 100644 index 0000000000000..3b1bfcdca556c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/60_realtime_refresh.yml @@ -0,0 +1,52 @@ +--- +"Realtime Refresh": + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + settings: + index: + refresh_interval: -1 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + mget: + index: test_1 + realtime: false + body: + ids: [1] + + - is_false: docs.0.found + + - do: + mget: + index: test_1 + realtime: true + body: + ids: [1] + + - is_true: docs.0.found + + - do: + mget: + index: test_1 + realtime: false + refresh: true + body: + ids: [1] + + - is_true: docs.0.found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/61_realtime_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/61_realtime_refresh_with_types.yml new file mode 100644 index 0000000000000..0cb7b71cf4368 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/61_realtime_refresh_with_types.yml @@ -0,0 +1,53 @@ +--- +"Realtime Refresh": + + - do: + indices.create: + index: test_1 + body: + settings: + index: + refresh_interval: -1 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + mget: + index: test_1 + type: test + realtime: false + body: + ids: [1] + + - is_false: docs.0.found + + - do: + mget: + index: test_1 + type: test + realtime: true + body: + ids: [1] + + - is_true: docs.0.found + + - do: + mget: + index: test_1 + type: test + realtime: false + refresh: true + body: + ids: [1] + + - is_true: docs.0.found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/70_source_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/70_source_filtering.yml new file mode 100644 index 0000000000000..3a3086cf3616d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/70_source_filtering.yml @@ -0,0 +1,121 @@ +setup: + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } + - do: + index: + index: test_1 + id: 2 + body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } + +--- +"Source filtering - true/false": + + - do: + mget: + body: + docs: + - { _index: "test_1", _id: "1", _source: false } + - { _index: "test_1", _id: "2", _source: true } + + - match: { docs.0._id: "1" } + - is_false: docs.0._source + - match: { docs.1._id: "2" } + - is_true: docs.1._source + +--- +"Source filtering - include field": + + - do: + mget: + body: + docs: + - { _index: "test_1", _id: "1", _source: include.field1 } + - { _index: "test_1", _id: "2", _source: [ include.field1 ] } + + - match: { docs.0._source: { include: { field1: v1 }} } + - match: { docs.1._source: { include: { field1: v1 }} } + + +--- +"Source filtering - include nested field": + + - do: + mget: + body: + docs: + - { _index: "test_1", _id: "1", _source: { include: include.field1 } } + - { _index: "test_1", _id: "2", _source: { include: [ include.field1 ] } } + + - match: { docs.0._source: { include: { field1: v1 }} } + - match: { docs.1._source: { include: { field1: v1 }} } + +--- +"Source filtering - exclude field": + + - do: + mget: + body: + docs: + - { _index: "test_1", _id: "1", _source: { include: [ include ], exclude: [ "*.field2" ] } } + + - match: { docs.0._source: { include: { field1: v1 }} } + +--- +"Source filtering - ids and true/false": + + - do: + mget: + _source: false + index: test_1 + body: { ids: [ 1,2 ] } + - is_false: docs.0._source + - is_false: docs.1._source + + - do: + mget: + _source: true + index: test_1 + body: { ids: [ 1,2 ] } + - is_true: docs.0._source + - is_true: docs.1._source + +--- +"Source filtering - ids and include field": + + - do: + mget: + _source: include.field1 + index: test_1 + body: { ids: [ 1,2 ] } + - match: { docs.0._source: { include: { field1: v1 }} } + - match: { docs.1._source: { include: { field1: v1 }} } + +--- +"Source filtering - ids and include nested field": + + - do: + mget: + _source_includes: "include.field1,count" + index: test_1 + body: { ids: [ 1,2 ] } + - match: { docs.0._source: { include: { field1: v1 }, count: 1} } + - match: { docs.1._source: { include: { field1: v1 }, count: 1} } + +--- +"Source filtering - ids and exclude field": + + - do: + mget: + _source_includes: include + _source_excludes: "*.field2" + index: test_1 + body: { ids: [ 1,2 ] } + - match: { docs.0._source: { include: { field1: v1 } } } + - match: { docs.1._source: { include: { field1: v1 } } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/71_source_filtering_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/71_source_filtering_with_types.yml new file mode 100644 index 0000000000000..4581e060b41a7 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/71_source_filtering_with_types.yml @@ -0,0 +1,119 @@ +setup: + - do: + index: + index: test_1 + type: test + id: 1 + body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } + - do: + index: + index: test_1 + type: test + id: 2 + body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } + +--- +"Source filtering - true/false": + + - do: + mget: + body: + docs: + - { _index: "test_1", _type: "test", _id: "1", _source: false } + - { _index: "test_1", _type: "test", _id: "2", _source: true } + + - match: { docs.0._id: "1" } + - is_false: docs.0._source + - match: { docs.1._id: "2" } + - is_true: docs.1._source + +--- +"Source filtering - include field": + + - do: + mget: + body: + docs: + - { _index: "test_1", _type: "test", _id: "1", _source: include.field1 } + - { _index: "test_1", _type: "test", _id: "2", _source: [ include.field1 ] } + + - match: { docs.0._source: { include: { field1: v1 }} } + - match: { docs.1._source: { include: { field1: v1 }} } + + +--- +"Source filtering - include nested field": + + - do: + mget: + body: + docs: + - { _index: "test_1", _type: "test", _id: "1", _source: { include: include.field1 } } + - { _index: "test_1", _type: "test", _id: "2", _source: { include: [ include.field1 ] } } + + - match: { docs.0._source: { include: { field1: v1 }} } + - match: { docs.1._source: { include: { field1: v1 }} } + +--- +"Source filtering - exclude field": + + - do: + mget: + body: + docs: + - { _index: "test_1", _type: "test", _id: "1", _source: { include: [ include ], exclude: [ "*.field2" ] } } + + - match: { docs.0._source: { include: { field1: v1 }} } + +--- +"Source filtering - ids and true/false": + + - do: + mget: + _source: false + index: test_1 + body: { ids: [ 1,2 ] } + - is_false: docs.0._source + - is_false: docs.1._source + + - do: + mget: + _source: true + index: test_1 + body: { ids: [ 1,2 ] } + - is_true: docs.0._source + - is_true: docs.1._source + +--- +"Source filtering - ids and include field": + + - do: + mget: + _source: include.field1 + index: test_1 + body: { ids: [ 1,2 ] } + - match: { docs.0._source: { include: { field1: v1 }} } + - match: { docs.1._source: { include: { field1: v1 }} } + +--- +"Source filtering - ids and include nested field": + + - do: + mget: + _source_includes: "include.field1,count" + index: test_1 + body: { ids: [ 1,2 ] } + - match: { docs.0._source: { include: { field1: v1 }, count: 1} } + - match: { docs.1._source: { include: { field1: v1 }, count: 1} } + +--- +"Source filtering - ids and exclude field": + + - do: + mget: + _source_includes: include + _source_excludes: "*.field2" + index: test_1 + body: { ids: [ 1,2 ] } + - match: { docs.0._source: { include: { field1: v1 } } } + - match: { docs.1._source: { include: { field1: v1 } } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated.yml new file mode 100644 index 0000000000000..0283455350a80 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated.yml @@ -0,0 +1,35 @@ + +--- +"Deprecated parameters should fail in Multi Get query": + - skip: + version: " - 6.99.99" + reason: _version, _routing are removed starting from 7.0, their equivalents without underscore are used instead + features: "warnings" + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + index: + index: test_1 + id: 2 + body: { foo: baz } + + - do: + catch: bad_request + mget: + body: + docs: + - { _index: test_1, _id: 1, _routing : test1 } + - { _index: test_1, _id: 2, _routing : test1 } + + - do: + catch: bad_request + mget: + body: + docs: + - { _index: test_1, _id: 1, _version : 1 } + - { _index: test_1, _id: 2, _version : 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated_with_types.yml new file mode 100644 index 0000000000000..5033f75c79426 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated_with_types.yml @@ -0,0 +1,38 @@ + +--- +"Deprecated parameters should fail in Multi Get query": + + - skip: + version: " - 6.99.99" + reason: _version, _routing are removed starting from 7.0, their equivalents without underscore are used instead + features: "warnings" + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + index: + index: test_1 + type: test + id: 2 + body: { foo: baz } + + - do: + catch: bad_request + mget: + body: + docs: + - { _index: test_1, _type: test, _id: 1, _routing : test1 } + - { _index: test_1, _type: test, _id: 2, _routing : test1 } + + - do: + catch: bad_request + mget: + body: + docs: + - { _index: test_1, _type: test, _id: 1, _version : 1 } + - { _index: test_1, _type: test, _id: 2, _version : 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/TODO.txt new file mode 100644 index 0000000000000..340ff579b41e0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/TODO.txt @@ -0,0 +1,3 @@ +Tests missing for: + +# preference diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/10_basic.yml new file mode 100644 index 0000000000000..243d953811336 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/10_basic.yml @@ -0,0 +1,42 @@ +--- +"Basic mlt": + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_replicas: 0 + mappings: + properties: + foo: + type : "text" + title: + type : "text" + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar, title: howdy } + + - do: + indices.refresh: {} + + - do: + cluster.health: + wait_for_status: green + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: + more_like_this: + like: + - + _id: 1 + fields: ["title"] + + - match: {hits.total: 0} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/20_docs.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/20_docs.yml new file mode 100644 index 0000000000000..bb1b25a0dcb40 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/20_docs.yml @@ -0,0 +1,57 @@ +--- +"Basic mlt query with docs": + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + index: + index: test_1 + id: 2 + body: { foo: baz } + + - do: + index: + index: test_1 + id: 3 + body: { foo: foo } + + - do: + indices.refresh: {} + + - do: + cluster.health: + wait_for_status: green + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: + more_like_this: + like: + - + _index: test_1 + _type: _doc + doc: + foo: bar + - + _index: test_1 + _type: _doc + _id: 2 + - + _id: 3 + include: true + min_doc_freq: 0 + min_term_freq: 0 + + - match: { hits.total: 3 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/30_unlike.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/30_unlike.yml new file mode 100644 index 0000000000000..abea4c8fbe57a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/30_unlike.yml @@ -0,0 +1,53 @@ +--- +"Basic mlt query with unlike": + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + - do: + index: + index: test_1 + id: 1 + body: { foo: bar baz selected } + + - do: + index: + index: test_1 + id: 2 + body: { foo: bar } + + - do: + index: + index: test_1 + id: 3 + body: { foo: bar baz } + + - do: + indices.refresh: {} + + - do: + cluster.health: + wait_for_status: green + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: + more_like_this: + like: + _index: test_1 + _type: _doc + _id: 1 + unlike: + _index: test_1 + _type: _doc + _id: 3 + include: true + min_doc_freq: 0 + min_term_freq: 0 + + - match: { hits.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/10_basic.yml new file mode 100644 index 0000000000000..5b092c9d15e44 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/10_basic.yml @@ -0,0 +1,152 @@ +--- +setup: + + - do: + index: + index: index_1 + id: 1 + body: { foo: bar } + + - do: + index: + index: index_1 + id: 2 + body: { foo: baz } + + - do: + index: + index: index_1 + id: 3 + body: { foo: foo } + + - do: + index: + index: index_2 + id: 1 + body: { foo: foo } + + - do: + indices.refresh: {} + +--- +"Basic multi-search": + + - do: + msearch: + rest_total_hits_as_int: true + body: + - index: index_* + - query: + match: {foo: foo} + - index: index_2 + - query: + match_all: {} + - index: index_1 + - query: + match: {foo: foo} + - index: index_3 + - query: + match_all: {} + - {} + - query: + match_all: {} + + - match: { responses.0.hits.total: 2 } + - match: { responses.1.hits.total: 1 } + - match: { responses.2.hits.total: 1 } + - match: { responses.3.error.root_cause.0.type: index_not_found_exception } + - match: { responses.3.error.root_cause.0.reason: "/no.such.index/" } + - match: { responses.3.error.root_cause.0.index: index_3 } + - match: { responses.4.hits.total: 4 } + +--- +"Least impact smoke test": +# only passing these parameters to make sure they are consumed + - do: + msearch: + rest_total_hits_as_int: true + max_concurrent_shard_requests: 1 + max_concurrent_searches: 1 + body: + - index: index_* + - query: + match: {foo: foo} + - index: index_2 + - query: + match_all: {} + - index: index_1 + - query: + match: {foo: foo} + - index: index_3 + - query: + match_all: {} + - {} + - query: + match_all: {} + + - match: { responses.0.hits.total: 2 } + - match: { responses.1.hits.total: 1 } + - match: { responses.2.hits.total: 1 } + - match: { responses.3.error.root_cause.0.type: index_not_found_exception } + - match: { responses.3.error.root_cause.0.reason: "/no.such.index/" } + - match: { responses.3.error.root_cause.0.index: index_3 } + - match: { responses.4.hits.total: 4 } + +--- +"Search with new response format": + - skip: + version: " - 6.99.99" + reason: hits.total is returned as an object in 7.0.0 + + - do: + msearch: + body: + - index: index_* + - query: + match: {foo: foo} + - index: index_2 + - query: + match_all: {} + - index: index_1 + - query: + match: {foo: foo} + + - match: { responses.0.hits.total.value: 2 } + - match: { responses.0.hits.total.relation: eq } + - match: { responses.1.hits.total.value: 1 } + - match: { responses.1.hits.total.relation: eq } + - match: { responses.2.hits.total.value: 1 } + - match: { responses.2.hits.total.relation: eq } + + - do: + msearch: + body: + - index: index_* + - { query: { match: {foo: foo}}, track_total_hits: 1 } + - index: index_2 + - query: + match_all: {} + - index: index_1 + - query: + match: {foo: foo} + + - match: { responses.0.hits.total.value: 1 } + - match: { responses.0.hits.total.relation: gte } + - match: { responses.1.hits.total.value: 1 } + - match: { responses.1.hits.total.relation: eq } + - match: { responses.2.hits.total.value: 1 } + - match: { responses.2.hits.total.relation: eq } + + - do: + catch: /\[rest_total_hits_as_int\] cannot be used if the tracking of total hits is not accurate, got 10/ + msearch: + rest_total_hits_as_int: true + body: + - index: index_* + - { query: { match_all: {}}, track_total_hits: 10} + - index: index_2 + - query: + match_all: {} + - index: index_1 + - query: + match: {foo: foo} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/11_status.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/11_status.yml new file mode 100644 index 0000000000000..d3c1916b2c508 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/11_status.yml @@ -0,0 +1,20 @@ +--- +setup: + - do: + indices.create: + index: test_1 +--- +"Check Status": + - do: + msearch: + rest_total_hits_as_int: true + body: + - index: test_2 + - query: + match_all: {} + - index: test_1 + - query: + match_all: {} + + - match: { responses.0.status: 404 } + - match: { responses.1.status: 200 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/12_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/12_basic_with_types.yml new file mode 100644 index 0000000000000..64e88de404ab7 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/12_basic_with_types.yml @@ -0,0 +1,97 @@ +--- +setup: + + - do: + index: + index: index_1 + type: test + id: 1 + body: { foo: bar } + + - do: + index: + index: index_1 + type: test + id: 2 + body: { foo: baz } + + - do: + index: + index: index_1 + type: test + id: 3 + body: { foo: foo } + + - do: + index: + index: index_2 + type: test + id: 1 + body: { foo: foo } + + - do: + indices.refresh: {} + +--- +"Basic multi-search": + + - do: + msearch: + rest_total_hits_as_int: true + body: + - index: index_* + - query: + match: {foo: foo} + - index: index_2 + - query: + match_all: {} + - index: index_1 + - query: + match: {foo: foo} + - index: index_3 + - query: + match_all: {} + - type: test + - query: + match_all: {} + + - match: { responses.0.hits.total: 2 } + - match: { responses.1.hits.total: 1 } + - match: { responses.2.hits.total: 1 } + - match: { responses.3.error.root_cause.0.type: index_not_found_exception } + - match: { responses.3.error.root_cause.0.reason: "/no.such.index/" } + - match: { responses.3.error.root_cause.0.index: index_3 } + - match: { responses.4.hits.total: 4 } + +--- +"Least impact smoke test": +# only passing these parameters to make sure they are consumed + - do: + msearch: + rest_total_hits_as_int: true + max_concurrent_shard_requests: 1 + max_concurrent_searches: 1 + body: + - index: index_* + - query: + match: {foo: foo} + - index: index_2 + - query: + match_all: {} + - index: index_1 + - query: + match: {foo: foo} + - index: index_3 + - query: + match_all: {} + - type: test + - query: + match_all: {} + + - match: { responses.0.hits.total: 2 } + - match: { responses.1.hits.total: 1 } + - match: { responses.2.hits.total: 1 } + - match: { responses.3.error.root_cause.0.type: index_not_found_exception } + - match: { responses.3.error.root_cause.0.reason: "/no.such.index/" } + - match: { responses.3.error.root_cause.0.index: index_3 } + - match: { responses.4.hits.total: 4 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/20_typed_keys.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/20_typed_keys.yml new file mode 100644 index 0000000000000..0be04fd01c0ed --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/20_typed_keys.yml @@ -0,0 +1,112 @@ +--- +setup: + - do: + indices.create: + index: test-0 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + index_start_at: + type: integer + integer: + type: integer + float: + type: float + name: + type: keyword + title: + type: completion + + - do: + indices.create: + index: test-1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + index_start_at: + type: integer + integer: + type: integer + float: + type: float + name: + type: keyword + title: + type: completion + + - do: + bulk: + refresh: true + body: + - '{"index": {"_index": "test-0"}}' + - '{"row": 1, "index_start_at": 56, "integer": 38, "float": 12.5713, "name": "Ruth", "bool": true, "title": "doctor"}' + - '{"index": {"_index": "test-0"}}' + - '{"row": 2, "index_start_at": 57, "integer": 42, "float": 15.3393, "name": "Jackie", "bool": false}' + - '{"index": {"_index": "test-1"}}' + - '{"row": 3, "index_start_at": 58, "integer": 29, "float": 19.0517, "name": "Stephanie", "bool": true}' + - '{"index": {"_index": "test-1"}}' + - '{"row": 4, "index_start_at": 59, "integer": 19, "float": 19.3717, "bool": true, "title": "commandant"}' + - '{"index": {"_index": "test-1"}}' + - '{"row": 5, "index_start_at": 60, "integer": 0, "float": 17.3349, "name": "Natalie", "bool": false}' + +--- +"Multisearch test with typed_keys parameter": + - do: + msearch: + rest_total_hits_as_int: true + typed_keys: true + body: + # Testing aggegrations + - index: test-* + - {query: {match: {bool: true} }, size: 0, aggs: {test_filter: {filter: {range: {integer: {gte: 20} } } } } } + - index: test-1 + - {query: {match_all: {} }, size: 0, aggs: {test_range: {range: {field: float, ranges: [ {to: 19.2499999}, {from: 19.25} ] } } } } + - index: test-* + - {query: {bool: {filter: {range: {row: {lt: 5}}} } }, size: 0, aggs: {test_percentiles: {percentiles: {field: float} } } } + # Testing suggesters + - index: test-* + - {query: {match_all: {} }, size: 0, suggest: {term_suggester: {text: Natalie, term: {field: name } } } } + - index: test-* + - {query: {match_all: {} }, size: 0, suggest: {completion_suggester: {prefix: doc, completion: {field: title } } } } + - index: test-* + - {query: {match_all: {} }, size: 0, suggest: {phrase_suggester: {text: Ruht, phrase: {field: name } } } } + + - match: { responses.0.hits.total: 3 } + - match: { responses.0.aggregations.filter#test_filter.doc_count : 2 } + - match: { responses.1.hits.total: 3 } + - match: { responses.1.aggregations.range#test_range.buckets.0.key : "*-19.2499999" } + - match: { responses.1.aggregations.range#test_range.buckets.0.doc_count : 2 } + - match: { responses.1.aggregations.range#test_range.buckets.1.key : "19.25-*" } + - match: { responses.1.aggregations.range#test_range.buckets.1.doc_count : 1 } + - match: { responses.2.hits.total: 4 } + - is_true: responses.2.aggregations.tdigest_percentiles#test_percentiles.values + - is_true: responses.3.suggest.term#term_suggester + - is_true: responses.4.suggest.completion#completion_suggester + - is_true: responses.5.suggest.phrase#phrase_suggester + +--- +"Multisearch test with typed_keys parameter for sampler and significant terms": + - do: + msearch: + rest_total_hits_as_int: true + typed_keys: true + body: + - index: test-* + - {query: {match_all: {} }, size: 0, aggs: {test_sampler: {sampler: {shard_size: 200}, aggs: {test_significant_terms: {significant_terms: {field: name} } } } } } + - index: test-* + - {query: {match_all: {} }, size: 0, aggs: {test_umterms: {terms: {field: surname} } } } + - index: test-* + - {query: {match_all: {} }, size: 0, aggs: {test_sterms: {terms: {field: name}, aggs: {test_umsignificant_terms: {significant_terms: {field: surname} } } } } } + + - match: { responses.0.hits.total: 5 } + - match: { responses.0.aggregations.sampler#test_sampler.doc_count : 5 } + - match: { responses.0.aggregations.sampler#test_sampler.sigsterms#test_significant_terms.doc_count : 5 } + - match: { responses.1.hits.total: 5 } + - match: { responses.1.aggregations.sterms#test_umterms.doc_count_error_upper_bound : 0 } + - match: { responses.2.hits.total: 5 } + - match: { responses.2.aggregations.sterms#test_sterms.doc_count_error_upper_bound : 0 } + - is_true: responses.2.aggregations.sterms#test_sterms.buckets.0.sigsterms#test_umsignificant_terms diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/10_basic.yml new file mode 100644 index 0000000000000..87c3e6065bba4 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/10_basic.yml @@ -0,0 +1,57 @@ +setup: + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + indices.create: + index: testidx + body: + mappings: + properties: + text: + type : "text" + term_vector : "with_positions_offsets" + - do: + index: + index: testidx + id: testing_document + body: {"text" : "The quick brown fox is brown."} + + - do: + indices.refresh: {} + +--- +"Basic tests for multi termvector get": + + - do: + mtermvectors: + "term_statistics" : true + "body" : + "docs": + - + "_index" : "testidx" + "_id" : "testing_document" + + - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} + - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} + + - do: + mtermvectors: + "term_statistics" : true + "index" : "testidx" + "body" : + "docs": + - + "_id" : "testing_document" + + - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} + - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} + + - do: + mtermvectors: + "term_statistics" : true + "index" : "testidx" + "ids" : ["testing_document"] + + - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} + - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/11_basic_with_types.yml new file mode 100644 index 0000000000000..0c037eee9ddd2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/11_basic_with_types.yml @@ -0,0 +1,86 @@ +setup: + - do: + indices.create: + include_type_name: true + index: testidx + body: + mappings: + testtype: + properties: + text: + type : "text" + term_vector : "with_positions_offsets" + - do: + index: + index: testidx + type: testtype + id: testing_document + body: {"text" : "The quick brown fox is brown."} + + - do: + indices.refresh: {} + +--- +"Basic tests for multi termvector get": + + - do: + mtermvectors: + "term_statistics" : true + "body" : + "docs": + - + "_index" : "testidx" + "_type" : "testtype" + "_id" : "testing_document" + + - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} + - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} + + - do: + mtermvectors: + "term_statistics" : true + "body" : + "docs": + - + "_index" : "testidx" + "_type" : "testtype" + "_id" : "testing_document" + + - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} + - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} + + - do: + mtermvectors: + "term_statistics" : true + "index" : "testidx" + "body" : + "docs": + - + "_type" : "testtype" + "_id" : "testing_document" + + - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} + - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} + + - do: + mtermvectors: + "term_statistics" : true + "index" : "testidx" + "type" : "testtype" + "body" : + "docs": + - + "_id" : "testing_document" + + - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} + - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} + + - do: + mtermvectors: + "term_statistics" : true + "index" : "testidx" + "type" : "testtype" + "ids" : ["testing_document"] + + - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} + - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/20_deprecated.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/20_deprecated.yml new file mode 100644 index 0000000000000..376192680c99b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/20_deprecated.yml @@ -0,0 +1,53 @@ +setup: + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + +--- +"Deprecated camel case and _ parameters should fail in Term Vectors query": + + - skip: + version: " - 6.99.99" + reason: camel case and _ parameters (e.g. versionType, _version_type) should fail from 7.0 + features: "warnings" + + - do: + indices.create: + index: testidx + body: + mappings: + properties: + text: + type : "text" + term_vector : "with_positions_offsets" + + - do: + index: + index: testidx + id: testing_document + body: {"text" : "The quick brown fox is brown."} + + - do: + catch: bad_request + mtermvectors: + "term_statistics" : true + "body" : + "docs": + - + "_index" : "testidx" + "_id" : "testing_document" + "version" : 1 + "versionType" : "external" + + - do: + catch: bad_request + mtermvectors: + "term_statistics" : true + "body" : + "docs": + - + "_index" : "testidx" + "_type" : "_doc" + "_id" : "testing_document" + "version" : 1 + "_version_type" : "external" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/21_deprecated_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/21_deprecated_with_types.yml new file mode 100644 index 0000000000000..b0335498e22a1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/21_deprecated_with_types.yml @@ -0,0 +1,53 @@ + +--- +"Deprecated camel case and _ parameters should fail in Term Vectors query": + + - skip: + version: " - 6.99.99" + reason: camel case and _ parameters (e.g. versionType, _version_type) should fail from 7.0 + features: "warnings" + + - do: + indices.create: + include_type_name: true + index: testidx + body: + mappings: + testtype: + properties: + text: + type : "text" + term_vector : "with_positions_offsets" + + - do: + index: + index: testidx + type: testtype + id: testing_document + body: {"text" : "The quick brown fox is brown."} + + - do: + catch: bad_request + mtermvectors: + "term_statistics" : true + "body" : + "docs": + - + "_index" : "testidx" + "_type" : "testtype" + "_id" : "testing_document" + "version" : 1 + "versionType" : "external" + + - do: + catch: bad_request + mtermvectors: + "term_statistics" : true + "body" : + "docs": + - + "_index" : "testidx" + "_type" : "testtype" + "_id" : "testing_document" + "version" : 1 + "_version_type" : "external" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/30_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/30_mix_typeless_typeful.yml new file mode 100644 index 0000000000000..b14b5f94ebbc2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/30_mix_typeless_typeful.yml @@ -0,0 +1,33 @@ +--- +"mtermvectors without types on an index that has types": + + - skip: + version: " - 6.99.99" + reason: Typeless APIs were introduced in 7.0.0 + + - do: + indices.create: # not using include_type_name: false on purpose + include_type_name: true + index: index + body: + mappings: + not_doc: + properties: + foo: + type : "text" + term_vector : "with_positions_offsets" + + - do: + index: + index: index + id: 1 + body: { foo: bar } + + - do: + mtermvectors: + body: + docs: + - _index: index + _id: 1 + + - match: {docs.0.term_vectors.foo.terms.bar.term_freq: 1} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/10_basic.yml new file mode 100644 index 0000000000000..5821117f4c005 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/10_basic.yml @@ -0,0 +1,13 @@ +setup: + - skip: + features: [arbitrary_key] +--- +"node_info test": + - do: + nodes.info: {} + - set: + nodes._arbitrary_key_: node_id + + - is_true: nodes + - is_true: cluster_name + - is_true: nodes.$node_id.roles diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/20_transport.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/20_transport.yml new file mode 100644 index 0000000000000..09102157bcb99 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/20_transport.yml @@ -0,0 +1,16 @@ +--- + +"node_info test profile is empty": + - skip: + features: [stash_in_path, arbitrary_key] + + - do: + nodes.info: {} + - set: + nodes._arbitrary_key_: node_id + + - do: + nodes.info: + metric: [ transport ] + + - is_true: nodes.$node_id.transport.profiles diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/30_settings.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/30_settings.yml new file mode 100644 index 0000000000000..99b8b6f361a47 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/30_settings.yml @@ -0,0 +1,22 @@ +--- +"node_info test flat_settings": + - skip: + features: [arbitrary_key] + + - do: + nodes.info: {} + - set: + nodes._arbitrary_key_: node_id + + - do: + nodes.info: + metric: [ settings ] + + - match : { nodes.$node_id.settings.client.type: node } + + - do: + nodes.info: + metric: [ settings ] + flat_settings: true + + - match : { nodes.$node_id.settings.client\.type: node } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.reload_secure_settings/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.reload_secure_settings/10_basic.yml new file mode 100644 index 0000000000000..0a4cf0d64a001 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.reload_secure_settings/10_basic.yml @@ -0,0 +1,8 @@ +--- +"node_reload_secure_settings test": + + - do: + nodes.reload_secure_settings: {} + + - is_true: nodes + - is_true: cluster_name diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/10_basic.yml new file mode 100644 index 0000000000000..099483be9aded --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/10_basic.yml @@ -0,0 +1,36 @@ +--- +"Nodes stats": + - do: + nodes.stats: + metric: [ indices, transport ] + + - is_true: cluster_name + - is_true: nodes + +--- +"Nodes stats level": + - skip: + features: [arbitrary_key] + + - do: + nodes.info: {} + - set: + nodes._arbitrary_key_: node_id + + - do: + nodes.stats: + metric: [ indices ] + level: "indices" + + - is_true: nodes.$node_id.indices.indices + +--- +"Nodes stats unrecognized parameter": + - do: + catch: bad_request + nodes.stats: + metric: [ transprot ] + + - match: { status: 400 } + - match: { error.type: illegal_argument_exception } + - match: { error.reason: "request [/_nodes/stats/transprot] contains unrecognized metric: [transprot] -> did you mean [transport]?" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml new file mode 100644 index 0000000000000..a09619b7255c3 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml @@ -0,0 +1,227 @@ +--- +"Metric - blank": + - skip: + features: [arbitrary_key] + - do: + nodes.info: {} + - set: + nodes._arbitrary_key_: node_id + + - do: + nodes.stats: {} + + - is_true: nodes.$node_id.indices.docs + - is_true: nodes.$node_id.indices.store + - is_true: nodes.$node_id.indices.indexing + - is_true: nodes.$node_id.indices.get + - is_true: nodes.$node_id.indices.search + - is_true: nodes.$node_id.indices.merges + - is_true: nodes.$node_id.indices.refresh + - is_true: nodes.$node_id.indices.flush + - is_true: nodes.$node_id.indices.warmer + - is_true: nodes.$node_id.indices.query_cache + - is_true: nodes.$node_id.indices.fielddata + - is_true: nodes.$node_id.indices.completion + - is_true: nodes.$node_id.indices.segments + - is_true: nodes.$node_id.indices.translog + - is_true: nodes.$node_id.indices.recovery + +--- +"Metric - _all": + - skip: + features: [arbitrary_key] + - do: + nodes.info: {} + - set: + nodes._arbitrary_key_: node_id + + - do: + nodes.stats: { metric: _all } + + - is_true: nodes.$node_id.indices.docs + - is_true: nodes.$node_id.indices.store + - is_true: nodes.$node_id.indices.indexing + - is_true: nodes.$node_id.indices.get + - is_true: nodes.$node_id.indices.search + - is_true: nodes.$node_id.indices.merges + - is_true: nodes.$node_id.indices.refresh + - is_true: nodes.$node_id.indices.flush + - is_true: nodes.$node_id.indices.warmer + - is_true: nodes.$node_id.indices.query_cache + - is_true: nodes.$node_id.indices.fielddata + - is_true: nodes.$node_id.indices.completion + - is_true: nodes.$node_id.indices.segments + - is_true: nodes.$node_id.indices.translog + - is_true: nodes.$node_id.indices.recovery + +--- +"Metric - indices _all": + - skip: + features: [arbitrary_key] + - do: + nodes.info: {} + - set: + nodes._arbitrary_key_: node_id + + - do: + nodes.stats: { metric: indices, index_metric: _all } + + - is_true: nodes.$node_id.indices.docs + - is_true: nodes.$node_id.indices.store + - is_true: nodes.$node_id.indices.indexing + - is_true: nodes.$node_id.indices.get + - is_true: nodes.$node_id.indices.search + - is_true: nodes.$node_id.indices.merges + - is_true: nodes.$node_id.indices.refresh + - is_true: nodes.$node_id.indices.flush + - is_true: nodes.$node_id.indices.warmer + - is_true: nodes.$node_id.indices.query_cache + - is_true: nodes.$node_id.indices.fielddata + - is_true: nodes.$node_id.indices.completion + - is_true: nodes.$node_id.indices.segments + - is_true: nodes.$node_id.indices.translog + - is_true: nodes.$node_id.indices.recovery + +--- +"Metric - one": + - skip: + features: [arbitrary_key] + - do: + nodes.info: {} + - set: + nodes._arbitrary_key_: node_id + + - do: + nodes.stats: { metric: indices, index_metric: docs } + + - is_true: nodes.$node_id.indices.docs + - is_false: nodes.$node_id.indices.store + - is_false: nodes.$node_id.indices.indexing + - is_false: nodes.$node_id.indices.get + - is_false: nodes.$node_id.indices.search + - is_false: nodes.$node_id.indices.merges + - is_false: nodes.$node_id.indices.refresh + - is_false: nodes.$node_id.indices.flush + - is_false: nodes.$node_id.indices.warmer + - is_false: nodes.$node_id.indices.query_cache + - is_false: nodes.$node_id.indices.fielddata + - is_false: nodes.$node_id.indices.completion + - is_false: nodes.$node_id.indices.segments + - is_false: nodes.$node_id.indices.translog + - is_false: nodes.$node_id.indices.recovery + +--- +"Metric - multi": + - skip: + features: [arbitrary_key] + - do: + nodes.info: {} + - set: + nodes._arbitrary_key_: node_id + + - do: + nodes.stats: { metric: indices, index_metric: [ store, get, merge ] } + + - is_false: nodes.$node_id.indices.docs + - is_true: nodes.$node_id.indices.store + - is_false: nodes.$node_id.indices.indexing + - is_true: nodes.$node_id.indices.get + - is_false: nodes.$node_id.indices.search + - is_true: nodes.$node_id.indices.merges + - is_false: nodes.$node_id.indices.refresh + - is_false: nodes.$node_id.indices.flush + - is_false: nodes.$node_id.indices.warmer + - is_false: nodes.$node_id.indices.query_cache + - is_false: nodes.$node_id.indices.fielddata + - is_false: nodes.$node_id.indices.completion + - is_false: nodes.$node_id.indices.segments + - is_false: nodes.$node_id.indices.translog + - is_false: nodes.$node_id.indices.recovery + + +--- +"Metric - recovery": + - skip: + features: [arbitrary_key] + - do: + nodes.info: {} + - set: + nodes._arbitrary_key_: node_id + + - do: + nodes.stats: { metric: indices, index_metric: [ recovery ] } + + - is_false: nodes.$node_id.indices.docs + - is_false: nodes.$node_id.indices.store + - is_false: nodes.$node_id.indices.indexing + - is_false: nodes.$node_id.indices.get + - is_false: nodes.$node_id.indices.search + - is_false: nodes.$node_id.indices.merges + - is_false: nodes.$node_id.indices.refresh + - is_false: nodes.$node_id.indices.flush + - is_false: nodes.$node_id.indices.warmer + - is_false: nodes.$node_id.indices.query_cache + - is_false: nodes.$node_id.indices.fielddata + - is_false: nodes.$node_id.indices.completion + - is_false: nodes.$node_id.indices.segments + - is_false: nodes.$node_id.indices.translog + - is_true: nodes.$node_id.indices.recovery + +--- +"Metric - _all include_segment_file_sizes": + - skip: + features: [arbitrary_key] + - do: + nodes.info: {} + - set: + nodes._arbitrary_key_: node_id + + - do: + nodes.stats: { metric: indices, index_metric: _all, include_segment_file_sizes: true } + + - is_true: nodes.$node_id.indices.docs + - is_true: nodes.$node_id.indices.store + - is_true: nodes.$node_id.indices.indexing + - is_true: nodes.$node_id.indices.get + - is_true: nodes.$node_id.indices.search + - is_true: nodes.$node_id.indices.merges + - is_true: nodes.$node_id.indices.refresh + - is_true: nodes.$node_id.indices.flush + - is_true: nodes.$node_id.indices.warmer + - is_true: nodes.$node_id.indices.query_cache + - is_true: nodes.$node_id.indices.fielddata + - is_true: nodes.$node_id.indices.completion + - is_true: nodes.$node_id.indices.segments + - is_true: nodes.$node_id.indices.translog + - is_true: nodes.$node_id.indices.recovery + - is_true: nodes.$node_id.indices.segments.file_sizes + +--- +"Metric - segments include_segment_file_sizes": + - skip: + features: [arbitrary_key] + - do: + nodes.info: {} + - set: + nodes._arbitrary_key_: node_id + + - do: + nodes.stats: { metric: indices, index_metric: segments, include_segment_file_sizes: true } + + - is_false: nodes.$node_id.indices.docs + - is_false: nodes.$node_id.indices.store + - is_false: nodes.$node_id.indices.indexing + - is_false: nodes.$node_id.indices.get + - is_false: nodes.$node_id.indices.search + - is_false: nodes.$node_id.indices.merges + - is_false: nodes.$node_id.indices.refresh + - is_false: nodes.$node_id.indices.flush + - is_false: nodes.$node_id.indices.warmer + - is_false: nodes.$node_id.indices.query_cache + - is_false: nodes.$node_id.indices.fielddata + - is_false: nodes.$node_id.indices.completion + - is_true: nodes.$node_id.indices.segments + - is_false: nodes.$node_id.indices.translog + - is_false: nodes.$node_id.indices.recovery + - is_true: nodes.$node_id.indices.segments.file_sizes + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/20_response_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/20_response_filtering.yml new file mode 100644 index 0000000000000..a478fd7d3f235 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/20_response_filtering.yml @@ -0,0 +1,202 @@ +--- +"Nodes Stats with response filtering": + - skip: + features: [arbitrary_key] + - do: + nodes.info: {} + - set: + nodes._arbitrary_key_: node_id + + # Nodes Stats with no filtering + - do: + nodes.stats: {} + + - is_true: cluster_name + - is_true: nodes + - is_true: nodes.$node_id.name + - is_true: nodes.$node_id.indices + - is_true: nodes.$node_id.indices.docs + - gte: { nodes.$node_id.indices.docs.count: 0 } + - is_true: nodes.$node_id.indices.segments + - gte: { nodes.$node_id.indices.segments.count: 0 } + - is_true: nodes.$node_id.jvm + - is_true: nodes.$node_id.jvm.threads + - gte: { nodes.$node_id.jvm.threads.count: 0 } + - is_true: nodes.$node_id.jvm.buffer_pools.direct + - gte: { nodes.$node_id.jvm.buffer_pools.direct.count: 0 } + - gte: { nodes.$node_id.jvm.buffer_pools.direct.used_in_bytes: 0 } + + # Nodes Stats with only "cluster_name" field + - do: + nodes.stats: + filter_path: cluster_name + + - is_true: cluster_name + - is_false: nodes + - is_false: nodes.$node_id.name + - is_false: nodes.$node_id.indices + - is_false: nodes.$node_id.jvm + + # Nodes Stats with "nodes" field and sub-fields + - do: + nodes.stats: + filter_path: nodes.* + + - is_false: cluster_name + - is_true: nodes + - is_true: nodes.$node_id.name + - is_true: nodes.$node_id.indices + - is_true: nodes.$node_id.indices.docs + - gte: { nodes.$node_id.indices.docs.count: 0 } + - is_true: nodes.$node_id.indices.segments + - gte: { nodes.$node_id.indices.segments.count: 0 } + - is_true: nodes.$node_id.jvm + - is_true: nodes.$node_id.jvm.threads + - gte: { nodes.$node_id.jvm.threads.count: 0 } + - is_true: nodes.$node_id.jvm.buffer_pools.direct + - gte: { nodes.$node_id.jvm.buffer_pools.direct.count: 0 } + - gte: { nodes.$node_id.jvm.buffer_pools.direct.used_in_bytes: 0 } + + # Nodes Stats with "nodes.*.indices" field and sub-fields + - do: + nodes.stats: + filter_path: nodes.*.indices + + - is_false: cluster_name + - is_true: nodes + - is_false: nodes.$node_id.name + - is_true: nodes.$node_id.indices + - is_true: nodes.$node_id.indices.docs + - gte: { nodes.$node_id.indices.docs.count: 0 } + - is_true: nodes.$node_id.indices.segments + - gte: { nodes.$node_id.indices.segments.count: 0 } + - is_false: nodes.$node_id.jvm + + # Nodes Stats with "nodes.*.name" and "nodes.*.indices.docs.count" fields + - do: + nodes.stats: + filter_path: [ "nodes.*.name", "nodes.*.indices.docs.count" ] + + - is_false: cluster_name + - is_true: nodes + - is_true: nodes.$node_id.name + - is_true: nodes.$node_id.indices + - is_true: nodes.$node_id.indices.docs + - gte: { nodes.$node_id.indices.docs.count: 0 } + - is_false: nodes.$node_id.indices.segments + - is_false: nodes.$node_id.jvm + + # Nodes Stats with all "count" fields + - do: + nodes.stats: + filter_path: "nodes.**.count" + + - is_false: cluster_name + - is_true: nodes + - is_false: nodes.$node_id.name + - is_true: nodes.$node_id.indices + - is_true: nodes.$node_id.indices.docs + - gte: { nodes.$node_id.indices.docs.count: 0 } + - is_true: nodes.$node_id.indices.segments + - gte: { nodes.$node_id.indices.segments.count: 0 } + - is_true: nodes.$node_id.jvm + - is_true: nodes.$node_id.jvm.threads + - gte: { nodes.$node_id.jvm.threads.count: 0 } + - is_true: nodes.$node_id.jvm.buffer_pools.direct + - gte: { nodes.$node_id.jvm.buffer_pools.direct.count: 0 } + - is_false: nodes.$node_id.jvm.buffer_pools.direct.used_in_bytes + + # Nodes Stats with all "count" fields in sub-fields of "jvm" field + - do: + nodes.stats: + filter_path: "nodes.**.jvm.**.count" + + - is_false: cluster_name + - is_true: nodes + - is_false: nodes.$node_id.name + - is_false: nodes.$node_id.indices + - is_false: nodes.$node_id.indices.docs.count + - is_false: nodes.$node_id.indices.segments.count + - is_true: nodes.$node_id.jvm + - is_true: nodes.$node_id.jvm.threads + - gte: { nodes.$node_id.jvm.threads.count: 0 } + - is_true: nodes.$node_id.jvm.buffer_pools.direct + - gte: { nodes.$node_id.jvm.buffer_pools.direct.count: 0 } + - is_false: nodes.$node_id.jvm.buffer_pools.direct.used_in_bytes + + # Nodes Stats with "nodes.*.fs.data" fields + - do: + nodes.stats: + filter_path: "nodes.*.fs.data" + + - is_false: cluster_name + - is_true: nodes + - is_false: nodes.$node_id.name + - is_false: nodes.$node_id.indices + - is_false: nodes.$node_id.jvm + - is_true: nodes.$node_id.fs.data + - is_true: nodes.$node_id.fs.data.0.path + - is_true: nodes.$node_id.fs.data.0.type + - is_true: nodes.$node_id.fs.data.0.total_in_bytes + + # Nodes Stats with "nodes.*.fs.data.t*" fields + - do: + nodes.stats: + filter_path: "nodes.*.fs.data.t*" + + - is_false: cluster_name + - is_true: nodes + - is_false: nodes.$node_id.name + - is_false: nodes.$node_id.indices + - is_false: nodes.$node_id.jvm + - is_true: nodes.$node_id.fs.data + - is_false: nodes.$node_id.fs.data.0.path + - is_true: nodes.$node_id.fs.data.0.type + - is_true: nodes.$node_id.fs.data.0.total_in_bytes + +--- +"Nodes Stats filtered using both includes and excludes filters": + - skip: + features: [arbitrary_key] + - do: + nodes.info: {} + - set: + nodes._arbitrary_key_: node_id + + # Nodes Stats with "nodes" field but no JVM stats + - do: + nodes.stats: + filter_path: [ "nodes", "-nodes.*.jvm", "-nodes.*.indices" ] + + - is_false: cluster_name + - is_true: nodes + - is_true: nodes.$node_id.name + - is_true: nodes.$node_id.os + - is_false: nodes.$node_id.indices + - is_false: nodes.$node_id.jvm + + # Nodes Stats with "nodes.*.indices" field and sub-fields but no indices segments + - do: + nodes.stats: + filter_path: "nodes.*.indices,-nodes.*.indices.segments" + + - is_false: cluster_name + - is_true: nodes + - is_false: nodes.$node_id.name + - is_true: nodes.$node_id.indices + - is_true: nodes.$node_id.indices.docs + - is_false: nodes.$node_id.indices.segments + + # Nodes Stats with "nodes.*.fs.data.t*" fields but no "type" field + - do: + nodes.stats: + filter_path: "nodes.*.fs.data.t*,-**.type" + + - is_false: cluster_name + - is_true: nodes + - is_false: nodes.$node_id.name + - is_false: nodes.$node_id.indices + - is_false: nodes.$node_id.jvm + - is_true: nodes.$node_id.fs.data + - is_false: nodes.$node_id.fs.data.0.type + - is_true: nodes.$node_id.fs.data.0.total_in_bytes diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/30_discovery.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/30_discovery.yml new file mode 100644 index 0000000000000..a6b7f29a183c8 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/30_discovery.yml @@ -0,0 +1,42 @@ +--- +"Discovery stats": + - skip: + features: [arbitrary_key] + + - do: + nodes.info: + node_id: _master + - set: + nodes._arbitrary_key_: master + + - do: + nodes.stats: + metric: [ discovery ] + + - is_true: cluster_name + - is_true: nodes + - is_true: nodes.$master.name + - is_false: nodes.$master.jvm + - is_true: nodes.$master.discovery + - is_true: nodes.$master.discovery.cluster_state_queue + - is_true: nodes.$master.discovery.published_cluster_states + - gte: { nodes.$master.discovery.published_cluster_states.full_states: 0 } + - gte: { nodes.$master.discovery.published_cluster_states.incompatible_diffs: 0 } + - gte: { nodes.$master.discovery.published_cluster_states.compatible_diffs: 0 } + - is_true: nodes.$master.roles + + - do: + nodes.stats: + filter_path: "nodes.*.discovery" + + - is_false: cluster_name + - is_true: nodes + - is_false: nodes.$master.name + - is_false: nodes.$master.jvm + - is_true: nodes.$master.discovery + - is_true: nodes.$master.discovery.cluster_state_queue + - is_true: nodes.$master.discovery.published_cluster_states + - gte: { nodes.$master.discovery.published_cluster_states.full_states: 0 } + - gte: { nodes.$master.discovery.published_cluster_states.incompatible_diffs: 0 } + - gte: { nodes.$master.discovery.published_cluster_states.compatible_diffs: 0 } + - is_false: nodes.$master.roles diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/ping/10_ping.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/ping/10_ping.yml new file mode 100644 index 0000000000000..ec07c218dabd9 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/ping/10_ping.yml @@ -0,0 +1,5 @@ +--- +"Ping": + - do: { ping: {}} + - is_true: '' + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/range/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/range/10_basic.yml new file mode 100644 index 0000000000000..20dd6fc614694 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/range/10_basic.yml @@ -0,0 +1,449 @@ +setup: + - do: + indices.create: + index: test + body: + settings: + number_of_replicas: 0 + mappings: + "properties": + "integer_range": + "type" : "integer_range" + "long_range": + "type" : "long_range" + "float_range": + "type" : "float_range" + "double_range": + "type" : "double_range" + "date_range": + "type" : "date_range" + "ip_range": + "type" : "ip_range" + +--- +"Integer range": + + - do: + index: + index: test + id: 1 + body: { "integer_range" : { "gte": 1, "lte": 5 } } + + - do: + index: + index: test + id: 2 + body: { "integer_range" : { "gte": 1, "lte": 3 } } + + - do: + index: + index: test + id: 3 + body: { "integer_range" : { "gte": 4, "lte": 5 } } + + - do: + index: + index: test + id: 4 + body: { "integer_range" : null } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "integer_range" : { "gte": 3, "lte" : 4 } } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "query_string" : { "query" : "integer_range:[3 TO 4]" } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "integer_range" : { "gte": 3, "lte" : 4, "relation": "intersects" } } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "integer_range" : { "gte": 3, "lte" : 4, "relation": "contains" } } } } + + - match: { hits.total: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "integer_range" : { "gte": 3, "lte" : 4, "relation": "within" } } } } + + - match: { hits.total: 0 } + + - do: + search: + rest_total_hits_as_int: true + body: { "query" : { "match_all": {} } } + + - match: { hits.total: 4 } + +--- +"Long range": + + - do: + index: + index: test + id: 1 + body: { "long_range" : { "gte": 1, "lte": 5 } } + + - do: + index: + index: test + id: 2 + body: { "long_range" : { "gte": 1, "lte": 3 } } + + - do: + index: + index: test + id: 3 + body: { "long_range" : { "gte": 4, "lte": 5 } } + + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "long_range" : { "gte": 3, "lte" : 4 } } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "query_string" : { "query" : "long_range:[3 TO 4]" } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "long_range" : { "gte": 3, "lte" : 4, "relation": "intersects" } } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "long_range" : { "gte": 3, "lte" : 4, "relation": "contains" } } } } + + - match: { hits.total: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "long_range" : { "gte": 3, "lte" : 4, "relation": "within" } } } } + + - match: { hits.total: 0 } + +--- +"Float range": + + - do: + index: + index: test + id: 1 + body: { "float_range" : { "gte": 1, "lte": 5 } } + + - do: + index: + index: test + id: 2 + body: { "float_range" : { "gte": 1, "lte": 3 } } + + - do: + index: + index: test + id: 3 + body: { "float_range" : { "gte": 4, "lte": 5 } } + + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "float_range" : { "gte": 3, "lte" : 4 } } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "query_string" : { "query" : "float_range:[3 TO 4]" } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "float_range" : { "gte": 3, "lte" : 4, "relation": "intersects" } } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "float_range" : { "gte": 3, "lte" : 4, "relation": "contains" } } } } + + - match: { hits.total: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "float_range" : { "gte": 3, "lte" : 4, "relation": "within" } } } } + + - match: { hits.total: 0 } + +--- +"Double range": + + - do: + index: + index: test + id: 1 + body: { "double_range" : { "gte": 1, "lte": 5 } } + + - do: + index: + index: test + id: 2 + body: { "double_range" : { "gte": 1, "lte": 3 } } + + - do: + index: + index: test + id: 3 + body: { "double_range" : { "gte": 4, "lte": 5 } } + + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "double_range" : { "gte": 3, "lte" : 4 } } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "query_string" : { "query" : "double_range:[3 TO 4]" } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "double_range" : { "gte": 3, "lte" : 4, "relation": "intersects" } } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "double_range" : { "gte": 3, "lte" : 4, "relation": "contains" } } } } + + - match: { hits.total: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "double_range" : { "gte": 3, "lte" : 4, "relation": "within" } } } } + + - match: { hits.total: 0 } + +--- +"IP range": + + - do: + index: + index: test + id: 1 + body: { "ip_range" : { "gte": "192.168.0.1", "lte": "192.168.0.5" } } + + - do: + index: + index: test + id: 2 + body: { "ip_range" : { "gte": "192.168.0.1", "lte": "192.168.0.3" } } + + - do: + index: + index: test + id: 3 + body: { "ip_range" : { "gte": "192.168.0.4", "lte": "192.168.0.5" } } + + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "ip_range" : { "gte": "192.168.0.3", "lte" : "192.168.0.4" } } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "query_string" : { "query" : "ip_range:[192.168.0.3 TO 192.168.0.4]" } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "ip_range" : { "gte": "192.168.0.3", "lte" : "192.168.0.4", "relation": "intersects" } } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "ip_range" : { "gte": "192.168.0.3", "lte" : "192.168.0.4", "relation": "contains" } } } } + + - match: { hits.total: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "ip_range" : { "gte": "192.168.0.3", "lte" : "192.168.0.4", "relation": "within" } } } } + + - match: { hits.total: 0 } + +--- +"Date range": + + - do: + index: + index: test + id: 1 + body: { "date_range" : { "gte": "2017-09-01", "lte": "2017-09-05" } } + + - do: + index: + index: test + id: 2 + body: { "date_range" : { "gte": "2017-09-01", "lte": "2017-09-03" } } + + - do: + index: + index: test + id: 3 + body: { "date_range" : { "gte": "2017-09-04", "lte": "2017-09-05" } } + + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "date_range" : { "gte": "2017-09-03", "lte" : "2017-09-04" } } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "query_string" : { "query" : "date_range:[2017-09-03 TO 2017-09-04]" } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "date_range" : { "gte": "2017-09-03", "lte" : "2017-09-04", "relation": "intersects" } } } } + + - match: { hits.total: 3 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "date_range" : { "gte": "2017-09-03", "lte" : "2017-09-04", "relation": "contains" } } } } + + - match: { hits.total: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "date_range" : { "gte": "2017-09-03", "lte" : "2017-09-04", "relation": "within" } } } } + + - match: { hits.total: 0 } + +--- +"Date range rounding": + - skip: + version: " - 7.6.99" + reason: "This part tests rounding behaviour changed in 7.7" + + - do: + index: + index: test + id: 1 + body: { "date_range" : { "gte": "2019-12-14T12:00:00.000Z", "lte": "2019-12-14T13:00:00.000Z" } } + + - do: + index: + index: test + id: 2 + body: { "date_range" : { "gte": "2019-12-15T12:00:00.000Z", "lte": "2019-12-15T13:00:00.000Z" } } + + - do: + index: + index: test + id: 3 + body: { "date_range" : { "gte": "2019-12-16T12:00:00.000Z", "lte": "2019-12-16T13:00:00.000Z" } } + + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "date_range" : { "gt": "2019-12-15||/d", "relation": "within" } } } } + + - match: { hits.total: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "date_range" : { "gte": "2019-12-15||/d", "relation": "within" } } } } + + - match: { hits.total: 2 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "date_range" : { "lt": "2019-12-15||/d", "relation": "within" } } } } + + - match: { hits.total: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "date_range" : { "lte": "2019-12-15||/d", "relation": "within" } } } } + + - match: { hits.total: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/scripts/20_get_script_context.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/scripts/20_get_script_context.yml new file mode 100644 index 0000000000000..64efeb7dfb4ba --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/scripts/20_get_script_context.yml @@ -0,0 +1,10 @@ +"Action to get all contexts": + - skip: + version: " - 7.6.0" + reason: "get_all_contexts introduced in 7.6.0" + - do: + get_script_context: {} + + - is_true: contexts.0.name + - is_true: contexts.0.methods.0.return_type + - match: { contexts.0.methods.0.name: "execute" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/scripts/25_get_script_languages.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/scripts/25_get_script_languages.yml new file mode 100644 index 0000000000000..f4d764324e2dd --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/scripts/25_get_script_languages.yml @@ -0,0 +1,9 @@ +"Action to get script languages": + - skip: + version: " - 7.6.0" + reason: "get_script_languages introduced in 7.6.0" + - do: + get_script_languages: {} + + - match: { types_allowed.0: "inline" } + - match: { types_allowed.1: "stored" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/10_basic.yml new file mode 100644 index 0000000000000..aa6d1e9841dd7 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/10_basic.yml @@ -0,0 +1,345 @@ +--- +"Basic scroll": + - do: + indices.create: + index: test_scroll + - do: + index: + index: test_scroll + id: 42 + body: { foo: 1 } + + - do: + index: + index: test_scroll + id: 43 + body: { foo: 2 } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + index: test_scroll + size: 1 + scroll: 1m + sort: foo + body: + query: + match_all: {} + + - set: {_scroll_id: scroll_id} + - match: {hits.total: 2 } + - length: {hits.hits: 1 } + - match: {hits.hits.0._id: "42" } + + - do: + index: + index: test_scroll + id: 44 + body: { foo: 3 } + + - do: + indices.refresh: {} + + - do: + scroll: + rest_total_hits_as_int: true + body: { "scroll_id": "$scroll_id", "scroll": "1m"} + + - match: {hits.total: 2 } + - length: {hits.hits: 1 } + - match: {hits.hits.0._id: "43" } + + - do: + scroll: + rest_total_hits_as_int: true + scroll_id: $scroll_id + scroll: 1m + + - match: {hits.total: 2 } + - length: {hits.hits: 0 } + + - do: + clear_scroll: + scroll_id: $scroll_id + +--- +"Basic scroll with 1 shard": + - do: + indices.create: + index: test_scroll + body: + settings: + index: + number_of_shards: 1 + + - do: + index: + index: test_scroll + id: 42 + body: { foo: 1 } + + - do: + index: + index: test_scroll + id: 43 + body: { foo: 2 } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + index: test_scroll + size: 1 + scroll: 1m + sort: foo + body: + query: + match_all: {} + + - set: {_scroll_id: scroll_id} + - match: {hits.total: 2 } + - length: {hits.hits: 1 } + - match: {hits.hits.0._id: "42" } + + - do: + index: + index: test_scroll + id: 44 + body: { foo: 3 } + + - do: + indices.refresh: {} + + - do: + scroll: + rest_total_hits_as_int: true + body: { "scroll_id": "$scroll_id", "scroll": "1m"} + + - match: {hits.total: 2 } + - length: {hits.hits: 1 } + - match: {hits.hits.0._id: "43" } + + - do: + scroll: + rest_total_hits_as_int: true + scroll_id: $scroll_id + scroll: 1m + + - match: {hits.total: 2 } + - length: {hits.hits: 0 } + + - do: + clear_scroll: + scroll_id: $scroll_id + +--- +"Body params override query string": + - do: + indices.create: + index: test_scroll + - do: + index: + index: test_scroll + id: 42 + body: { foo: 1 } + + - do: + index: + index: test_scroll + id: 43 + body: { foo: 2 } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + index: test_scroll + size: 1 + scroll: 1m + sort: foo + body: + query: + match_all: {} + + - set: {_scroll_id: scroll_id} + - match: {hits.total: 2 } + - length: {hits.hits: 1 } + - match: {hits.hits.0._id: "42" } + + - do: + index: + index: test_scroll + id: 44 + body: { foo: 3 } + + - do: + indices.refresh: {} + + - do: + scroll: + rest_total_hits_as_int: true + scroll_id: invalid_scroll_id + body: { "scroll_id": "$scroll_id", "scroll": "1m"} + + - match: {hits.total: 2 } + - length: {hits.hits: 1 } + - match: {hits.hits.0._id: "43" } + + - do: + clear_scroll: + scroll_id: $scroll_id + +--- +"Scroll cannot used the request cache": + - skip: + version: " - 6.99.99" + reason: the error message has been added in v7.0.0 + - do: + indices.create: + index: test_scroll + - do: + catch: /\[request_cache\] cannot be used in a scroll context/ + search: + rest_total_hits_as_int: true + index: test_scroll + scroll: 1m + request_cache: true + body: + query: + match_all: {} + +--- +"Scroll with size 0": + - skip: + version: " - 6.1.99" + reason: the error message has been added in v6.2.0 + - do: + indices.create: + index: test_scroll + - do: + catch: /\[size\] cannot be \[0\] in a scroll context/ + search: + rest_total_hits_as_int: true + index: test_scroll + scroll: 1m + request_cache: true + body: + query: + match_all: {} + size: 0 + +--- +"Scroll max_score is null": + - skip: + version: " - 6.99.99" + reason: max_score was set to 0 rather than null before 7.0 + + - do: + indices.create: + index: test_scroll + - do: + index: + index: test_scroll + id: 42 + body: { foo: 1 } + + - do: + index: + index: test_scroll + id: 43 + body: { foo: 2 } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + index: test_scroll + size: 1 + scroll: 1m + sort: foo + body: + query: + match_all: {} + + - set: {_scroll_id: scroll_id} + - length: {hits.hits: 1 } + - match: { hits.max_score: null } + + - do: + scroll: + rest_total_hits_as_int: true + scroll_id: $scroll_id + scroll: 1m + + - length: {hits.hits: 1 } + - match: { hits.max_score: null } + +--- +"Scroll with new response format": + - skip: + version: " - 6.9.99" + reason: hits.total is returned as an object in 7.0.0 + - do: + indices.create: + index: test_scroll + - do: + index: + index: test_scroll + id: 42 + body: { foo: 1 } + + - do: + index: + index: test_scroll + id: 43 + body: { foo: 2 } + + - do: + indices.refresh: {} + + - do: + search: + index: test_scroll + size: 1 + scroll: 1m + sort: foo + body: + query: + match_all: {} + + - set: {_scroll_id: scroll_id} + - match: {hits.total.value: 2 } + - match: {hits.total.relation: eq } + - length: {hits.hits: 1 } + - match: {hits.hits.0._id: "42" } + + - do: + scroll: + body: { "scroll_id": "$scroll_id", "scroll": "1m"} + + - match: {hits.total.value: 2 } + - match: {hits.total.relation: eq } + - length: {hits.hits: 1 } + - match: {hits.hits.0._id: "43" } + + - do: + scroll: + scroll_id: $scroll_id + scroll: 1m + + - match: {hits.total.value: 2 } + - match: {hits.total.relation: eq } + - length: {hits.hits: 0 } + + - do: + clear_scroll: + scroll_id: $scroll_id diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/11_clear.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/11_clear.yml new file mode 100644 index 0000000000000..97a13dd0c2c5f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/11_clear.yml @@ -0,0 +1,121 @@ +--- +"Clear scroll": + - do: + indices.create: + index: test_scroll + - do: + index: + index: test_scroll + id: 42 + body: { foo: bar } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + index: test_scroll + scroll: 1m + body: + query: + match_all: {} + + - set: {_scroll_id: scroll_id1} + + - do: + clear_scroll: + scroll_id: $scroll_id1 + + - do: + catch: missing + scroll: + rest_total_hits_as_int: true + scroll_id: $scroll_id1 + + - do: + catch: missing + clear_scroll: + scroll_id: $scroll_id1 + +--- +"Body params with array param override query string": + - do: + indices.create: + index: test_scroll + - do: + index: + index: test_scroll + id: 42 + body: { foo: bar } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + index: test_scroll + scroll: 1m + body: + query: + match_all: {} + + - set: {_scroll_id: scroll_id1} + + - do: + clear_scroll: + scroll_id: "invalid_scroll_id" + body: { "scroll_id": [ "$scroll_id1" ]} + + - do: + catch: missing + scroll: + rest_total_hits_as_int: true + scroll_id: $scroll_id1 + + - do: + catch: missing + clear_scroll: + scroll_id: $scroll_id1 + +--- +"Body params with string param scroll id override query string": + - do: + indices.create: + index: test_scroll + - do: + index: + index: test_scroll + id: 42 + body: { foo: bar } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + index: test_scroll + scroll: 1m + body: + query: + match_all: {} + + - set: {_scroll_id: scroll_id1} + + - do: + clear_scroll: + scroll_id: "invalid_scroll_id" + body: { "scroll_id": "$scroll_id1" } + + - do: + catch: missing + scroll: + rest_total_hits_as_int: true + scroll_id: $scroll_id1 + + - do: + catch: missing + clear_scroll: + scroll_id: $scroll_id1 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/12_slices.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/12_slices.yml new file mode 100644 index 0000000000000..f655b43b98949 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/12_slices.yml @@ -0,0 +1,147 @@ +--- +setup: + - do: + indices.create: + index: test_sliced_scroll + body: + settings: + number_of_shards: 5 + number_of_routing_shards: 5 + + - do: + index: + index: test_sliced_scroll + id: 1 + body: { foo: 1 } + + - do: + index: + index: test_sliced_scroll + id: 2 + body: { foo: 2 } + + - do: + index: + index: test_sliced_scroll + id: 3 + body: { foo: 3 } + + - do: + index: + index: test_sliced_scroll + id: 4 + body: { foo: 4 } + + - do: + indices.refresh: {} + +--- +"Sliced scroll": + - do: + search: + rest_total_hits_as_int: true + index: test_sliced_scroll + scroll: 1m + sort: foo + body: + slice: + id: 0 + max: 2 + query: + match_all: {} + + - set: {_scroll_id: scroll_id} + - match: {hits.total: 3 } + - length: {hits.hits: 3 } + - match: {hits.hits.0._id: "2" } + - match: {hits.hits.1._id: "3" } + - match: {hits.hits.2._id: "4" } + + - do: + scroll: + rest_total_hits_as_int: true + scroll_id: $scroll_id + scroll: 1m + + - match: {hits.total: 3 } + - length: {hits.hits: 0 } + + - do: + clear_scroll: + scroll_id: $scroll_id + + - do: + search: + rest_total_hits_as_int: true + index: test_sliced_scroll + scroll: 1m + sort: foo + body: + slice: + id: 1 + max: 2 + query: + match_all: {} + + - set: {_scroll_id: scroll_id} + - match: {hits.total: 1 } + - length: {hits.hits: 1 } + - match: {hits.hits.0._id: "1" } + + - do: + scroll: + rest_total_hits_as_int: true + scroll_id: $scroll_id + scroll: 1m + + - match: {hits.total: 1 } + - length: {hits.hits: 0 } + + - do: + clear_scroll: + scroll_id: $scroll_id + +--- +"Sliced scroll with invalid arguments": + - skip: + version: " - 6.99.99" + reason: Prior versions return 500 rather than 404 + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + index: test_sliced_scroll + size: 1 + scroll: 1m + body: + slice: + id: 0 + max: 1025 + query: + match_all: {} + + - do: + indices.put_settings: + index: test_sliced_scroll + body: + index.max_slices_per_scroll: 1025 + + - do: + search: + rest_total_hits_as_int: true + index: test_sliced_scroll + size: 1 + scroll: 1m + body: + slice: + id: 0 + max: 1025 + query: + match_all: {} + + - set: {_scroll_id: scroll_id} + + - do: + clear_scroll: + scroll_id: $scroll_id diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/20_keep_alive.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/20_keep_alive.yml new file mode 100644 index 0000000000000..6217f66c2648e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/20_keep_alive.yml @@ -0,0 +1,71 @@ +--- + teardown: + + - do: + cluster.put_settings: + body: + transient: + search.max_keep_alive: null + search.default_keep_alive: null + +--- +"Max keep alive": + - skip: + version: " - 6.99.99" + reason: search.max_keep_alive was added in 7.0.0 + + - do: + index: + index: test_scroll + id: 1 + body: { foo: 1 } + + - do: + index: + index: test_scroll + id: 2 + body: { foo: 1 } + + - do: + indices.refresh: {} + + - do: + cluster.put_settings: + body: + transient: + search.default_keep_alive: "1m" + search.max_keep_alive: "1m" + + - do: + catch: /.*Keep alive for scroll.*is too large.*/ + search: + rest_total_hits_as_int: true + index: test_scroll + size: 1 + scroll: 2m + sort: foo + body: + query: + match_all: {} + + - do: + search: + rest_total_hits_as_int: true + index: test_scroll + size: 1 + scroll: 1m + sort: foo + body: + query: + match_all: {} + + - set: {_scroll_id: scroll_id} + - match: {hits.total: 2 } + - length: {hits.hits: 1 } + + - do: + catch: /.*Keep alive for scroll.*is too large.*/ + scroll: + rest_total_hits_as_int: true + scroll_id: $scroll_id + scroll: 3m diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/100_avg_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/100_avg_metric.yml new file mode 100644 index 0000000000000..0e57bb9abd667 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/100_avg_metric.yml @@ -0,0 +1,177 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + int_field: + type : integer + double_field: + type : double + string_field: + type: keyword + + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 1 + - int_field: 1 + double_field: 1.0 + string_field: foo + - index: + _index: test_1 + _id: 2 + - int_field: 51 + double_field: 51.0 + string_field: foo + - index: + _index: test_1 + _id: 3 + - int_field: 101 + double_field: 101.0 + string_field: foo + - index: + _index: test_1 + _id: 4 + - int_field: 151 + double_field: 151.0 + string_field: foo + +--- +"Basic test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_avg: + avg: + field: int_field + the_double_avg: + avg: + field: double_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_avg.value: 76.0 } + - match: { aggregations.the_double_avg.value: 76.0 } + +--- +"Only aggs test": + + - do: + search: + rest_total_hits_as_int: true + body: + size: 0 + aggs: + the_int_avg: + avg: + field: int_field + the_double_avg: + avg: + field: double_field + + - match: { hits.total: 4 } + - length: { hits.hits: 0 } + - match: { aggregations.the_int_avg.value: 76.0 } + - match: { aggregations.the_double_avg.value: 76.0 } + +--- +"Filtered test": + + - do: + search: + rest_total_hits_as_int: true + body: + query: + constant_score: + filter: + range: + int_field: + gte: 50 + aggs: + the_int_avg: + avg: + field: int_field + the_double_avg: + avg: + field: double_field + + - match: { hits.total: 3 } + - length: { hits.hits: 3 } + - match: { aggregations.the_int_avg.value: 101.0 } + - match: { aggregations.the_double_avg.value: 101.0 } + + +--- +"Missing field with missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_missing_avg: + avg: + field: foo + missing: 1 + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_missing_avg.value: 1 } + +--- +"Missing field without missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_missing_avg: + avg: + field: foo + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - is_false: aggregations.the_missing_avg.value + +--- +"Metadata test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_avg: + meta: + foo: bar + avg: + field: int_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_avg.value: 76.0 } + - match: { aggregations.the_int_avg.meta.foo: "bar" } + +--- +"Aggregating wrong datatype test": + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + body: + aggs: + the_string_avg: + avg: + field: string_field diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/10_histogram.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/10_histogram.yml new file mode 100644 index 0000000000000..694335b6677f5 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/10_histogram.yml @@ -0,0 +1,492 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + number: + type: integer + date: + type: date + - do: + cluster.health: + wait_for_status: green + +--- +"Basic test": + - do: + index: + index: test_1 + id: 1 + body: { "number" : 1 } + + - do: + index: + index: test_1 + id: 2 + body: { "number" : 51 } + + - do: + index: + index: test_1 + id: 3 + body: { "number" : 101 } + + - do: + index: + index: test_1 + id: 4 + body: { "number" : 151 } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "aggs" : { "histo" : { "histogram" : { "field" : "number", "interval" : 50 } } } } + + - match: { hits.total: 4 } + + - length: { aggregations.histo.buckets: 4 } + + - match: { aggregations.histo.buckets.0.key: 0 } + + - is_false: aggregations.histo.buckets.0.key_as_string + + - match: { aggregations.histo.buckets.0.doc_count: 1 } + + - match: { aggregations.histo.buckets.1.key: 50 } + + - is_false: aggregations.histo.buckets.1.key_as_string + + - match: { aggregations.histo.buckets.1.doc_count: 1 } + + - match: { aggregations.histo.buckets.2.key: 100 } + + - is_false: aggregations.histo.buckets.2.key_as_string + + - match: { aggregations.histo.buckets.2.doc_count: 1 } + + - match: { aggregations.histo.buckets.3.key: 150 } + + - is_false: aggregations.histo.buckets.3.key_as_string + + - match: { aggregations.histo.buckets.3.doc_count: 1 } + +--- +"Format test": + - do: + index: + index: test_1 + id: 1 + body: { "number" : 1 } + + - do: + index: + index: test_1 + id: 2 + body: { "number" : 51 } + + - do: + index: + index: test_1 + id: 3 + body: { "number" : 101 } + + - do: + index: + index: test_1 + id: 4 + body: { "number" : 151 } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "aggs" : { "histo" : { "histogram" : { "field" : "number", "interval" : 50, "format" : "Value is ##0.0" } } } } + + - match: { hits.total: 4 } + + - length: { aggregations.histo.buckets: 4 } + + - match: { aggregations.histo.buckets.0.key: 0 } + + - match: { aggregations.histo.buckets.0.key_as_string: "Value is 0.0" } + + - match: { aggregations.histo.buckets.0.doc_count: 1 } + + - match: { aggregations.histo.buckets.1.key: 50 } + + - match: { aggregations.histo.buckets.1.key_as_string: "Value is 50.0" } + + - match: { aggregations.histo.buckets.1.doc_count: 1 } + + - match: { aggregations.histo.buckets.2.key: 100 } + + - match: { aggregations.histo.buckets.2.key_as_string: "Value is 100.0" } + + - match: { aggregations.histo.buckets.2.doc_count: 1 } + + - match: { aggregations.histo.buckets.3.key: 150 } + + - match: { aggregations.histo.buckets.3.key_as_string: "Value is 150.0" } + + - match: { aggregations.histo.buckets.3.doc_count: 1 } + +--- +"Deprecated _time order": + + - skip: + version: " - 7.1.99" + reason: _time order deprecated in 6.0, replaced by _key. Calendar_interval added in 7.2 + features: "warnings" + + - do: + index: + index: test_1 + id: 1 + body: { "date" : "2016-01-01" } + + - do: + index: + index: test_1 + id: 2 + body: { "date" : "2016-01-02" } + + - do: + index: + index: test_1 + id: 3 + body: { "date" : "2016-02-01" } + + - do: + index: + index: test_1 + id: 4 + body: { "date" : "2016-03-01" } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "aggs" : { "histo" : { "date_histogram" : { "field" : "date", "calendar_interval" : "month", "order" : { "_time" : "desc" } } } } } + warnings: + - "Deprecated aggregation order key [_time] used, replaced by [_key]" + + - match: { hits.total: 4 } + + - length: { aggregations.histo.buckets: 3 } + + - match: { aggregations.histo.buckets.0.key_as_string: "2016-03-01T00:00:00.000Z" } + + - match: { aggregations.histo.buckets.0.doc_count: 1 } + + - match: { aggregations.histo.buckets.1.key_as_string: "2016-02-01T00:00:00.000Z" } + + - match: { aggregations.histo.buckets.1.doc_count: 1 } + + - match: { aggregations.histo.buckets.2.key_as_string: "2016-01-01T00:00:00.000Z" } + + - match: { aggregations.histo.buckets.2.doc_count: 2 } + +--- +"date_histogram": + - skip: + version: " - 7.1.99" + reason: calendar_interval introduced in 7.2.0 + + - do: + indices.create: + index: test_2 + body: + settings: + # There was a BWC issue that only showed up on empty shards. This + # test has 4 docs and 5 shards makes sure we get one empty. + number_of_shards: 5 + mappings: + properties: + date: + type: date + fields: + nanos: + type: date_nanos + + - do: + bulk: + index: test_2 + refresh: true + body: + - '{"index": {}}' + - '{"date": "2016-01-01"}' + - '{"index": {}}' + - '{"date": "2016-01-02"}' + - '{"index": {}}' + - '{"date": "2016-02-01"}' + - '{"index": {}}' + - '{"date": "2016-03-01"}' + + - do: + search: + body: + size: 0 + aggs: + histo: + date_histogram: + field: date + calendar_interval: month + - match: { hits.total.value: 4 } + - length: { aggregations.histo.buckets: 3 } + - match: { aggregations.histo.buckets.0.key_as_string: "2016-01-01T00:00:00.000Z" } + - match: { aggregations.histo.buckets.0.doc_count: 2 } + - match: { aggregations.histo.buckets.1.key_as_string: "2016-02-01T00:00:00.000Z" } + - match: { aggregations.histo.buckets.1.doc_count: 1 } + - match: { aggregations.histo.buckets.2.key_as_string: "2016-03-01T00:00:00.000Z" } + - match: { aggregations.histo.buckets.2.doc_count: 1 } + + - do: + search: + body: + size: 0 + aggs: + histo: + date_histogram: + field: date.nanos + calendar_interval: month + - match: { hits.total.value: 4 } + - length: { aggregations.histo.buckets: 3 } + - match: { aggregations.histo.buckets.0.key_as_string: "2016-01-01T00:00:00.000Z" } + - match: { aggregations.histo.buckets.0.doc_count: 2 } + - match: { aggregations.histo.buckets.1.key_as_string: "2016-02-01T00:00:00.000Z" } + - match: { aggregations.histo.buckets.1.doc_count: 1 } + - match: { aggregations.histo.buckets.2.key_as_string: "2016-03-01T00:00:00.000Z" } + - match: { aggregations.histo.buckets.2.doc_count: 1 } + +--- +"date_histogram with offset": + - skip: + version: "all" + reason: "AwaitsFix https://github.com/elastic/elasticsearch/issues/51525" + # When fixed, reinstate these lines + #version: " - 7.1.99" + #reason: calendar_interval introduced in 7.2.0 + + - do: + indices.create: + index: test_2 + body: + settings: + # There was a BWC issue that only showed up on empty shards. This + # test has 4 docs and 5 shards makes sure we get one empty. + number_of_shards: 5 + mappings: + properties: + date: + type : date + + - do: + bulk: + index: test_2 + refresh: true + body: + - '{"index": {}}' + - '{"date": "2016-01-01"}' + - '{"index": {}}' + - '{"date": "2016-01-02"}' + - '{"index": {}}' + - '{"date": "2016-02-01"}' + - '{"index": {}}' + - '{"date": "2016-03-01"}' + + - do: + search: + body: + size: 0 + aggs: + histo: + date_histogram: + field: date + calendar_interval: month + offset: +1d + + - match: { hits.total.value: 4 } + - length: { aggregations.histo.buckets: 3 } + - match: { aggregations.histo.buckets.0.key_as_string: "2015-12-02T00:00:00.000Z" } + - match: { aggregations.histo.buckets.0.doc_count: 1 } + - match: { aggregations.histo.buckets.1.key_as_string: "2016-01-02T00:00:00.000Z" } + - match: { aggregations.histo.buckets.1.doc_count: 2 } + - match: { aggregations.histo.buckets.2.key_as_string: "2016-02-02T00:00:00.000Z" } + - match: { aggregations.histo.buckets.2.doc_count: 1 } + + +--- +"date_histogram on range": + - skip: + version: " - 7.4.1" + reason: doc values on ranges implemented in 7.4.1 + + - do: + indices.create: + index: test_2 + body: + settings: + # There was a BWC issue that only showed up on empty shards. This + # test has 4 docs and 5 shards makes sure we get one empty. + number_of_shards: 5 + mappings: + properties: + range: + type : date_range + + - do: + bulk: + index: test_2 + refresh: true + body: + - '{"index": {}}' + - '{"range": {"gte": "2016-01-01", "lt": "2016-01-02"}}' + - '{"index": {}}' + - '{"range": {"gte": "2016-01-02", "lt": "2016-01-03"}}' + - '{"index": {}}' + - '{"range": {"gte": "2016-02-01", "lt": "2016-02-02"}}' + - '{"index": {}}' + - '{"range": {"gte": "2016-03-01", "lt": "2016-03-02"}}' + + - do: + search: + body: + size: 0 + aggs: + histo: + date_histogram: + field: range + calendar_interval: month + + - match: { hits.total.value: 4 } + - length: { aggregations.histo.buckets: 3 } + - match: { aggregations.histo.buckets.0.key_as_string: "2016-01-01T00:00:00.000Z" } + - match: { aggregations.histo.buckets.0.doc_count: 2 } + - match: { aggregations.histo.buckets.1.key_as_string: "2016-02-01T00:00:00.000Z" } + - match: { aggregations.histo.buckets.1.doc_count: 1 } + - match: { aggregations.histo.buckets.2.key_as_string: "2016-03-01T00:00:00.000Z" } + - match: { aggregations.histo.buckets.2.doc_count: 1 } + +--- +"date_histogram on range with offset": + - skip: + version: " - 7.4.1" + reason: doc values on ranges implemented in 7.4.1 + + - do: + indices.create: + index: test_2 + body: + settings: + # There was a BWC issue that only showed up on empty shards. This + # test has 4 docs and 5 shards makes sure we get one empty. + number_of_shards: 5 + mappings: + properties: + range: + type : date_range + + - do: + bulk: + index: test_2 + refresh: true + body: + - '{"index": {}}' + - '{"range": {"gte": "2016-01-01", "lt": "2016-01-02"}}' + - '{"index": {}}' + - '{"range": {"gte": "2016-01-02", "lt": "2016-01-03"}}' + - '{"index": {}}' + - '{"range": {"gte": "2016-02-01", "lt": "2016-02-02"}}' + - '{"index": {}}' + - '{"range": {"gte": "2016-03-01", "lt": "2016-03-02"}}' + + - do: + search: + body: + size: 0 + aggs: + histo: + date_histogram: + field: range + calendar_interval: month + offset: +1d + + - match: { hits.total.value: 4 } + - length: { aggregations.histo.buckets: 3 } + - match: { aggregations.histo.buckets.0.key_as_string: "2015-12-02T00:00:00.000Z" } + - match: { aggregations.histo.buckets.0.doc_count: 1 } + - match: { aggregations.histo.buckets.1.key_as_string: "2016-01-02T00:00:00.000Z" } + - match: { aggregations.histo.buckets.1.doc_count: 2 } + - match: { aggregations.histo.buckets.2.key_as_string: "2016-02-02T00:00:00.000Z" } + - match: { aggregations.histo.buckets.2.doc_count: 1 } + +--- +"date_histogram with pre-epoch daylight savings time transition": + - skip: + version: " - 7.6.1" + reason: bug fixed in 7.6.1. + # Add date_nanos to the mapping. We couldn't do it during setup because that + # is run against 6.8 which doesn't have date_nanos + - do: + indices.put_mapping: + index: test_1 + body: + properties: + number: + type: integer + date: + type: date + fields: + nanos: + type: date_nanos + + - do: + bulk: + index: test_1 + refresh: true + body: + - '{"index": {}}' + - '{"date": "2016-01-01"}' + + - do: + search: + body: + size: 0 + aggs: + histo: + date_histogram: + field: date + fixed_interval: 1ms + time_zone: America/Phoenix + + - match: { hits.total.value: 1 } + - length: { aggregations.histo.buckets: 1 } + - match: { aggregations.histo.buckets.0.key_as_string: "2015-12-31T17:00:00.000-07:00" } + - match: { aggregations.histo.buckets.0.doc_count: 1 } + + - do: + search: + body: + size: 0 + aggs: + histo: + date_histogram: + field: date.nanos + fixed_interval: 1ms + time_zone: America/Phoenix + + - match: { hits.total.value: 1 } + - length: { aggregations.histo.buckets: 1 } + - match: { aggregations.histo.buckets.0.key_as_string: "2015-12-31T17:00:00.000-07:00" } + - match: { aggregations.histo.buckets.0.doc_count: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/110_max_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/110_max_metric.yml new file mode 100644 index 0000000000000..4235679746115 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/110_max_metric.yml @@ -0,0 +1,177 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + int_field: + type : integer + double_field: + type : double + string_field: + type: keyword + + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 1 + - int_field: 1 + double_field: 1.0 + string_field: foo + - index: + _index: test_1 + _id: 2 + - int_field: 51 + double_field: 51.0 + string_field: foo + - index: + _index: test_1 + _id: 3 + - int_field: 101 + double_field: 101.0 + string_field: foo + - index: + _index: test_1 + _id: 4 + - int_field: 151 + double_field: 151.0 + string_field: foo + +--- +"Basic test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_max: + max: + field: int_field + the_double_max: + max: + field: double_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_max.value: 151.0 } + - match: { aggregations.the_double_max.value: 151.0 } + +--- +"Only aggs test": + + - do: + search: + rest_total_hits_as_int: true + body: + size: 0 + aggs: + the_int_max: + max: + field: int_field + the_double_max: + max: + field: double_field + + - match: { hits.total: 4 } + - length: { hits.hits: 0 } + - match: { aggregations.the_int_max.value: 151.0 } + - match: { aggregations.the_double_max.value: 151.0 } + +--- +"Filtered test": + + - do: + search: + rest_total_hits_as_int: true + body: + query: + constant_score: + filter: + range: + int_field: + lte: 60 + aggs: + the_int_max: + max: + field: int_field + the_double_max: + max: + field: double_field + + - match: { hits.total: 2 } + - length: { hits.hits: 2 } + - match: { aggregations.the_int_max.value: 51.0 } + - match: { aggregations.the_double_max.value: 51.0 } + + +--- +"Missing field with missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_missing_max: + max: + field: foo + missing: 1 + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_missing_max.value: 1 } + +--- +"Missing field without missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_missing_max: + max: + field: foo + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - is_false: aggregations.the_missing_max.value + +--- +"Metadata test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_max: + meta: + foo: bar + max: + field: int_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_max.value: 151.0 } + - match: { aggregations.the_int_max.meta.foo: "bar" } + +--- +"Aggregating wrong datatype test": + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + body: + aggs: + the_string_avg: + avg: + field: string_field diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/120_min_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/120_min_metric.yml new file mode 100644 index 0000000000000..eb68357258507 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/120_min_metric.yml @@ -0,0 +1,177 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + int_field: + type : integer + double_field: + type : double + string_field: + type: keyword + + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 1 + - int_field: 1 + double_field: 1.0 + string_field: foo + - index: + _index: test_1 + _id: 2 + - int_field: 51 + double_field: 51.0 + string_field: foo + - index: + _index: test_1 + _id: 3 + - int_field: 101 + double_field: 101.0 + string_field: foo + - index: + _index: test_1 + _id: 4 + - int_field: 151 + double_field: 151.0 + string_field: foo + +--- +"Basic test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_min: + min: + field: int_field + the_double_min: + min: + field: double_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_min.value: 1.0 } + - match: { aggregations.the_double_min.value: 1.0 } + +--- +"Only aggs test": + + - do: + search: + rest_total_hits_as_int: true + body: + size: 0 + aggs: + the_int_min: + min: + field: int_field + the_double_min: + min: + field: double_field + + - match: { hits.total: 4 } + - length: { hits.hits: 0 } + - match: { aggregations.the_int_min.value: 1.0 } + - match: { aggregations.the_double_min.value: 1.0 } + +--- +"Filtered test": + + - do: + search: + rest_total_hits_as_int: true + body: + query: + constant_score: + filter: + range: + int_field: + gte: 50 + aggs: + the_int_min: + min: + field: int_field + the_double_min: + min: + field: double_field + + - match: { hits.total: 3 } + - length: { hits.hits: 3 } + - match: { aggregations.the_int_min.value: 51.0 } + - match: { aggregations.the_double_min.value: 51.0 } + + +--- +"Missing field with missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_missing_min: + min: + field: foo + missing: 1 + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_missing_min.value: 1.0 } + +--- +"Missing field without missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_missing_min: + min: + field: foo + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - is_false: aggregations.the_missing_min.value + +--- +"Metadata test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_min: + meta: + foo: bar + min: + field: int_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_min.value: 1.0 } + - match: { aggregations.the_int_min.meta.foo: "bar" } + +--- +"Aggregating wrong datatype test": + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + body: + aggs: + the_string_min: + min: + field: string_field diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/130_sum_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/130_sum_metric.yml new file mode 100644 index 0000000000000..3221543276115 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/130_sum_metric.yml @@ -0,0 +1,177 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + int_field: + type : integer + double_field: + type : double + string_field: + type: keyword + + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 1 + - int_field: 1 + double_field: 1.0 + string_field: foo + - index: + _index: test_1 + _id: 2 + - int_field: 51 + double_field: 51.0 + string_field: foo + - index: + _index: test_1 + _id: 3 + - int_field: 101 + double_field: 101.0 + string_field: foo + - index: + _index: test_1 + _id: 4 + - int_field: 151 + double_field: 151.0 + string_field: foo + +--- +"Basic test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_sum: + sum: + field: int_field + the_double_sum: + sum: + field: double_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_sum.value: 304.0 } + - match: { aggregations.the_double_sum.value: 304.0 } + +--- +"Only aggs test": + + - do: + search: + rest_total_hits_as_int: true + body: + size: 0 + aggs: + the_int_sum: + sum: + field: int_field + the_double_sum: + sum: + field: double_field + + - match: { hits.total: 4 } + - length: { hits.hits: 0 } + - match: { aggregations.the_int_sum.value: 304.0 } + - match: { aggregations.the_double_sum.value: 304.0 } + +--- +"Filtered test": + + - do: + search: + rest_total_hits_as_int: true + body: + query: + constant_score: + filter: + range: + int_field: + gte: 50 + aggs: + the_int_sum: + sum: + field: int_field + the_double_sum: + sum: + field: double_field + + - match: { hits.total: 3 } + - length: { hits.hits: 3 } + - match: { aggregations.the_int_sum.value: 303.0 } + - match: { aggregations.the_double_sum.value: 303.0 } + + +--- +"Missing field with missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_missing_sum: + sum: + field: foo + missing: 1 + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_missing_sum.value: 4.0 } + +--- +"Missing field without missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_missing_sum: + sum: + field: foo + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_missing_sum.value: 0.0 } + +--- +"Metadata test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_sum: + meta: + foo: bar + sum: + field: int_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_sum.value: 304.0 } + - match: { aggregations.the_int_sum.meta.foo: "bar" } + +--- +"Aggregating wrong datatype test": + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + body: + aggs: + the_string_sum: + sum: + field: string_field diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/140_value_count_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/140_value_count_metric.yml new file mode 100644 index 0000000000000..b5ac7d2e5db01 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/140_value_count_metric.yml @@ -0,0 +1,176 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + int_field: + type : integer + double_field: + type : double + string_field: + type: keyword + + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 1 + - int_field: 1 + double_field: 1.0 + string_field: foo + - index: + _index: test_1 + _id: 2 + - int_field: 51 + double_field: 51.0 + string_field: foo + - index: + _index: test_1 + _id: 3 + - int_field: 101 + double_field: 101.0 + string_field: foo + - index: + _index: test_1 + _id: 4 + - int_field: 151 + double_field: 151.0 + string_field: foo + +--- +"Basic test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_value_count: + value_count: + field: int_field + the_double_value_count: + value_count: + field: double_field + the_string_value_count: + value_count: + field: string_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_value_count.value: 4 } + - match: { aggregations.the_double_value_count.value: 4 } + - match: { aggregations.the_string_value_count.value: 4 } + +--- +"Only aggs test": + + - do: + search: + rest_total_hits_as_int: true + body: + size: 0 + aggs: + the_int_value_count: + value_count: + field: int_field + the_double_value_count: + value_count: + field: double_field + the_string_value_count: + value_count: + field: string_field + + - match: { hits.total: 4 } + - length: { hits.hits: 0 } + - match: { aggregations.the_int_value_count.value: 4 } + - match: { aggregations.the_double_value_count.value: 4 } + - match: { aggregations.the_string_value_count.value: 4 } + +--- +"Filtered test": + + - do: + search: + rest_total_hits_as_int: true + body: + query: + constant_score: + filter: + range: + int_field: + gte: 50 + aggs: + the_int_value_count: + value_count: + field: int_field + the_double_value_count: + value_count: + field: double_field + the_string_value_count: + value_count: + field: string_field + + - match: { hits.total: 3 } + - length: { hits.hits: 3 } + - match: { aggregations.the_int_value_count.value: 3 } + - match: { aggregations.the_double_value_count.value: 3 } + - match: { aggregations.the_string_value_count.value: 3 } + + +--- +"Missing field with missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_missing_value_count: + value_count: + field: foo + missing: 1 + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_missing_value_count.value: 4 } + +--- +"Missing field without missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_missing_value_count: + value_count: + field: foo + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - is_false: aggregations.the_missing_value_count.value + +--- +"Metadata test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_value_count: + meta: + foo: bar + value_count: + field: int_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_value_count.value: 4 } + - match: { aggregations.the_int_value_count.meta.foo: "bar" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/150_stats_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/150_stats_metric.yml new file mode 100644 index 0000000000000..2afad21e61421 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/150_stats_metric.yml @@ -0,0 +1,195 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + int_field: + type : integer + double_field: + type : double + string_field: + type: keyword + + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 1 + - int_field: 1 + double_field: 1.0 + string_field: foo + - index: + _index: test_1 + _id: 2 + - int_field: 51 + double_field: 51.0 + string_field: foo + - index: + _index: test_1 + _id: 3 + - int_field: 101 + double_field: 101.0 + string_field: foo + - index: + _index: test_1 + _id: 4 + - int_field: 151 + double_field: 151.0 + string_field: foo + +--- +"Basic test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_stats: + stats: + field: int_field + the_double_stats: + stats: + field: double_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_stats.count: 4 } + - match: { aggregations.the_int_stats.min: 1.0 } + - match: { aggregations.the_int_stats.max: 151.0 } + - match: { aggregations.the_int_stats.avg: 76.0 } + - match: { aggregations.the_int_stats.sum: 304.0 } + - match: { aggregations.the_double_stats.count: 4 } + - match: { aggregations.the_double_stats.min: 1.0 } + - match: { aggregations.the_double_stats.max: 151.0 } + - match: { aggregations.the_double_stats.avg: 76.0 } + - match: { aggregations.the_double_stats.sum: 304.0 } + +--- +"Only aggs test": + + - do: + search: + rest_total_hits_as_int: true + body: + size: 0 + aggs: + the_int_stats: + stats: + field: int_field + the_double_stats: + stats: + field: double_field + + - match: { hits.total: 4 } + - length: { hits.hits: 0 } + - match: { aggregations.the_int_stats.count: 4 } + - match: { aggregations.the_int_stats.min: 1.0 } + - match: { aggregations.the_int_stats.max: 151.0 } + - match: { aggregations.the_int_stats.avg: 76.0 } + - match: { aggregations.the_int_stats.sum: 304.0 } + - match: { aggregations.the_double_stats.count: 4 } + - match: { aggregations.the_double_stats.min: 1.0 } + - match: { aggregations.the_double_stats.max: 151.0 } + - match: { aggregations.the_double_stats.avg: 76.0 } + - match: { aggregations.the_double_stats.sum: 304.0 } + +--- +"Filtered test": + + - do: + search: + rest_total_hits_as_int: true + body: + query: + constant_score: + filter: + range: + int_field: + gte: 50 + aggs: + the_int_stats: + stats: + field: int_field + the_double_stats: + stats: + field: double_field + + - match: { hits.total: 3 } + - length: { hits.hits: 3 } + - match: { aggregations.the_int_stats.count: 3 } + - match: { aggregations.the_int_stats.min: 51.0 } + - match: { aggregations.the_int_stats.max: 151.0 } + - match: { aggregations.the_int_stats.avg: 101.0 } + - match: { aggregations.the_int_stats.sum: 303.0 } + - match: { aggregations.the_double_stats.count: 3 } + - match: { aggregations.the_double_stats.min: 51.0 } + - match: { aggregations.the_double_stats.max: 151.0 } + - match: { aggregations.the_double_stats.avg: 101.0 } + - match: { aggregations.the_double_stats.sum: 303.0 } + + +--- +"Missing field with missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_missing_stats: + stats: + field: foo + missing: 1 + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_missing_stats.count: 4 } + - match: { aggregations.the_missing_stats.min: 1.0 } + - match: { aggregations.the_missing_stats.max: 1.0 } + - match: { aggregations.the_missing_stats.avg: 1.0 } + - match: { aggregations.the_missing_stats.sum: 4.0 } + +--- +"Missing field without missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_missing_stats: + stats: + field: foo + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - is_false: aggregations.the_missing_stats.value + +--- +"Metadata test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_stats: + meta: + foo: bar + stats: + field: int_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_stats.count: 4 } + - match: { aggregations.the_int_stats.min: 1.0 } + - match: { aggregations.the_int_stats.max: 151.0 } + - match: { aggregations.the_int_stats.avg: 76.0 } + - match: { aggregations.the_int_stats.sum: 304.0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/160_extended_stats_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/160_extended_stats_metric.yml new file mode 100644 index 0000000000000..c70ca3356767a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/160_extended_stats_metric.yml @@ -0,0 +1,295 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + int_field: + type : integer + double_field: + type : double + string_field: + type: keyword + + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 1 + - int_field: 1 + double_field: 1.0 + string_field: foo + - index: + _index: test_1 + _id: 2 + - int_field: 51 + double_field: 51.0 + string_field: foo + - index: + _index: test_1 + _id: 3 + - int_field: 101 + double_field: 101.0 + string_field: foo + - index: + _index: test_1 + _id: 4 + - int_field: 151 + double_field: 151.0 + string_field: foo + +--- +"Basic test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_extended_stats: + extended_stats: + field: int_field + the_double_extended_stats: + extended_stats: + field: double_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_extended_stats.count: 4 } + - match: { aggregations.the_int_extended_stats.min: 1.0 } + - match: { aggregations.the_int_extended_stats.max: 151.0 } + - match: { aggregations.the_int_extended_stats.avg: 76.0 } + - match: { aggregations.the_int_extended_stats.sum: 304.0 } + - match: { aggregations.the_int_extended_stats.sum_of_squares: 35604.0 } + - match: { aggregations.the_int_extended_stats.std_deviation: 55.90169943749474 } + - match: { aggregations.the_int_extended_stats.std_deviation_bounds.upper: 187.80339887498948 } + - match: { aggregations.the_int_extended_stats.std_deviation_bounds.lower: -35.80339887498948 } + - match: { aggregations.the_double_extended_stats.count: 4 } + - match: { aggregations.the_double_extended_stats.min: 1.0 } + - match: { aggregations.the_double_extended_stats.max: 151.0 } + - match: { aggregations.the_double_extended_stats.avg: 76.0 } + - match: { aggregations.the_double_extended_stats.sum: 304.0 } + - match: { aggregations.the_double_extended_stats.sum_of_squares: 35604.0 } + - match: { aggregations.the_double_extended_stats.std_deviation: 55.90169943749474 } + - match: { aggregations.the_double_extended_stats.std_deviation_bounds.upper: 187.80339887498948 } + - match: { aggregations.the_double_extended_stats.std_deviation_bounds.lower: -35.80339887498948 } + +--- +"Only aggs test": + + - do: + search: + rest_total_hits_as_int: true + body: + size: 0 + aggs: + the_int_extended_stats: + extended_stats: + field: int_field + the_double_extended_stats: + extended_stats: + field: double_field + + - match: { hits.total: 4 } + - length: { hits.hits: 0 } + - match: { aggregations.the_int_extended_stats.count: 4 } + - match: { aggregations.the_int_extended_stats.min: 1.0 } + - match: { aggregations.the_int_extended_stats.max: 151.0 } + - match: { aggregations.the_int_extended_stats.avg: 76.0 } + - match: { aggregations.the_int_extended_stats.sum: 304.0 } + - match: { aggregations.the_int_extended_stats.sum_of_squares: 35604.0 } + - match: { aggregations.the_int_extended_stats.std_deviation: 55.90169943749474 } + - match: { aggregations.the_int_extended_stats.variance: 3125.0 } + - match: { aggregations.the_int_extended_stats.std_deviation_bounds.upper: 187.80339887498948 } + - match: { aggregations.the_int_extended_stats.std_deviation_bounds.lower: -35.80339887498948 } + - match: { aggregations.the_double_extended_stats.count: 4 } + - match: { aggregations.the_double_extended_stats.min: 1.0 } + - match: { aggregations.the_double_extended_stats.max: 151.0 } + - match: { aggregations.the_double_extended_stats.avg: 76.0 } + - match: { aggregations.the_double_extended_stats.sum: 304.0 } + - match: { aggregations.the_double_extended_stats.sum_of_squares: 35604.0 } + - match: { aggregations.the_double_extended_stats.std_deviation: 55.90169943749474 } + - match: { aggregations.the_double_extended_stats.variance: 3125.0 } + - match: { aggregations.the_double_extended_stats.std_deviation_bounds.upper: 187.80339887498948 } + - match: { aggregations.the_double_extended_stats.std_deviation_bounds.lower: -35.80339887498948 } + +--- +"Filtered test": + + - do: + search: + rest_total_hits_as_int: true + body: + query: + constant_score: + filter: + range: + int_field: + gte: 50 + aggs: + the_int_extended_stats: + extended_stats: + field: int_field + the_double_extended_stats: + extended_stats: + field: double_field + + - match: { hits.total: 3 } + - length: { hits.hits: 3 } + - match: { aggregations.the_int_extended_stats.count: 3 } + - match: { aggregations.the_int_extended_stats.min: 51.0 } + - match: { aggregations.the_int_extended_stats.max: 151.0 } + - match: { aggregations.the_int_extended_stats.avg: 101.0 } + - match: { aggregations.the_int_extended_stats.sum: 303.0 } + - match: { aggregations.the_int_extended_stats.sum_of_squares: 35603.0 } + - match: { aggregations.the_int_extended_stats.variance: 1666.6666666666667 } + - match: { aggregations.the_int_extended_stats.std_deviation: 40.824829046386306 } + - match: { aggregations.the_int_extended_stats.std_deviation_bounds.upper: 182.6496580927726 } + - match: { aggregations.the_int_extended_stats.std_deviation_bounds.lower: 19.35034190722739 } + - match: { aggregations.the_double_extended_stats.count: 3 } + - match: { aggregations.the_double_extended_stats.min: 51.0 } + - match: { aggregations.the_double_extended_stats.max: 151.0 } + - match: { aggregations.the_double_extended_stats.avg: 101.0 } + - match: { aggregations.the_double_extended_stats.sum: 303.0 } + - match: { aggregations.the_double_extended_stats.sum_of_squares: 35603.0 } + - match: { aggregations.the_double_extended_stats.variance: 1666.6666666666667 } + - match: { aggregations.the_double_extended_stats.std_deviation: 40.824829046386306 } + - match: { aggregations.the_double_extended_stats.std_deviation_bounds.upper: 182.6496580927726 } + - match: { aggregations.the_double_extended_stats.std_deviation_bounds.lower: 19.35034190722739 } + + +--- +"Missing field with missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_missing_extended_stats: + extended_stats: + field: foo + missing: 1 + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_missing_extended_stats.count: 4 } + - match: { aggregations.the_missing_extended_stats.min: 1.0 } + - match: { aggregations.the_missing_extended_stats.max: 1.0 } + - match: { aggregations.the_missing_extended_stats.avg: 1.0 } + - match: { aggregations.the_missing_extended_stats.sum: 4.0 } + - match: { aggregations.the_missing_extended_stats.sum_of_squares: 4.0 } + - match: { aggregations.the_missing_extended_stats.variance: 0.0 } + - match: { aggregations.the_missing_extended_stats.std_deviation: 0.0 } + - match: { aggregations.the_missing_extended_stats.std_deviation_bounds.upper: 1.0 } + - match: { aggregations.the_missing_extended_stats.std_deviation_bounds.lower: 1.0 } + +--- +"Missing field without missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_missing_extended_stats: + extended_stats: + field: foo + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - is_false: aggregations.the_missing_extended_stats.value + +--- +"Metadata test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_extended_stats: + meta: + foo: bar + extended_stats: + field: int_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_extended_stats.count: 4 } + - match: { aggregations.the_int_extended_stats.min: 1.0 } + - match: { aggregations.the_int_extended_stats.max: 151.0 } + - match: { aggregations.the_int_extended_stats.avg: 76.0 } + - match: { aggregations.the_int_extended_stats.sum: 304.0 } + - match: { aggregations.the_int_extended_stats.sum_of_squares: 35604.0 } + - match: { aggregations.the_int_extended_stats.std_deviation: 55.90169943749474 } + - match: { aggregations.the_int_extended_stats.std_deviation_bounds.upper: 187.80339887498948 } + - match: { aggregations.the_int_extended_stats.std_deviation_bounds.lower: -35.80339887498948 } + +--- +"Sigma test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_extended_stats: + extended_stats: + field: int_field + sigma: 3 + the_double_extended_stats: + extended_stats: + field: double_field + sigma: 3 + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_extended_stats.count: 4 } + - match: { aggregations.the_int_extended_stats.min: 1.0 } + - match: { aggregations.the_int_extended_stats.max: 151.0 } + - match: { aggregations.the_int_extended_stats.avg: 76.0 } + - match: { aggregations.the_int_extended_stats.sum: 304.0 } + - match: { aggregations.the_int_extended_stats.sum_of_squares: 35604.0 } + - match: { aggregations.the_int_extended_stats.std_deviation: 55.90169943749474 } + - match: { aggregations.the_int_extended_stats.std_deviation_bounds.upper: 243.7050983124842 } + - match: { aggregations.the_int_extended_stats.std_deviation_bounds.lower: -91.70509831248421 } + - match: { aggregations.the_double_extended_stats.count: 4 } + - match: { aggregations.the_double_extended_stats.min: 1.0 } + - match: { aggregations.the_double_extended_stats.max: 151.0 } + - match: { aggregations.the_double_extended_stats.avg: 76.0 } + - match: { aggregations.the_double_extended_stats.sum: 304.0 } + - match: { aggregations.the_double_extended_stats.sum_of_squares: 35604.0 } + - match: { aggregations.the_double_extended_stats.std_deviation: 55.90169943749474 } + - match: { aggregations.the_double_extended_stats.std_deviation_bounds.upper: 243.7050983124842 } + - match: { aggregations.the_double_extended_stats.std_deviation_bounds.lower: -91.70509831248421 } + +--- +"Bad sigma test": + + - do: + catch: /\[sigma\] must be greater than or equal to 0. Found \[-1.0\] in \[the_int_extended_stats\]/ + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_extended_stats: + extended_stats: + field: int_field + sigma: -1 + + - do: + catch: /x_content_parse_exception/ + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_extended_stats: + extended_stats: + field: int_field + sigma: "foo" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/170_cardinality_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/170_cardinality_metric.yml new file mode 100644 index 0000000000000..482ab05291a4d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/170_cardinality_metric.yml @@ -0,0 +1,214 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + int_field: + type : integer + double_field: + type : double + string_field: + type: keyword + + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 1 + - int_field: 1 + double_field: 1.0 + string_field: foo + - index: + _index: test_1 + _id: 2 + - int_field: 51 + double_field: 51.0 + string_field: foo + - index: + _index: test_1 + _id: 3 + - int_field: 101 + double_field: 101.0 + string_field: foo + - index: + _index: test_1 + _id: 4 + - int_field: 151 + double_field: 151.0 + string_field: foo + +--- +"Basic test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + distinct_int: + cardinality: + field: int_field + distinct_double: + cardinality: + field: double_field + distinct_string: + cardinality: + field: string_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.distinct_int.value: 4 } + - match: { aggregations.distinct_double.value: 4 } + - match: { aggregations.distinct_string.value: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + distinct_int: + cardinality: + field: int_field + precision_threshold: 100 + distinct_double: + cardinality: + field: double_field + precision_threshold: 100 + distinct_string: + cardinality: + field: string_field + precision_threshold: 100 + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.distinct_int.value: 4 } + - match: { aggregations.distinct_double.value: 4 } + - match: { aggregations.distinct_string.value: 1 } + +--- +"Only aggs test": + + - do: + search: + rest_total_hits_as_int: true + body: + size: 0 + aggs: + distinct_int: + cardinality: + field: int_field + distinct_double: + cardinality: + field: double_field + distinct_string: + cardinality: + field: string_field + + - match: { hits.total: 4 } + - length: { hits.hits: 0 } + - match: { aggregations.distinct_int.value: 4 } + - match: { aggregations.distinct_double.value: 4 } + - match: { aggregations.distinct_string.value: 1 } + +--- +"Filtered test": + + - do: + search: + rest_total_hits_as_int: true + body: + query: + constant_score: + filter: + range: + int_field: + gte: 50 + aggs: + distinct_int: + cardinality: + field: int_field + distinct_double: + cardinality: + field: double_field + distinct_string: + cardinality: + field: string_field + + - match: { hits.total: 3 } + - length: { hits.hits: 3 } + - match: { aggregations.distinct_int.value: 3 } + - match: { aggregations.distinct_double.value: 3 } + - match: { aggregations.distinct_string.value: 1 } + + +--- +"Missing field with missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + distinct_missing: + cardinality: + field: missing_field + missing: "foo" + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.distinct_missing.value: 1 } + +--- +"Missing field without missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + distinct_missing: + cardinality: + field: missing_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - is_false: aggregations.distinct_missing.value + +--- +"Metadata test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + distinct_missing: + meta: + foo: bar + cardinality: + field: int_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.distinct_missing.value: 4 } + - match: { aggregations.distinct_missing.meta.foo: "bar" } + +--- +"Invalid Precision test": + + - do: + catch: /\[precisionThreshold\] must be greater than or equal to 0. Found \[-1\] in \[distinct_int\]/ + search: + rest_total_hits_as_int: true + body: + aggs: + distinct_int: + cardinality: + field: int_field + precision_threshold: -1 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/180_percentiles_tdigest_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/180_percentiles_tdigest_metric.yml new file mode 100644 index 0000000000000..faae9c1ccda82 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/180_percentiles_tdigest_metric.yml @@ -0,0 +1,371 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + int_field: + type : integer + double_field: + type : double + string_field: + type: keyword + + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 1 + - int_field: 1 + double_field: 1.0 + string_field: foo + - index: + _index: test_1 + _id: 2 + - int_field: 51 + double_field: 51.0 + string_field: foo + - index: + _index: test_1 + _id: 3 + - int_field: 101 + double_field: 101.0 + string_field: foo + - index: + _index: test_1 + _id: 4 + - int_field: 151 + double_field: 151.0 + string_field: foo + +--- +"Basic test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + percentiles_double: + percentiles: + field: double_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + + - match: { aggregations.percentiles_int.values.1\.0: 1.0 } + - match: { aggregations.percentiles_int.values.5\.0: 1.0 } + - match: { aggregations.percentiles_int.values.25\.0: 26.0 } + - match: { aggregations.percentiles_int.values.50\.0: 76.0 } + - match: { aggregations.percentiles_int.values.75\.0: 126.0 } + - match: { aggregations.percentiles_int.values.95\.0: 151.0 } + - match: { aggregations.percentiles_int.values.99\.0: 151.0 } + + - match: { aggregations.percentiles_double.values.1\.0: 1.0 } + - match: { aggregations.percentiles_double.values.5\.0: 1.0 } + - match: { aggregations.percentiles_double.values.25\.0: 26.0 } + - match: { aggregations.percentiles_double.values.50\.0: 76.0 } + - match: { aggregations.percentiles_double.values.75\.0: 126.0 } + - match: { aggregations.percentiles_double.values.95\.0: 151.0 } + - match: { aggregations.percentiles_double.values.99\.0: 151.0 } + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + tdigest: + compression: 200 + percentiles_double: + percentiles: + field: double_field + tdigest: + compression: 200 + + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + + - match: { aggregations.percentiles_int.values.1\.0: 1.0 } + - match: { aggregations.percentiles_int.values.5\.0: 1.0 } + - match: { aggregations.percentiles_int.values.25\.0: 26.0 } + - match: { aggregations.percentiles_int.values.50\.0: 76.0 } + - match: { aggregations.percentiles_int.values.75\.0: 126.0 } + - match: { aggregations.percentiles_int.values.95\.0: 151.0 } + - match: { aggregations.percentiles_int.values.99\.0: 151.0 } + + - match: { aggregations.percentiles_double.values.1\.0: 1.0 } + - match: { aggregations.percentiles_double.values.5\.0: 1.0 } + - match: { aggregations.percentiles_double.values.25\.0: 26.0 } + - match: { aggregations.percentiles_double.values.50\.0: 76.0 } + - match: { aggregations.percentiles_double.values.75\.0: 126.0 } + - match: { aggregations.percentiles_double.values.95\.0: 151.0 } + - match: { aggregations.percentiles_double.values.99\.0: 151.0 } + + +--- +"Only aggs test": + + - do: + search: + rest_total_hits_as_int: true + body: + size: 0 + aggs: + percentiles_int: + percentiles: + field: int_field + percentiles_double: + percentiles: + field: double_field + + - match: { hits.total: 4 } + - length: { hits.hits: 0 } + + - match: { aggregations.percentiles_int.values.1\.0: 1.0 } + - match: { aggregations.percentiles_int.values.5\.0: 1.0 } + - match: { aggregations.percentiles_int.values.25\.0: 26.0 } + - match: { aggregations.percentiles_int.values.50\.0: 76.0 } + - match: { aggregations.percentiles_int.values.75\.0: 126.0 } + - match: { aggregations.percentiles_int.values.95\.0: 151.0 } + - match: { aggregations.percentiles_int.values.99\.0: 151.0 } + + - match: { aggregations.percentiles_double.values.1\.0: 1.0 } + - match: { aggregations.percentiles_double.values.5\.0: 1.0 } + - match: { aggregations.percentiles_double.values.25\.0: 26.0 } + - match: { aggregations.percentiles_double.values.50\.0: 76.0 } + - match: { aggregations.percentiles_double.values.75\.0: 126.0 } + - match: { aggregations.percentiles_double.values.95\.0: 151.0 } + - match: { aggregations.percentiles_double.values.99\.0: 151.0 } + + + +--- +"Filtered test": + + - do: + search: + rest_total_hits_as_int: true + body: + query: + constant_score: + filter: + range: + int_field: + gte: 50 + aggs: + percentiles_int: + percentiles: + field: int_field + percentiles_double: + percentiles: + field: double_field + + - match: { hits.total: 3 } + - length: { hits.hits: 3 } + + - match: { aggregations.percentiles_int.values.1\.0: 51.0 } + - match: { aggregations.percentiles_int.values.5\.0: 51.0 } + - match: { aggregations.percentiles_int.values.25\.0: 63.5 } + - match: { aggregations.percentiles_int.values.50\.0: 101.0 } + - match: { aggregations.percentiles_int.values.75\.0: 138.5 } + - match: { aggregations.percentiles_int.values.95\.0: 151.0 } + - match: { aggregations.percentiles_int.values.99\.0: 151.0 } + + - match: { aggregations.percentiles_double.values.1\.0: 51.0 } + - match: { aggregations.percentiles_double.values.5\.0: 51.0 } + - match: { aggregations.percentiles_double.values.25\.0: 63.5 } + - match: { aggregations.percentiles_double.values.50\.0: 101.0 } + - match: { aggregations.percentiles_double.values.75\.0: 138.5 } + - match: { aggregations.percentiles_double.values.95\.0: 151.0 } + - match: { aggregations.percentiles_double.values.99\.0: 151.0 } + +--- +"Missing field with missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_missing: + percentiles: + field: missing_field + missing: 1.0 + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + + - match: { aggregations.percentiles_missing.values.1\.0: 1.0 } + - match: { aggregations.percentiles_missing.values.5\.0: 1.0 } + - match: { aggregations.percentiles_missing.values.25\.0: 1.0 } + - match: { aggregations.percentiles_missing.values.50\.0: 1.0 } + - match: { aggregations.percentiles_missing.values.75\.0: 1.0 } + - match: { aggregations.percentiles_missing.values.95\.0: 1.0 } + - match: { aggregations.percentiles_missing.values.99\.0: 1.0 } + +--- +"Missing field without missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_missing: + percentiles: + field: missing_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - is_false: aggregations.percentiles_missing.value + +--- +"Metadata test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + meta: + foo: bar + percentiles: + field: int_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.percentiles_int.meta.foo: "bar" } + + + - match: { aggregations.percentiles_int.values.1\.0: 1.0 } + - match: { aggregations.percentiles_int.values.5\.0: 1.0 } + - match: { aggregations.percentiles_int.values.25\.0: 26.0 } + - match: { aggregations.percentiles_int.values.50\.0: 76.0 } + - match: { aggregations.percentiles_int.values.75\.0: 126.0 } + - match: { aggregations.percentiles_int.values.95\.0: 151.0 } + - match: { aggregations.percentiles_int.values.99\.0: 151.0 } + +--- +"Invalid params test": + + - do: + catch: /\[compression\] must be greater than or equal to 0. Found \[-1.0\] in \[percentiles_int\]/ + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + tdigest: + compression: -1 + + - do: + catch: /\[percents\] must not be empty/ + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + percents: [] + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + percents: null + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + percents: ["foo"] + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_string: + percentiles: + field: string_field + +--- +"Explicit Percents test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + percents: [5.0, 25.0, 50.0] + percentiles_double: + percentiles: + field: double_field + percents: [5.0, 25.0, 50.0] + + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + + - match: { aggregations.percentiles_int.values.5\.0: 1.0 } + - match: { aggregations.percentiles_int.values.25\.0: 26.0 } + - match: { aggregations.percentiles_int.values.50\.0: 76.0 } + + - match: { aggregations.percentiles_double.values.5\.0: 1.0 } + - match: { aggregations.percentiles_double.values.25\.0: 26.0 } + - match: { aggregations.percentiles_double.values.50\.0: 76.0 } + +--- +"Non-keyed test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + percents: [5.0, 25.0, 50.0] + keyed: false + + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + + - match: { aggregations.percentiles_int.values.0.key: 5.0 } + - match: { aggregations.percentiles_int.values.0.value: 1.0 } + - match: { aggregations.percentiles_int.values.1.key: 25.0 } + - match: { aggregations.percentiles_int.values.1.value: 26.0 } + - match: { aggregations.percentiles_int.values.2.key: 50.0 } + - match: { aggregations.percentiles_int.values.2.value: 76.0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/190_percentiles_hdr_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/190_percentiles_hdr_metric.yml new file mode 100644 index 0000000000000..809e18458f0bd --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/190_percentiles_hdr_metric.yml @@ -0,0 +1,450 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + number_of_shards: 5 + number_of_routing_shards: 5 + mappings: + properties: + int_field: + type : integer + double_field: + type : double + string_field: + type: keyword + + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 1 + - int_field: 1 + double_field: 1.0 + string_field: foo + - index: + _index: test_1 + _id: 2 + - int_field: 51 + double_field: 51.0 + string_field: foo + - index: + _index: test_1 + _id: 3 + - int_field: 101 + double_field: 101.0 + string_field: foo + - index: + _index: test_1 + _id: 4 + - int_field: 151 + double_field: 151.0 + string_field: foo + +--- +"Basic test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + hdr: {} + percentiles_double: + percentiles: + field: double_field + hdr: {} + + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + + - match: { aggregations.percentiles_int.values.1\.0: 1.0 } + - match: { aggregations.percentiles_int.values.5\.0: 1.0 } + - match: { aggregations.percentiles_int.values.25\.0: 1.0 } + - match: { aggregations.percentiles_int.values.50\.0: 51.0302734375 } + - match: { aggregations.percentiles_int.values.75\.0: 101.0615234375 } + - match: { aggregations.percentiles_int.values.95\.0: 151.1240234375 } + - match: { aggregations.percentiles_int.values.99\.0: 151.1240234375 } + + - match: { aggregations.percentiles_double.values.1\.0: 1.0 } + - match: { aggregations.percentiles_double.values.5\.0: 1.0 } + - match: { aggregations.percentiles_double.values.25\.0: 1.0 } + - match: { aggregations.percentiles_double.values.50\.0: 51.0302734375 } + - match: { aggregations.percentiles_double.values.75\.0: 101.0615234375 } + - match: { aggregations.percentiles_double.values.95\.0: 151.1240234375 } + - match: { aggregations.percentiles_double.values.99\.0: 151.1240234375 } + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + hdr: + number_of_significant_value_digits: 3 + percentiles_double: + percentiles: + field: double_field + hdr: + number_of_significant_value_digits: 3 + + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + + - match: { aggregations.percentiles_int.values.1\.0: 1.0 } + - match: { aggregations.percentiles_int.values.5\.0: 1.0 } + - match: { aggregations.percentiles_int.values.25\.0: 1.0 } + - match: { aggregations.percentiles_int.values.50\.0: 51.0302734375 } + - match: { aggregations.percentiles_int.values.75\.0: 101.0615234375 } + - match: { aggregations.percentiles_int.values.95\.0: 151.1240234375 } + - match: { aggregations.percentiles_int.values.99\.0: 151.1240234375 } + + - match: { aggregations.percentiles_double.values.1\.0: 1.0 } + - match: { aggregations.percentiles_double.values.5\.0: 1.0 } + - match: { aggregations.percentiles_double.values.25\.0: 1.0 } + - match: { aggregations.percentiles_double.values.50\.0: 51.0302734375 } + - match: { aggregations.percentiles_double.values.75\.0: 101.0615234375 } + - match: { aggregations.percentiles_double.values.95\.0: 151.1240234375 } + - match: { aggregations.percentiles_double.values.99\.0: 151.1240234375 } + + +--- +"Only aggs test": + + - do: + search: + rest_total_hits_as_int: true + body: + size: 0 + aggs: + percentiles_int: + percentiles: + field: int_field + hdr: {} + percentiles_double: + percentiles: + field: double_field + hdr: {} + + - match: { hits.total: 4 } + - length: { hits.hits: 0 } + + - match: { aggregations.percentiles_int.values.1\.0: 1.0 } + - match: { aggregations.percentiles_int.values.5\.0: 1.0 } + - match: { aggregations.percentiles_int.values.25\.0: 1.0 } + - match: { aggregations.percentiles_int.values.50\.0: 51.0302734375 } + - match: { aggregations.percentiles_int.values.75\.0: 101.0615234375 } + - match: { aggregations.percentiles_int.values.95\.0: 151.1240234375 } + - match: { aggregations.percentiles_int.values.99\.0: 151.1240234375 } + + - match: { aggregations.percentiles_double.values.1\.0: 1.0 } + - match: { aggregations.percentiles_double.values.5\.0: 1.0 } + - match: { aggregations.percentiles_double.values.25\.0: 1.0 } + - match: { aggregations.percentiles_double.values.50\.0: 51.0302734375 } + - match: { aggregations.percentiles_double.values.75\.0: 101.0615234375 } + - match: { aggregations.percentiles_double.values.95\.0: 151.1240234375 } + - match: { aggregations.percentiles_double.values.99\.0: 151.1240234375 } + + +--- +"Filtered test": + + - do: + search: + rest_total_hits_as_int: true + body: + query: + constant_score: + filter: + range: + int_field: + gte: 50 + aggs: + percentiles_int: + percentiles: + field: int_field + hdr: {} + percentiles_double: + percentiles: + field: double_field + hdr: {} + + - match: { hits.total: 3 } + - length: { hits.hits: 3 } + + - match: { aggregations.percentiles_int.values.1\.0: 51.0 } + - match: { aggregations.percentiles_int.values.5\.0: 51.0 } + - match: { aggregations.percentiles_int.values.25\.0: 51.0 } + - match: { aggregations.percentiles_int.values.50\.0: 101.03125 } + - match: { aggregations.percentiles_int.values.75\.0: 101.03125 } + - match: { aggregations.percentiles_int.values.95\.0: 151.09375 } + - match: { aggregations.percentiles_int.values.99\.0: 151.09375 } + + - match: { aggregations.percentiles_double.values.1\.0: 51.0 } + - match: { aggregations.percentiles_double.values.5\.0: 51.0 } + - match: { aggregations.percentiles_double.values.25\.0: 51.0 } + - match: { aggregations.percentiles_double.values.50\.0: 101.03125 } + - match: { aggregations.percentiles_double.values.75\.0: 101.03125 } + - match: { aggregations.percentiles_double.values.95\.0: 151.09375 } + - match: { aggregations.percentiles_double.values.99\.0: 151.09375 } + + +--- +"Missing field with missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_missing: + percentiles: + field: missing_field + missing: 1.0 + hdr: {} + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + + - match: { aggregations.percentiles_missing.values.1\.0: 1.0 } + - match: { aggregations.percentiles_missing.values.5\.0: 1.0 } + - match: { aggregations.percentiles_missing.values.25\.0: 1.0 } + - match: { aggregations.percentiles_missing.values.50\.0: 1.0 } + - match: { aggregations.percentiles_missing.values.75\.0: 1.0 } + - match: { aggregations.percentiles_missing.values.95\.0: 1.0 } + - match: { aggregations.percentiles_missing.values.99\.0: 1.0 } + +--- +"Missing field without missing param": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_missing: + percentiles: + field: missing_field + hdr: {} + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - is_false: aggregations.percentiles_missing.value + +--- +"Metadata test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + meta: + foo: bar + percentiles: + field: int_field + hdr: {} + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.percentiles_int.meta.foo: "bar" } + + - match: { aggregations.percentiles_int.values.1\.0: 1.0 } + - match: { aggregations.percentiles_int.values.5\.0: 1.0 } + - match: { aggregations.percentiles_int.values.25\.0: 1.0 } + - match: { aggregations.percentiles_int.values.50\.0: 51.0302734375 } + - match: { aggregations.percentiles_int.values.75\.0: 101.0615234375 } + - match: { aggregations.percentiles_int.values.95\.0: 151.1240234375 } + - match: { aggregations.percentiles_int.values.99\.0: 151.1240234375 } + +--- +"Invalid params test": + + - do: + catch: /\[numberOfSignificantValueDigits\] must be between 0 and 5/ + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + hdr: + number_of_significant_value_digits: -1 + + - do: + catch: /\[numberOfSignificantValueDigits\] must be between 0 and 5/ + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + hdr: + number_of_significant_value_digits: 10 + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + hdr: + number_of_significant_value_digits: null + + - do: + catch: /\[percents\] must not be empty/ + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + hdr: {} + percents: [] + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + hdr: {} + percents: null + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + hdr: {} + percents: ["foo"] + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_string: + percentiles: + field: string_field + hdr: {} + +--- +"Explicit Percents test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + percents: [5.0, 25.0, 50.0] + hdr: {} + percentiles_double: + percentiles: + field: double_field + percents: [5.0, 25.0, 50.0] + hdr: {} + + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + + - match: { aggregations.percentiles_int.values.5\.0: 1.0 } + - match: { aggregations.percentiles_int.values.25\.0: 1.0 } + - match: { aggregations.percentiles_int.values.50\.0: 51.0302734375 } + + + - match: { aggregations.percentiles_double.values.5\.0: 1.0 } + - match: { aggregations.percentiles_double.values.25\.0: 1.0 } + - match: { aggregations.percentiles_double.values.50\.0: 51.0302734375 } + + +--- +"Non-keyed test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + percents: [5.0, 25.0, 50.0] + keyed: false + hdr: {} + + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + + + - match: { aggregations.percentiles_int.values.0.key: 5.0 } + - match: { aggregations.percentiles_int.values.0.value: 1.0 } + - match: { aggregations.percentiles_int.values.1.key: 25.0 } + - match: { aggregations.percentiles_int.values.1.value: 1.0 } + - match: { aggregations.percentiles_int.values.2.key: 50.0 } + - match: { aggregations.percentiles_int.values.2.value: 51.0302734375 } + + +--- +"Negative values test": + + - do: + index: + index: test_1 + id: 5 + refresh: true + body: { int_field: -10 } + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + percentiles_int: + percentiles: + field: int_field + hdr: {} + + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + + - match: { aggregations.percentiles_int.values.1\.0: 1.0 } + - match: { aggregations.percentiles_int.values.5\.0: 1.0 } + - match: { aggregations.percentiles_int.values.25\.0: 1.0 } + - match: { aggregations.percentiles_int.values.50\.0: 51.0302734375 } + - match: { aggregations.percentiles_int.values.75\.0: 101.0615234375 } + - match: { aggregations.percentiles_int.values.95\.0: 151.1240234375 } + - match: { aggregations.percentiles_int.values.99\.0: 151.1240234375 } + - match: { _shards.failures.0.reason.type: array_index_out_of_bounds_exception } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/200_top_hits_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/200_top_hits_metric.yml new file mode 100644 index 0000000000000..11e3d5906d7e9 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/200_top_hits_metric.yml @@ -0,0 +1,111 @@ +setup: + - do: + indices.create: + index: my-index + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: + properties: + users: + type: nested + + - do: + index: + index: my-index + id: 1 + refresh: true + body: | + { + "group" : "fans", + "users" : [ + { + "first" : "John", + "last" : "Smith" + }, + { + "first" : "Alice", + "last" : "White" + } + ] + } + + - do: + index: + index: my-index + id: 2 + refresh: true + body: | + { + "group" : "fans", + "users" : [ + { + "first" : "Mark", + "last" : "Doe" + } + ] + } + +--- +"top_hits aggregation with nested documents": + - skip: + version: " - 6.1.99" + reason: "<= 6.1 nodes don't always include index or id in nested top hits" + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + to-users: + nested: + path: users + aggs: + users: + top_hits: + sort: "users.last.keyword" + + - match: { hits.total: 2 } + - length: { aggregations.to-users.users.hits.hits: 3 } + - match: { aggregations.to-users.users.hits.hits.0._id: "2" } + - match: { aggregations.to-users.users.hits.hits.0._index: my-index } + - match: { aggregations.to-users.users.hits.hits.0._nested.field: users } + - match: { aggregations.to-users.users.hits.hits.0._nested.offset: 0 } + - match: { aggregations.to-users.users.hits.hits.1._id: "1" } + - match: { aggregations.to-users.users.hits.hits.1._index: my-index } + - match: { aggregations.to-users.users.hits.hits.1._nested.field: users } + - match: { aggregations.to-users.users.hits.hits.1._nested.offset: 0 } + - match: { aggregations.to-users.users.hits.hits.2._id: "1" } + - match: { aggregations.to-users.users.hits.hits.2._index: my-index } + - match: { aggregations.to-users.users.hits.hits.2._nested.field: users } + - match: { aggregations.to-users.users.hits.hits.2._nested.offset: 1 } + + +--- +"top_hits aggregation with sequence numbers": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + groups: + terms: + field: group.keyword + aggs: + users: + top_hits: + sort: "users.last.keyword" + seq_no_primary_term: true + + - match: { hits.total: 2 } + - length: { aggregations.groups.buckets.0.users.hits.hits: 2 } + - match: { aggregations.groups.buckets.0.users.hits.hits.0._id: "1" } + - match: { aggregations.groups.buckets.0.users.hits.hits.0._index: my-index } + - gte: { aggregations.groups.buckets.0.users.hits.hits.0._seq_no: 0 } + - gte: { aggregations.groups.buckets.0.users.hits.hits.0._primary_term: 1 } + - match: { aggregations.groups.buckets.0.users.hits.hits.1._id: "2" } + - match: { aggregations.groups.buckets.0.users.hits.hits.1._index: my-index } + - gte: { aggregations.groups.buckets.0.users.hits.hits.1._seq_no: 0 } + - gte: { aggregations.groups.buckets.0.users.hits.hits.1._primary_term: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/20_terms.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/20_terms.yml new file mode 100644 index 0000000000000..3d9f8a9c8af60 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/20_terms.yml @@ -0,0 +1,771 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + str: + type: keyword + ip: + type: ip + boolean: + type: boolean + integer: + type: long + double: + type: double + number: + type: long + date: + type: date + + - do: + indices.create: + index: test_2 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + number: + type: double + + - do: + cluster.health: + wait_for_status: green + +--- +"Basic test": + - do: + index: + index: test_1 + id: 1 + body: { "str" : "abc" } + + - do: + index: + index: test_1 + id: 2 + body: { "str": "abc" } + + - do: + index: + index: test_1 + id: 3 + body: { "str": "bcd" } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str" } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.str_terms.buckets: 2 } + + - match: { aggregations.str_terms.buckets.0.key: "abc" } + + - is_false: aggregations.str_terms.buckets.0.key_as_string + + - match: { aggregations.str_terms.buckets.0.doc_count: 2 } + + - match: { aggregations.str_terms.buckets.1.key: "bcd" } + + - is_false: aggregations.str_terms.buckets.1.key_as_string + + - match: { aggregations.str_terms.buckets.1.doc_count: 1 } + +--- +"IP test": + - do: + index: + index: test_1 + id: 1 + body: { "ip": "::1" } + + - do: + index: + index: test_1 + id: 2 + body: { "ip": "127.0.0.1" } + + - do: + index: + index: test_1 + id: 3 + body: { "ip": "::1" } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "ip_terms" : { "terms" : { "field" : "ip" } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.ip_terms.buckets: 2 } + + - match: { aggregations.ip_terms.buckets.0.key: "::1" } + + - is_false: aggregations.ip_terms.buckets.0.key_as_string + + - match: { aggregations.ip_terms.buckets.0.doc_count: 2 } + + - match: { aggregations.ip_terms.buckets.1.key: "127.0.0.1" } + + - is_false: aggregations.ip_terms.buckets.1.key_as_string + + - match: { aggregations.ip_terms.buckets.1.doc_count: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "ip_terms" : { "terms" : { "field" : "ip", "include" : [ "127.0.0.1" ] } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.ip_terms.buckets: 1 } + + - match: { aggregations.ip_terms.buckets.0.key: "127.0.0.1" } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "ip_terms" : { "terms" : { "field" : "ip", "exclude" : [ "127.0.0.1" ] } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.ip_terms.buckets: 1 } + + - match: { aggregations.ip_terms.buckets.0.key: "::1" } + + - do: + catch: request + search: + rest_total_hits_as_int: true + index: test_1 + body: { "size" : 0, "aggs" : { "ip_terms" : { "terms" : { "field" : "ip", "exclude" : "127.*" } } } } + + + +--- +"Boolean test": + - do: + index: + index: test_1 + id: 1 + body: { "boolean": true } + + - do: + index: + index: test_1 + id: 2 + body: { "boolean": false } + + - do: + index: + index: test_1 + id: 3 + body: { "boolean": true } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "boolean_terms" : { "terms" : { "field" : "boolean" } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.boolean_terms.buckets: 2 } + + - match: { aggregations.boolean_terms.buckets.0.key: 1 } + + - match: { aggregations.boolean_terms.buckets.0.key_as_string: "true" } + + - match: { aggregations.boolean_terms.buckets.0.doc_count: 2 } + + - match: { aggregations.boolean_terms.buckets.1.key: 0 } + + - match: { aggregations.boolean_terms.buckets.1.key_as_string: "false" } + + - match: { aggregations.boolean_terms.buckets.1.doc_count: 1 } + +--- +"Integer test": + - do: + index: + index: test_1 + id: 1 + body: { "integer": 1234 } + + - do: + index: + index: test_1 + id: 2 + body: { "integer": 5678 } + + - do: + index: + index: test_1 + id: 3 + body: { "integer": 1234 } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "integer_terms" : { "terms" : { "field" : "integer" } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.integer_terms.buckets: 2 } + + - match: { aggregations.integer_terms.buckets.0.key: 1234 } + + - is_false: aggregations.integer_terms.buckets.0.key_as_string + + - match: { aggregations.integer_terms.buckets.0.doc_count: 2 } + + - match: { aggregations.integer_terms.buckets.1.key: 5678 } + + - is_false: aggregations.integer_terms.buckets.1.key_as_string + + - match: { aggregations.integer_terms.buckets.1.doc_count: 1 } + +--- +"Double test": + - do: + index: + index: test_1 + id: 1 + body: { "double": 1234.5 } + + - do: + index: + index: test_1 + id: 2 + body: { "double": 5678.5 } + + - do: + index: + index: test_1 + id: 3 + body: { "double": 1234.5 } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "double_terms" : { "terms" : { "field" : "double" } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.double_terms.buckets: 2 } + + - match: { aggregations.double_terms.buckets.0.key: 1234.5 } + + - is_false: aggregations.double_terms.buckets.0.key_as_string + + - match: { aggregations.double_terms.buckets.0.doc_count: 2 } + + - match: { aggregations.double_terms.buckets.1.key: 5678.5 } + + - is_false: aggregations.double_terms.buckets.1.key_as_string + + - match: { aggregations.double_terms.buckets.1.doc_count: 1 } + +--- +"Date test": + - do: + index: + index: test_1 + id: 1 + body: { "date": "2016-05-03" } + + - do: + index: + index: test_1 + id: 2 + body: { "date": "2014-09-01" } + + - do: + index: + index: test_1 + id: 3 + body: { "date": "2016-05-03" } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "date_terms" : { "terms" : { "field" : "date" } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.date_terms.buckets: 2 } + + - match: { aggregations.date_terms.buckets.0.key: 1462233600000 } + + - match: { aggregations.date_terms.buckets.0.key_as_string: "2016-05-03T00:00:00.000Z" } + + - match: { aggregations.date_terms.buckets.0.doc_count: 2 } + + - match: { aggregations.date_terms.buckets.1.key: 1409529600000 } + + - match: { aggregations.date_terms.buckets.1.key_as_string: "2014-09-01T00:00:00.000Z" } + + - match: { aggregations.date_terms.buckets.1.doc_count: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "date_terms" : { "terms" : { "field" : "date", "include" : [ "2016-05-03" ] } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.date_terms.buckets: 1 } + + - match: { aggregations.date_terms.buckets.0.key_as_string: "2016-05-03T00:00:00.000Z" } + + - match: { aggregations.date_terms.buckets.0.doc_count: 2 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "date_terms" : { "terms" : { "field" : "date", "exclude" : [ "2016-05-03" ] } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.date_terms.buckets: 1 } + + - match: { aggregations.date_terms.buckets.0.key_as_string: "2014-09-01T00:00:00.000Z" } + + - match: { aggregations.date_terms.buckets.0.doc_count: 1 } + +--- +"Partitioned string test": + + - do: + index: + index: test_1 + id: 1 + body: { "str" : "abc" } + + - do: + index: + index: test_1 + id: 2 + body: { "str": "abc" } + + - do: + index: + index: test_1 + id: 3 + body: { "str": "bcd" } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str", "include" : {"partition": 0, "num_partitions": 2 } } } } } + + - match: { hits.total : 3 } + + - length: { aggregations.str_terms.buckets: 1 } + + - match: { aggregations.str_terms.buckets.0.key: "bcd" } + + - is_false: aggregations.str_terms.buckets.0.key_as_string + + - match: { aggregations.str_terms.buckets.0.doc_count: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str", "include" : {"partition": 1, "num_partitions": 2 } } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.str_terms.buckets: 1 } + + - match: { aggregations.str_terms.buckets.0.key: "abc" } + + - is_false: aggregations.str_terms.buckets.0.key_as_string + + - match: { aggregations.str_terms.buckets.0.doc_count: 2 } + +--- +"Partitioned integer test": + + - do: + index: + index: test_1 + id: 1 + body: { "integer": 1234 } + + - do: + index: + index: test_1 + id: 2 + body: { "integer": 5678 } + + - do: + index: + index: test_1 + id: 3 + body: { "integer": 1234 } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "integer", "include" : {"partition": 0, "num_partitions": 2 } } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.str_terms.buckets: 1 } + + - match: { aggregations.str_terms.buckets.0.key: 5678 } + + - match: { aggregations.str_terms.buckets.0.doc_count: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "integer", "include" : {"partition": 1, "num_partitions": 2 } } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.str_terms.buckets: 1 } + + - match: { aggregations.str_terms.buckets.0.key: 1234 } + + - match: { aggregations.str_terms.buckets.0.doc_count: 2 } + +--- +"Unmapped strings": + + - do: + index: + index: test_1 + id: 1 + body: {} + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "string_terms" : { "terms" : { "field" : "unmapped_string", "value_type" : "string", "missing": "abc" } } } } + + - match: { hits.total: 1 } + + - length: { aggregations.string_terms.buckets: 1 } + + - match: { aggregations.string_terms.buckets.0.key: "abc" } + + - match: { aggregations.string_terms.buckets.0.doc_count: 1 } + +--- +"Unmapped booleans": + + - do: + index: + index: test_1 + id: 1 + body: {} + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "boolean_terms" : { "terms" : { "field" : "unmapped_boolean", "value_type" : "boolean", "missing": true } } } } + + - match: { hits.total: 1 } + + - length: { aggregations.boolean_terms.buckets: 1 } + + - match: { aggregations.boolean_terms.buckets.0.key: 1 } + + - match: { aggregations.boolean_terms.buckets.0.key_as_string: "true" } + + - match: { aggregations.boolean_terms.buckets.0.doc_count: 1 } + +--- +"Unmapped dates": + + - do: + index: + index: test_1 + id: 1 + body: {} + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "date_terms" : { "terms" : { "field" : "unmapped_date", "value_type" : "date", "missing": "2016-05-11" } } } } + + - match: { hits.total: 1 } + + - length: { aggregations.date_terms.buckets: 1 } + + - match: { aggregations.date_terms.buckets.0.key: 1462924800000 } + + - match: { aggregations.date_terms.buckets.0.key_as_string: "2016-05-11T00:00:00.000Z" } + + - match: { aggregations.date_terms.buckets.0.doc_count: 1 } + +--- +"Unmapped longs": + + - do: + index: + index: test_1 + id: 1 + body: {} + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "long_terms" : { "terms" : { "field" : "unmapped_long", "value_type" : "long", "missing": 3 } } } } + + - match: { hits.total: 1 } + + - length: { aggregations.long_terms.buckets: 1 } + + - match: { aggregations.long_terms.buckets.0.key: 3 } + + - match: { aggregations.long_terms.buckets.0.doc_count: 1 } + +--- +"Unmapped doubles": + + - do: + index: + index: test_1 + id: 1 + body: {} + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "double_terms" : { "terms" : { "field" : "unmapped_double", "value_type" : "double", "missing": 3.5 } } } } + + - match: { hits.total: 1 } + + - length: { aggregations.double_terms.buckets: 1 } + + - match: { aggregations.double_terms.buckets.0.key: 3.5 } + + - match: { aggregations.double_terms.buckets.0.doc_count: 1 } + +--- +"Mixing longs and doubles": + + - do: + index: + index: test_1 + id: 1 + body: {"number": 100} + + - do: + index: + index: test_1 + id: 2 + body: {"number": 10} + + - do: + index: + index: test_2 + id: 3 + body: {"number": 100.0} + + - do: + index: + index: test_2 + id: 1 + body: {"number": 10.0} + + - do: + index: + index: test_2 + id: 2 + body: {"number": 14.6} + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "number_terms" : { "terms" : { "field" : "number" } } } } + + - match: { hits.total: 5 } + + - length: { aggregations.number_terms.buckets: 3 } + + - match: { aggregations.number_terms.buckets.0.key: 10.0 } + + - match: { aggregations.number_terms.buckets.0.doc_count: 2 } + + - match: { aggregations.number_terms.buckets.1.key: 100.0 } + + - match: { aggregations.number_terms.buckets.1.doc_count: 2 } + + - match: { aggregations.number_terms.buckets.2.key: 14.6 } + + - match: { aggregations.number_terms.buckets.2.doc_count: 1 } + +--- +"Deprecated _term order": + + - skip: + reason: _term order deprecated in 6.0, replaced by _key + features: "warnings" + + - do: + index: + index: test_1 + id: 1 + body: { "str": "abc" } + + - do: + index: + index: test_1 + id: 2 + body: { "str": "abc" } + + - do: + index: + index: test_1 + id: 3 + body: { "str": "bcd" } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str", "order" : { "_term" : "desc" } } } } } + warnings: + - "Deprecated aggregation order key [_term] used, replaced by [_key]" + + - match: { hits.total: 3 } + + - length: { aggregations.str_terms.buckets: 2 } + + - match: { aggregations.str_terms.buckets.0.key: "bcd" } + + - is_false: aggregations.str_terms.buckets.0.key_as_string + + - match: { aggregations.str_terms.buckets.0.doc_count: 1 } + + - match: { aggregations.str_terms.buckets.1.key: "abc" } + + - is_false: aggregations.str_terms.buckets.1.key_as_string + + - match: { aggregations.str_terms.buckets.1.doc_count: 2 } + +--- +"Global ordinals are not loaded with the map execution hint": + + - skip: + version: " - 6.99.99" + reason: bug fixed in 7.0 + + - do: + index: + refresh: true + index: test_1 + id: 1 + routing: 1 + body: { "str": "abc" } + + - do: + index: + refresh: true + index: test_1 + id: 2 + routing: 1 + body: { "str": "abc" } + + - do: + index: + refresh: true + index: test_1 + id: 3 + routing: 1 + body: { "str": "bcd" } + + - do: + indices.refresh: {} + + - do: + search: + index: test_1 + body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str", "execution_hint" : "map" } } } } + + - match: { hits.total.value: 3} + - length: { aggregations.str_terms.buckets: 2 } + + - do: + indices.stats: + index: test_1 + metric: fielddata + fielddata_fields: str + + - match: { indices.test_1.total.fielddata.memory_size_in_bytes: 0} + + - do: + search: + index: test_1 + body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str", "execution_hint" : "global_ordinals" } } } } + + - match: { hits.total.value: 3} + - length: { aggregations.str_terms.buckets: 2 } + + - do: + indices.stats: + index: test_1 + metric: fielddata + fielddata_fields: str + + - gt: { indices.test_1.total.fielddata.memory_size_in_bytes: 0} + + + + + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/220_filters_bucket.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/220_filters_bucket.yml new file mode 100644 index 0000000000000..e0183f0c54f66 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/220_filters_bucket.yml @@ -0,0 +1,274 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + int_field: + type : integer + double_field: + type : double + string_field: + type: keyword + + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 1 + - int_field: 1 + double_field: 1.0 + string_field: foo + - index: + _index: test_1 + _id: 2 + - int_field: 51 + double_field: 51.0 + string_field: foo + - index: + _index: test_1 + _id: 3 + - int_field: 101 + double_field: 101.0 + string_field: foo + - index: + _index: test_1 + _id: 4 + - int_field: 151 + double_field: 151.0 + string_field: foo + +--- +"Basic test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_filter: + filters: + filters: + first_filter: + match: + int_field: 101 + second_filter: + match: + int_field: 151 + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_filter.buckets.first_filter.doc_count: 1 } + - match: { aggregations.the_filter.buckets.second_filter.doc_count: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_filter: + filters: + filters: + first_filter: + match: + int_field: 101 + second_filter: + match: + int_field: 151 + aggs: + the_avg: + avg: + field: int_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_filter.buckets.first_filter.doc_count: 1 } + - match: { aggregations.the_filter.buckets.first_filter.the_avg.value: 101.0 } + - match: { aggregations.the_filter.buckets.second_filter.doc_count: 1 } + - match: { aggregations.the_filter.buckets.second_filter.the_avg.value: 151.0 } + +--- +"Anonymous filters test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_filter: + filters: + filters: + - match: + int_field: 101 + - match: + int_field: 151 + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_filter.buckets.0.doc_count: 1 } + - match: { aggregations.the_filter.buckets.1.doc_count: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_filter: + filters: + filters: + - match: + int_field: 101 + - match: + int_field: 151 + aggs: + the_avg: + avg: + field: int_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_filter.buckets.0.doc_count: 1 } + - match: { aggregations.the_filter.buckets.0.the_avg.value: 101.0 } + - match: { aggregations.the_filter.buckets.1.doc_count: 1 } + - match: { aggregations.the_filter.buckets.1.the_avg.value: 151.0 } + +--- +"Only aggs test": + + - do: + search: + rest_total_hits_as_int: true + body: + size: 0 + aggs: + the_filter: + filters: + filters: + first_filter: + match: + int_field: 101 + second_filter: + match: + int_field: 151 + + - match: { hits.total: 4 } + - length: { hits.hits: 0 } + - match: { aggregations.the_filter.buckets.first_filter.doc_count: 1 } + - match: { aggregations.the_filter.buckets.second_filter.doc_count: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_filter: + filters: + filters: + first_filter: + match: + int_field: 101 + second_filter: + match: + int_field: 151 + aggs: + the_avg: + avg: + field: int_field + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_filter.buckets.first_filter.doc_count: 1 } + - match: { aggregations.the_filter.buckets.first_filter.the_avg.value: 101.0 } + - match: { aggregations.the_filter.buckets.second_filter.doc_count: 1 } + - match: { aggregations.the_filter.buckets.second_filter.the_avg.value: 151.0 } + +--- +"Filtered test": + + - do: + search: + rest_total_hits_as_int: true + body: + query: + constant_score: + filter: + range: + int_field: + gte: 110 + aggs: + the_filter: + filters: + filters: + first_filter: + match: + int_field: 101 + second_filter: + match: + int_field: 151 + aggs: + the_avg: + avg: + field: int_field + + - match: { hits.total: 1 } + - length: { hits.hits: 1 } + - match: { aggregations.the_filter.buckets.first_filter.doc_count: 0 } + - is_false: aggregations.the_filter.buckets.first_filter.the_avg.value + - match: { aggregations.the_filter.buckets.second_filter.doc_count: 1 } + - match: { aggregations.the_filter.buckets.second_filter.the_avg.value: 151.0 } + + +--- +"Metadata test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_filter: + meta: + foo: bar + filters: + filters: + first_filter: + match: + int_field: 101 + second_filter: + match: + int_field: 151 + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_filter.buckets.first_filter.doc_count: 1 } + - match: { aggregations.the_filter.buckets.second_filter.doc_count: 1 } + - match: { aggregations.the_filter.meta.foo: "bar" } + +--- +"Bad params": + - skip: + version: " - 7.1.99" + reason: "empty bodies throws exception starting in 7.2" + - do: + catch: /\[filters\] cannot be empty/ + search: + rest_total_hits_as_int: true + body: + aggs: + the_filter: + filters: {} + + - do: + catch: /\[filters\] cannot be empty/ + search: + rest_total_hits_as_int: true + body: + aggs: + the_filter: + filters: + filters: [] diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/230_composite.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/230_composite.yml new file mode 100644 index 0000000000000..bfb067b8c2084 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/230_composite.yml @@ -0,0 +1,1032 @@ +--- +setup: + - do: + indices.create: + index: test + body: + mappings: + properties: + date: + type: date + keyword: + type: keyword + long: + type: long + geo_point: + type: geo_point + nested: + type: nested + properties: + nested_long: + type: long + + - do: + indices.create: + index: other + body: + mappings: + properties: + date: + type: date + long: + type: long + nested: + type: nested + properties: + nested_long: + type: long + + - do: + index: + index: test + id: 1 + body: { "keyword": "foo", "long": [10, 20], "geo_point": "37.2343,-115.8067", "nested": [{"nested_long": 10}, {"nested_long": 20}] } + + - do: + index: + index: test + id: 2 + body: { "keyword": ["foo", "bar"], "geo_point": "41.12,-71.34" } + + - do: + index: + index: test + id: 3 + body: { "keyword": "bar", "long": [100, 0], "geo_point": "90.0,0.0", "nested": [{"nested_long": 10}, {"nested_long": 0}] } + + - do: + index: + index: test + id: 4 + body: { "keyword": "bar", "long": [1000, 0], "geo_point": "41.12,-71.34", "nested": [{"nested_long": 1000}, {"nested_long": 20}] } + + - do: + index: + index: test + id: 5 + body: { "date": "2017-10-20T03:08:45" } + + - do: + index: + index: test + id: 6 + body: { "date": "2017-10-21T07:00:00" } + + - do: + index: + index: other + id: 0 + body: { "date": "2017-10-20T03:08:45" } + + - do: + indices.refresh: + index: [test, other] + +--- +"Simple Composite aggregation": + - skip: + version: " - 6.0.99" + reason: this uses a new API that has been added in 6.1 + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + composite: + sources: [ + "kw": { + "terms": { + "field": "keyword" + } + } + ] + + - match: {hits.total: 6} + - length: { aggregations.test.buckets: 2 } + - match: { aggregations.test.buckets.0.key.kw: "bar" } + - match: { aggregations.test.buckets.0.doc_count: 3 } + - match: { aggregations.test.buckets.1.key.kw: "foo" } + - match: { aggregations.test.buckets.1.doc_count: 2 } + +--- +"Nested Composite aggregation": + - skip: + version: " - 6.0.99" + reason: this uses a new API that has been added in 6.1 + + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + composite: + sources: [ + { + "long": { + "terms": { + "field": "long" + } + } + }, + { + "kw": { + "terms": { + "field": "keyword" + } + } + } + ] + + - match: {hits.total: 6} + - length: { aggregations.test.buckets: 5 } + - match: { aggregations.test.buckets.0.key.long: 0} + - match: { aggregations.test.buckets.0.key.kw: "bar" } + - match: { aggregations.test.buckets.0.doc_count: 2 } + - match: { aggregations.test.buckets.1.key.long: 10 } + - match: { aggregations.test.buckets.1.key.kw: "foo"} + - match: { aggregations.test.buckets.1.doc_count: 1 } + - match: { aggregations.test.buckets.2.key.long: 20 } + - match: { aggregations.test.buckets.2.key.kw: "foo" } + - match: { aggregations.test.buckets.2.doc_count: 1 } + - match: { aggregations.test.buckets.3.key.long: 100} + - match: { aggregations.test.buckets.3.key.kw: "bar" } + - match: { aggregations.test.buckets.3.doc_count: 1 } + - match: { aggregations.test.buckets.4.key.long: 1000 } + - match: { aggregations.test.buckets.4.key.kw: "bar" } + - match: { aggregations.test.buckets.4.doc_count: 1 } + +--- +"Aggregate After": + - skip: + version: " - 6.0.99" + reason: this uses a new API that has been added in 6.1 + + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + composite: + sources: [ + { + "long": { + "terms": { + "field": "long" + } + } + }, + { + "kw": { + "terms": { + "field": "keyword" + } + } + } + ] + after: { "long": 20, "kw": "foo" } + + - match: {hits.total: 6} + - length: { aggregations.test.buckets: 2 } + - match: { aggregations.test.buckets.0.key.long: 100 } + - match: { aggregations.test.buckets.0.key.kw: "bar" } + - match: { aggregations.test.buckets.0.doc_count: 1 } + - match: { aggregations.test.buckets.1.key.long: 1000 } + - match: { aggregations.test.buckets.1.key.kw: "bar" } + - match: { aggregations.test.buckets.1.doc_count: 1 } + +--- +"Aggregate After Missing": + - skip: + version: " - 6.1.99" + reason: bug fixed in 6.2.0 + + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + composite: + sources: [ + { + "kw": { + "terms": { + "field": "keyword" + } + } + } + ] + after: { "kw": "delta" } + + - match: {hits.total: 6} + - length: { aggregations.test.buckets: 1 } + - match: { aggregations.test.buckets.0.key.kw: "foo" } + - match: { aggregations.test.buckets.0.doc_count: 2 } + +--- +"Invalid Composite aggregation": + - skip: + version: " - 6.0.99" + reason: this uses a new API that has been added in 6.1 + + - do: + catch: /\[composite\] aggregation cannot be used with a parent aggregation/ + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + terms: + field: long + aggs: + nested: + composite: + sources: [ + { + "kw": { + "terms": { + "field": "keyword" + } + } + } + ] + +--- +"Composite aggregation with format": + - skip: + version: " - 7.1.99" + reason: calendar_interval introduced in 7.2.0 + features: warnings + + - do: + warnings: + - '[interval] on [date_histogram] is deprecated, use [fixed_interval] or [calendar_interval] in the future.' + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + composite: + sources: [ + { + "date": { + "date_histogram": { + "field": "date", + "interval": "1d", + "format": "strict_date" + } + } + } + ] + + - match: {hits.total: 6} + - length: { aggregations.test.buckets: 2 } + - match: { aggregations.test.buckets.0.key.date: "2017-10-20" } + - match: { aggregations.test.buckets.0.doc_count: 1 } + - match: { aggregations.test.buckets.1.key.date: "2017-10-21" } + - match: { aggregations.test.buckets.1.doc_count: 1 } + + - do: + warnings: + - '[interval] on [date_histogram] is deprecated, use [fixed_interval] or [calendar_interval] in the future.' + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + composite: + after: { + date: "2017-10-20" + } + sources: [ + { + "date": { + "date_histogram": { + "field": "date", + "interval": "1d", + "format": "strict_date" + } + } + } + ] + + - match: {hits.total: 6} + - length: { aggregations.test.buckets: 1 } + - match: { aggregations.test.buckets.0.key.date: "2017-10-21" } + - match: { aggregations.test.buckets.0.doc_count: 1 } + +--- +"Composite aggregation with format and calendar_interval": + - skip: + version: " - 7.1.99" + reason: calendar_interval introduced in 7.2.0 + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + composite: + sources: [ + { + "date": { + "date_histogram": { + "field": "date", + "calendar_interval": "1d", + "format": "strict_date" + } + } + } + ] + + - match: {hits.total: 6} + - length: { aggregations.test.buckets: 2 } + - match: { aggregations.test.buckets.0.key.date: "2017-10-20" } + - match: { aggregations.test.buckets.0.doc_count: 1 } + - match: { aggregations.test.buckets.1.key.date: "2017-10-21" } + - match: { aggregations.test.buckets.1.doc_count: 1 } + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + composite: + after: { + date: "2017-10-20" + } + sources: [ + { + "date": { + "date_histogram": { + "field": "date", + "calendar_interval": "1d", + "format": "strict_date" + } + } + } + ] + + - match: {hits.total: 6} + - length: { aggregations.test.buckets: 1 } + - match: { aggregations.test.buckets.0.key.date: "2017-10-21" } + - match: { aggregations.test.buckets.0.doc_count: 1 } + +--- +"Composite aggregation with date_histogram offset": + - skip: + version: " - 7.5.99" + reason: offset introduced in 7.6.0 + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + composite: + sources: [ + { + "date": { + "date_histogram": { + "field": "date", + "calendar_interval": "1d", + "offset": "4h", + "format": "iso8601" # Format makes the comparisons a little more obvious + } + } + } + ] + + - match: {hits.total: 6} + - length: { aggregations.test.buckets: 2 } + - match: { aggregations.test.buckets.0.key.date: "2017-10-19T04:00:00.000Z" } + - match: { aggregations.test.buckets.0.doc_count: 1 } + - match: { aggregations.test.buckets.1.key.date: "2017-10-21T04:00:00.000Z" } + - match: { aggregations.test.buckets.1.doc_count: 1 } + +--- +"Composite aggregation with after_key in the response": + - skip: + version: " - 6.2.99" + reason: starting in 6.3.0 after_key is returned in the response + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + composite: + sources: [ + { + "keyword": { + "terms": { + "field": "keyword", + } + } + } + ] + + - match: {hits.total: 6} + - length: { aggregations.test.buckets: 2 } + - length: { aggregations.test.after_key: 1 } + - match: { aggregations.test.after_key.keyword: "foo" } + +--- +"Composite aggregation and array size": + - skip: + version: " - 6.99.99" + reason: starting in 7.0 the composite aggregation throws an execption if the provided size is greater than search.max_buckets. + + - do: + catch: /.*Trying to create too many buckets.*/ + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + composite: + size: 1000000000 + sources: [ + { + "keyword": { + "terms": { + "field": "keyword", + } + } + } + ] + +--- +"Composite aggregation with nested parent": + - skip: + version: " - 6.99.99" + reason: the ability to set a nested parent aggregation was added in 7.0. + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + 1: + nested: + path: nested + aggs: + 2: + composite: + sources: [ + "nested": { + "terms": { + "field": "nested.nested_long" + } + } + ] + + - match: {hits.total: 6} + - length: { aggregations.1.2.buckets: 4 } + - match: { aggregations.1.2.buckets.0.key.nested: 0 } + - match: { aggregations.1.2.buckets.0.doc_count: 1 } + - match: { aggregations.1.2.buckets.1.key.nested: 10 } + - match: { aggregations.1.2.buckets.1.doc_count: 2 } + - match: { aggregations.1.2.buckets.2.key.nested: 20 } + - match: { aggregations.1.2.buckets.2.doc_count: 2 } + - match: { aggregations.1.2.buckets.3.key.nested: 1000 } + - match: { aggregations.1.2.buckets.3.doc_count: 1 } + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + 1: + nested: + path: nested + aggs: + 2: + composite: + after: { "nested": 10 } + sources: [ + "nested": { + "terms": { + "field": "nested.nested_long" + } + } + ] + + - match: {hits.total: 6} + - length: { aggregations.1.2.buckets: 2 } + - match: { aggregations.1.2.buckets.0.key.nested: 20 } + - match: { aggregations.1.2.buckets.0.doc_count: 2 } + - match: { aggregations.1.2.buckets.1.key.nested: 1000 } + - match: { aggregations.1.2.buckets.1.doc_count: 1 } + +--- +"Composite aggregation with unmapped field": + - skip: + version: " - 7.1.99" + reason: starting in 7.2 the composite aggregation handles unmapped fields as keywords + + - do: + search: + rest_total_hits_as_int: true + index: [test, other] + body: + aggregations: + test: + composite: + sources: [ + { + "long": { + "terms": { + "field": "long" + } + } + }, + { + "kw": { + "terms": { + "field": "keyword" + } + } + } + ] + + - match: {hits.total: 7} + - length: { aggregations.test.buckets: 5 } + - match: { aggregations.test.buckets.0.key.long: 0} + - match: { aggregations.test.buckets.0.key.kw: "bar" } + - match: { aggregations.test.buckets.0.doc_count: 2 } + - match: { aggregations.test.buckets.1.key.long: 10 } + - match: { aggregations.test.buckets.1.key.kw: "foo"} + - match: { aggregations.test.buckets.1.doc_count: 1 } + - match: { aggregations.test.buckets.2.key.long: 20 } + - match: { aggregations.test.buckets.2.key.kw: "foo" } + - match: { aggregations.test.buckets.2.doc_count: 1 } + - match: { aggregations.test.buckets.3.key.long: 100} + - match: { aggregations.test.buckets.3.key.kw: "bar" } + - match: { aggregations.test.buckets.3.doc_count: 1 } + - match: { aggregations.test.buckets.4.key.long: 1000 } + - match: { aggregations.test.buckets.4.key.kw: "bar" } + - match: { aggregations.test.buckets.4.doc_count: 1 } + + - do: + search: + rest_total_hits_as_int: true + index: [test, other] + body: + aggregations: + test: + composite: + after: { "long": 100, "kw": "bar" } + sources: [ + { + "long": { + "terms": { + "field": "long" + } + } + }, + { + "kw": { + "terms": { + "field": "keyword" + } + } + } + ] + + - match: {hits.total: 7} + - length: { aggregations.test.buckets: 1 } + - match: { aggregations.test.buckets.0.key.long: 1000 } + - match: { aggregations.test.buckets.0.key.kw: "bar" } + - match: { aggregations.test.buckets.0.doc_count: 1 } + +--- +"Missing source": + - skip: + version: " - 7.1.99" + reason: null/empty sources disallowed in 7.2 + + - do: + catch: /Composite \[sources\] cannot be null or empty/ + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + composite: + sources: [] + + - do: + catch: /Required \[sources\]/ + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + composite: + size: 1 + + +--- +"Duplicate sources": + - skip: + version: " - 7.1.99" + reason: duplicate names disallowed in 7.2 + + - do: + catch: /Composite source names must be unique, found duplicates[:] \[keyword\]/ + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + composite: + sources: [ + { + "keyword": { + "terms": { + "field": "keyword", + } + } + }, + { + "keyword": { + "terms": { + "field": "keyword", + } + } + } + ] + +--- +"Simple Composite aggregation with GeoTile grid": + - skip: + version: " - 7.4.99" + reason: geotile_grid is not supported until 7.5.0 + - do: + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + composite: + sources: [ + "geo": { + "geotile_grid": { + "field": "geo_point", + "precision": 12 + } + }, + { + "kw": { + "terms": { + "field": "keyword" + } + } + } + ] + + - match: {hits.total: 6} + - length: { aggregations.test.buckets: 4 } + - match: { aggregations.test.buckets.0.key.geo: "12/730/1590" } + - match: { aggregations.test.buckets.0.key.kw: "foo" } + - match: { aggregations.test.buckets.0.doc_count: 1 } + - match: { aggregations.test.buckets.1.key.geo: "12/1236/1533" } + - match: { aggregations.test.buckets.1.key.kw: "bar" } + - match: { aggregations.test.buckets.1.doc_count: 2 } + - match: { aggregations.test.buckets.2.key.geo: "12/1236/1533" } + - match: { aggregations.test.buckets.2.key.kw: "foo" } + - match: { aggregations.test.buckets.2.doc_count: 1 } + - match: { aggregations.test.buckets.3.key.geo: "12/2048/0" } + - match: { aggregations.test.buckets.3.key.kw: "bar" } + - match: { aggregations.test.buckets.3.doc_count: 1 } + +--- +"Simple Composite aggregation with geotile grid add aggregate after": + - skip: + version: " - 7.4.99" + reason: geotile_grid is not supported until 7.5.0 + - do: + search: + index: test + body: + aggregations: + test: + composite: + sources: [ + "geo": { + "geotile_grid": { + "field": "geo_point", + "precision": 12 + } + }, + { + "kw": { + "terms": { + "field": "keyword" + } + } + } + ] + after: { "geo": "12/730/1590", "kw": "foo" } + + - match: { hits.total.value: 6 } + - match: { hits.total.relation: "eq" } + - length: { aggregations.test.buckets: 3 } + - match: { aggregations.test.buckets.0.key.geo: "12/1236/1533" } + - match: { aggregations.test.buckets.0.key.kw: "bar" } + - match: { aggregations.test.buckets.0.doc_count: 2 } + - match: { aggregations.test.buckets.1.key.geo: "12/1236/1533" } + - match: { aggregations.test.buckets.1.key.kw: "foo" } + - match: { aggregations.test.buckets.1.doc_count: 1 } + - match: { aggregations.test.buckets.2.key.geo: "12/2048/0" } + - match: { aggregations.test.buckets.2.key.kw: "bar" } + - match: { aggregations.test.buckets.2.doc_count: 1 } + +--- +"Mixed ip and unmapped fields": + - skip: + version: " - 7.5.99" + reason: This will fail against 7.x until the fix is backported there + # It is important that the index *without* the ip field be sorted *before* + # the index *with* the ip field because that has caused bugs in the past. + - do: + indices.create: + index: test_1 + - do: + indices.create: + index: test_2 + body: + mappings: + properties: + f: + type: ip + - do: + index: + index: test_2 + id: 1 + body: { "f": "192.168.0.1" } + refresh: true + + - do: + search: + index: test_* + body: + aggregations: + test: + composite: + sources: [ + "f": { + "terms": { + "field": "f" + } + } + ] + + - match: { hits.total.value: 1 } + - match: { hits.total.relation: eq } + - length: { aggregations.test.buckets: 1 } + - match: { aggregations.test.buckets.0.key.f: "192.168.0.1" } + - match: { aggregations.test.buckets.0.doc_count: 1 } + +--- +"date_histogram with time_zone": + - skip: + version: " - 7.6.0" + reason: Fixed in 7.6.0 + - do: + index: + index: test + id: 7 + body: { "date": "2017-10-22T01:00:00" } + refresh: true + - do: + search: + index: test + body: + aggregations: + test: + composite: + sources: [ + { + "date": { + "date_histogram": { + "field": "date", + "calendar_interval": "1d", + "time_zone": "-02:00", + "format": "iso8601" # Format makes the comparisons a little more obvious + } + } + } + ] + + - match: { hits.total.value: 7 } + - match: { hits.total.relation: eq } + - length: { aggregations.test.buckets: 2 } + - match: { aggregations.test.buckets.0.key.date: "2017-10-20T00:00:00.000-02:00" } + - match: { aggregations.test.buckets.0.doc_count: 1 } + - match: { aggregations.test.buckets.1.key.date: "2017-10-21T00:00:00.000-02:00" } + - match: { aggregations.test.buckets.1.doc_count: 2 } + + - do: + search: + index: test + body: + aggregations: + test: + composite: + after: { + date: "2017-10-20" + } + sources: [ + { + "date": { + "date_histogram": { + "field": "date", + "calendar_interval": "1d", + "time_zone": "-02:00", + "format": "iso8601" # Format makes the comparisons a little more obvious + } + } + } + ] + + - match: { hits.total.value: 7 } + - match: { hits.total.relation: eq } + - length: { aggregations.test.buckets: 1 } + - match: { aggregations.test.buckets.0.key.date: "2017-10-21T00:00:00.000-02:00" } + - match: { aggregations.test.buckets.0.doc_count: 2 } + +--- +"date_histogram on date_nanos": + - skip: + version: " - 7.6.99" + reason: Fixed in 7.7.0 + - do: + indices.create: + index: test_nanos + body: + mappings: + properties: + date_nanos: + type: date_nanos + + - do: + index: + index: test_nanos + id: 7 + body: { "date_nanos": "2017-11-21T01:00:00" } + refresh: true + - do: + index: + index: test_nanos + id: 8 + body: { "date_nanos": "2017-11-22T01:00:00" } + refresh: true + - do: + index: + index: test_nanos + id: 9 + body: { "date_nanos": "2017-11-22T02:00:00" } + refresh: true + - do: + search: + index: test_nanos + body: + aggregations: + test: + composite: + sources: + - date: + date_histogram: + field: date_nanos + calendar_interval: 1d + format: iso8601 # Format makes the comparisons a little more obvious + aggregations: + avg: + avg: + field: date_nanos + + - match: { hits.total.value: 3 } + - match: { hits.total.relation: eq } + - length: { aggregations.test.buckets: 2 } + - match: { aggregations.test.buckets.0.key.date: "2017-11-21T00:00:00.000Z" } + - match: { aggregations.test.buckets.0.doc_count: 1 } + - match: { aggregations.test.buckets.0.avg.value_as_string: "2017-11-21T01:00:00.000Z" } + - match: { aggregations.test.buckets.1.key.date: "2017-11-22T00:00:00.000Z" } + - match: { aggregations.test.buckets.1.doc_count: 2 } + - match: { aggregations.test.buckets.1.avg.value_as_string: "2017-11-22T01:30:00.000Z" } + +--- +"Terms source from sorted": + - do: + indices.create: + index: sorted_test + body: + settings: + sort.field: keyword + mappings: + properties: + keyword: + type: keyword + long: + type: long + + + - do: + index: + index: sorted_test + id: 2 + refresh: true + body: { "keyword": "foo", "long": 1 } + + - do: + search: + index: sorted_test + rest_total_hits_as_int: true + body: + aggregations: + test: + composite: + sources: + - keyword: + terms: + field: keyword + + - match: {hits.total: 1} + - length: { aggregations.test.buckets: 1 } + - match: { aggregations.test.buckets.0.key.keyword: "foo" } + - match: { aggregations.test.buckets.0.doc_count: 1 } + +--- +"Terms source from part of sorted": + - skip: + version: " - 7.6.99" + reason: fixed in 7.7.0 + + - do: + indices.create: + index: sorted_test + body: + settings: + sort.field: [keyword, long] + mappings: + properties: + keyword: + type: keyword + long: + type: long + + + - do: + index: + index: sorted_test + id: 2 + refresh: true + body: { "keyword": "foo", "long": 1 } + + - do: + search: + index: sorted_test + body: + aggregations: + test: + composite: + sources: + - keyword: + terms: + field: keyword + + - match: {hits.total.value: 1} + - length: { aggregations.test.buckets: 1 } + - match: { aggregations.test.buckets.0.key.keyword: "foo" } + - match: { aggregations.test.buckets.0.doc_count: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml new file mode 100644 index 0000000000000..1b23eea01b75b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml @@ -0,0 +1,121 @@ +--- +setup: + - do: + indices.create: + index: test + body: + mappings: + properties: + keyword: + type: keyword + date: + type: date + + - do: + index: + index: test + id: 1 + body: { "date": "2014-03-03T00:00:00", "keyword": "dgx" } + + - do: + index: + index: test + id: 2 + body: { "date": "2015-03-03T00:00:00", "keyword": "dfs" } + + - do: + index: + index: test + id: 3 + body: { "date": "2016-03-03T00:00:00", "keyword": "foobar" } + + - do: + index: + index: test + id: 4 + body: { "date": "2017-03-03T00:00:00", "keyword": "foo" } + + - do: + index: + index: test + id: 5 + body: { "date": "2018-03-03T00:00:00", "keyword": "bar" } + + - do: + index: + index: test + id: 6 + body: { "date": "2019-03-03T00:00:00", "keyword": "baz" } + + - do: + index: + index: test + id: 7 + body: { "date": "2020-03-03T00:00:00", "keyword": "qux" } + + - do: + index: + index: test + id: 8 + body: { "date": "2021-03-03T00:00:00", "keyword": "quux" } + + + - do: + indices.refresh: + index: [test] + +--- + teardown: + + - do: + cluster.put_settings: + body: + transient: + search.max_buckets: null + +--- +"Max bucket": + - skip: + version: " - 6.99.99" + reason: search.max_buckets limit has been added in 7.0 + + - do: + cluster.put_settings: + body: + transient: + search.max_buckets: 3 + + - do: + catch: /.*Trying to create too many buckets.*/ + search: + rest_total_hits_as_int: true + allow_partial_search_results: false + index: test + body: + aggregations: + test: + terms: + field: keyword + + - do: + cluster.put_settings: + body: + transient: + search.max_buckets: 6 + + - do: + catch: /.*Trying to create too many buckets.*/ + search: + rest_total_hits_as_int: true + allow_partial_search_results: false + index: test + body: + aggregations: + test: + terms: + field: keyword + aggs: + 2: + terms: + field: date + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/250_moving_fn.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/250_moving_fn.yml new file mode 100644 index 0000000000000..14e626b94e79a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/250_moving_fn.yml @@ -0,0 +1,82 @@ +setup: + - skip: + version: " - 6.3.99" + reason: "moving_fn added in 6.4.0" + +--- +"Bad window": + + - skip: + version: " - 7.1.99" + reason: "calendar_interval added in 7.2" + + - do: + catch: /\[window\] must be a positive, non-zero integer\./ + search: + rest_total_hits_as_int: true + body: + size: 0 + aggs: + the_histo: + date_histogram: + field: "date" + calendar_interval: "1d" + aggs: + the_avg: + avg: + field: "value_field" + the_mov_fn: + moving_fn: + buckets_path: "the_avg" + window: -1 + script: "MovingFunctions.windowMax(values)" + +--- +"Bad window deprecated interval": + + - skip: + version: " - 7.1.99" + reason: "interval deprecation added in 7.2" + features: "warnings" + + - do: + catch: /\[window\] must be a positive, non-zero integer\./ + warnings: + - "[interval] on [date_histogram] is deprecated, use [fixed_interval] or [calendar_interval] in the future." + search: + rest_total_hits_as_int: true + body: + size: 0 + aggs: + the_histo: + date_histogram: + field: "date" + interval: "1d" + aggs: + the_avg: + avg: + field: "value_field" + the_mov_fn: + moving_fn: + buckets_path: "the_avg" + window: -1 + script: "MovingFunctions.windowMax(values)" +--- +"Not under date_histo": + + - do: + catch: /\[window\] must be a positive, non-zero integer\./ + search: + rest_total_hits_as_int: true + body: + size: 0 + aggs: + the_avg: + avg: + field: "value_field" + the_mov_fn: + moving_fn: + buckets_path: "the_avg" + window: -1 + script: "MovingFunctions.windowMax(values)" + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/260_weighted_avg.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/260_weighted_avg.yml new file mode 100644 index 0000000000000..c5988fc9e5dc4 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/260_weighted_avg.yml @@ -0,0 +1,69 @@ +setup: + - skip: + version: " - 6.3.99" + reason: weighted_avg is only available as of 6.4.0 + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + int_field: + type : integer + double_field: + type : double + string_field: + type: keyword + + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 1 + - int_field: 1 + double_field: 1.0 + - index: + _index: test_1 + _id: 2 + - int_field: 2 + double_field: 2.0 + - index: + _index: test_1 + _id: 3 + - int_field: 3 + double_field: 3.0 + - index: + _index: test_1 + _id: 4 + - int_field: 4 + double_field: 4.0 + +--- +"Basic test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + the_int_avg: + weighted_avg: + value: + field: "int_field" + weight: + field: "int_field" + the_double_avg: + weighted_avg: + value: + field: "double_field" + weight: + field: "double_field" + + - match: { hits.total: 4 } + - length: { hits.hits: 4 } + - match: { aggregations.the_int_avg.value: 3.0 } + - match: { aggregations.the_double_avg.value: 3.0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/270_median_absolute_deviation_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/270_median_absolute_deviation_metric.yml new file mode 100644 index 0000000000000..0cba08fccae9b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/270_median_absolute_deviation_metric.yml @@ -0,0 +1,145 @@ +setup: + - skip: + version: " - 6.5.99" + reason: "added in 6.6.0" + - do: + indices.create: + index: test + body: + settings: + number_of_replicas: 0 + mappings: + properties: + int_field: + type: integer + double_field: + type: double + incomplete_field: + type: integer + - do: + bulk: + refresh: true + body: + - index: + _index: test + - int_field: 100 + double_field: 100.0 + incomplete_field: 1000 + - index: + _index: test + - int_field: 200 + double_field: 200.0 + incomplete_field: 2000 + - index: + _index: test + - int_field: 300 + double_field: 300.0 + +--- +"basic test": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + mad_int: + median_absolute_deviation: + field: int_field + mad_double: + median_absolute_deviation: + field: double_field + + - match: { hits.total: 3 } + - length: { hits.hits: 3 } + + - match: { aggregations.mad_int.value: 100 } + - match: { aggregations.mad_double.value: 100 } + +--- +"with setting compression": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + mad_int: + median_absolute_deviation: + field: int_field + compression: 500 + mad_double: + median_absolute_deviation: + field: double_field + compression: 500 + + - match: { hits.total: 3 } + - length: { hits.hits: 3 } + + - match: { aggregations.mad_int.value: 100 } + - match: { aggregations.mad_double.value: 100 } + +--- +"no documents": + + - do: + search: + rest_total_hits_as_int: true + body: + query: + bool: + filter: + term: + non_existent_field: non_existent_value + aggs: + mad_no_docs: + median_absolute_deviation: + field: non_existent_field + + - match: { hits.total: 0 } + - length: { hits.hits: 0 } + + - match: { aggregations.mad_no_docs.value: null } + +--- +"missing value": + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + mad_missing: + median_absolute_deviation: + field: incomplete_field + missing: 3000 + + - match: { hits.total: 3 } + - length: { hits.hits: 3 } + + - match: { aggregations.mad_missing.value: 1000 } + +--- +"bad arguments": + + - do: + catch: /\[compression\] must be greater than 0. Found \[0.0\] in \[mad\]/ + search: + rest_total_hits_as_int: true + body: + aggs: + mad: + median_absolute_deviation: + field: int_field + compression: 0 + + - do: + catch: /\[compression\] must be greater than 0. Found \[-1.0\] in \[mad\]/ + search: + rest_total_hits_as_int: true + body: + aggs: + mad: + median_absolute_deviation: + field: int_field + compression: -1 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_geohash_grid.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_geohash_grid.yml new file mode 100644 index 0000000000000..534e552fc0ea2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_geohash_grid.yml @@ -0,0 +1,62 @@ +setup: + - do: + indices.create: + include_type_name: false + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + location: + type: geo_point + +--- +"Basic test": + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 1 + - location: "52.374081,4.912350" + - index: + _index: test_1 + _id: 2 + - location: "52.369219,4.901618" + - index: + _index: test_1 + _id: 3 + - location: "52.371667,4.914722" + - index: + _index: test_1 + _id: 4 + - location: "51.222900,4.405200" + - index: + _index: test_1 + _id: 5 + - location: "48.861111,2.336389" + - index: + _index: test_1 + _id: 6 + - location: "48.860000,2.327000" + + - do: + search: + rest_total_hits_as_int: true + body: + aggregations: + grid: + geohash_grid: + field: location + precision: 3 + + + - match: { hits.total: 6 } + - match: { aggregations.grid.buckets.0.key: u17 } + - match: { aggregations.grid.buckets.0.doc_count: 3 } + - match: { aggregations.grid.buckets.1.key: u09 } + - match: { aggregations.grid.buckets.1.doc_count: 2 } + - match: { aggregations.grid.buckets.2.key: u15 } + - match: { aggregations.grid.buckets.2.doc_count: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_rare_terms.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_rare_terms.yml new file mode 100644 index 0000000000000..6d1e2d606a4b2 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_rare_terms.yml @@ -0,0 +1,362 @@ +setup: + - skip: + version: " - 7.2.99" + reason: RareTerms added in 7.3.0 + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + str: + type: keyword + ip: + type: ip + boolean: + type: boolean + integer: + type: long + number: + type: long + date: + type: date + + + - do: + cluster.health: + wait_for_status: green + +--- +"Basic test": + - do: + index: + index: test_1 + id: 1 + body: { "str" : "abc" } + + - do: + index: + index: test_1 + id: 2 + body: { "str": "abc" } + + - do: + index: + index: test_1 + id: 3 + body: { "str": "bcd" } + + - do: + indices.refresh: {} + + - do: + search: + body: { "size" : 0, "aggs" : { "str_terms" : { "rare_terms" : { "field" : "str", "max_doc_count" : 1 } } } } + + - match: { hits.total.value: 3 } + - length: { aggregations.str_terms.buckets: 1 } + - match: { aggregations.str_terms.buckets.0.key: "bcd" } + - is_false: aggregations.str_terms.buckets.0.key_as_string + - match: { aggregations.str_terms.buckets.0.doc_count: 1 } + +--- +"IP test": + - do: + index: + index: test_1 + id: 1 + body: { "ip": "::1" } + + - do: + index: + index: test_1 + id: 2 + body: { "ip": "127.0.0.1" } + + - do: + index: + index: test_1 + id: 3 + body: { "ip": "::1" } + + - do: + indices.refresh: {} + + - do: + search: + body: { "size" : 0, "aggs" : { "ip_terms" : { "rare_terms" : { "field" : "ip" } } } } + + - match: { hits.total.value: 3 } + - length: { aggregations.ip_terms.buckets: 1 } + - match: { aggregations.ip_terms.buckets.0.key: "127.0.0.1" } + - is_false: aggregations.ip_terms.buckets.0.key_as_string + - match: { aggregations.ip_terms.buckets.0.doc_count: 1 } + + - do: + search: + body: { "size" : 0, "aggs" : { "ip_terms" : { "rare_terms" : { "field" : "ip", "include" : [ "127.0.0.1" ] } } } } + + - match: { hits.total.value: 3 } + - length: { aggregations.ip_terms.buckets: 1 } + - match: { aggregations.ip_terms.buckets.0.key: "127.0.0.1" } + - is_false: aggregations.ip_terms.buckets.0.key_as_string + - match: { aggregations.ip_terms.buckets.0.doc_count: 1 } + + - do: + search: + body: { "size" : 0, "aggs" : { "ip_terms" : { "rare_terms" : { "field" : "ip", "exclude" : [ "127.0.0.1" ] } } } } + + - match: { hits.total.value: 3 } + - length: { aggregations.ip_terms.buckets: 0 } + + - do: + catch: request + search: + index: test_1 + body: { "size" : 0, "aggs" : { "ip_terms" : { "rare_terms" : { "field" : "ip", "exclude" : "127.*" } } } } + + + +--- +"Boolean test": + - do: + index: + index: test_1 + id: 1 + body: { "boolean": true } + + - do: + index: + index: test_1 + id: 2 + body: { "boolean": false } + + - do: + index: + index: test_1 + id: 3 + body: { "boolean": true } + + - do: + indices.refresh: {} + + - do: + search: + body: { "size" : 0, "aggs" : { "boolean_terms" : { "rare_terms" : { "field" : "boolean" } } } } + + - match: { hits.total.value: 3 } + - length: { aggregations.boolean_terms.buckets: 1 } + - match: { aggregations.boolean_terms.buckets.0.key: 0 } + - match: { aggregations.boolean_terms.buckets.0.key_as_string: "false" } + - match: { aggregations.boolean_terms.buckets.0.doc_count: 1 } + +--- +"Integer test": + - do: + index: + index: test_1 + id: 1 + body: { "integer": 1234 } + + - do: + index: + index: test_1 + id: 2 + body: { "integer": 5678 } + + - do: + index: + index: test_1 + id: 3 + body: { "integer": 1234 } + + - do: + indices.refresh: {} + + - do: + search: + body: { "size" : 0, "aggs" : { "integer_terms" : { "rare_terms" : { "field" : "integer" } } } } + + - match: { hits.total.value: 3 } + + - length: { aggregations.integer_terms.buckets: 1 } + + - match: { aggregations.integer_terms.buckets.0.key: 5678 } + - is_false: aggregations.integer_terms.buckets.0.key_as_string + - match: { aggregations.integer_terms.buckets.0.doc_count: 1 } + +--- +"Date test": + - do: + index: + index: test_1 + id: 1 + body: { "date": "2016-05-03" } + + - do: + index: + index: test_1 + id: 2 + body: { "date": "2014-09-01" } + + - do: + index: + index: test_1 + id: 3 + body: { "date": "2016-05-03" } + + - do: + indices.refresh: {} + + - do: + search: + body: { "size" : 0, "aggs" : { "date_terms" : { "rare_terms" : { "field" : "date" } } } } + + - match: { hits.total.value: 3 } + + - length: { aggregations.date_terms.buckets: 1 } + - match: { aggregations.date_terms.buckets.0.key: 1409529600000 } + - match: { aggregations.date_terms.buckets.0.key_as_string: "2014-09-01T00:00:00.000Z" } + - match: { aggregations.date_terms.buckets.0.doc_count: 1 } + + - do: + search: + body: { "size" : 0, "aggs" : { "date_terms" : { "rare_terms" : { "field" : "date", "include" : [ "2014-09-01" ] } } } } + + - match: { hits.total.value: 3 } + - length: { aggregations.date_terms.buckets: 1 } + - match: { aggregations.date_terms.buckets.0.key_as_string: "2014-09-01T00:00:00.000Z" } + - match: { aggregations.date_terms.buckets.0.doc_count: 1 } + + - do: + search: + body: { "size" : 0, "aggs" : { "date_terms" : { "rare_terms" : { "field" : "date", "exclude" : [ "2014-09-01" ] } } } } + + - match: { hits.total.value: 3 } + - length: { aggregations.date_terms.buckets: 0 } + +--- +"Unmapped strings": + + - do: + index: + index: test_1 + id: 1 + body: {} + + - do: + indices.refresh: {} + + - do: + search: + body: { "size" : 0, "aggs" : { "string_terms" : { "rare_terms" : { "field" : "unmapped_string"} } } } + + - match: { hits.total.value: 1 } + - length: { aggregations.string_terms.buckets: 0 } + +--- +"Unmapped booleans": + + - do: + index: + index: test_1 + id: 1 + body: {} + + - do: + indices.refresh: {} + + - do: + search: + body: { "size" : 0, "aggs" : { "boolean_terms" : { "rare_terms" : { "field" : "unmapped_boolean" } } } } + + - match: { hits.total.value: 1 } + - length: { aggregations.boolean_terms.buckets: 0 } + +--- +"Unmapped dates": + + - do: + index: + index: test_1 + id: 1 + body: {} + + - do: + indices.refresh: {} + + - do: + search: + body: { "size" : 0, "aggs" : { "date_terms" : { "rare_terms" : { "field" : "unmapped_date"} } } } + + - match: { hits.total.value: 1 } + - length: { aggregations.date_terms.buckets: 0 } + +--- +"Unmapped longs": + + - do: + index: + index: test_1 + id: 1 + body: {} + + - do: + indices.refresh: {} + + - do: + search: + body: { "size" : 0, "aggs" : { "long_terms" : { "rare_terms" : { "field" : "unmapped_long", "value_type" : "long" } } } } + + - match: { hits.total.value: 1 } + - length: { aggregations.long_terms.buckets: 0 } + +--- +"sub aggs": + - skip: + version: " - 7.6.1" + reason: Sub aggs fixed in 7.6.1 + + - do: + index: + refresh: true + index: test_1 + id: 1 + body: { "str" : "abc", "number": 1 } + + - do: + index: + refresh: true + index: test_1 + id: 2 + body: { "str": "abc", "number": 2 } + + - do: + index: + refresh: true + index: test_1 + id: 3 + body: { "str": "bcd", "number": 3 } + + - do: + search: + body: + size: 0 + aggs: + str_terms: + rare_terms: + field: str + max_doc_count: 1 + aggs: + max_n: + max: + field: number + + - match: { hits.total.value: 3 } + - length: { aggregations.str_terms.buckets: 1 } + - match: { aggregations.str_terms.buckets.0.key: "bcd" } + - is_false: aggregations.str_terms.buckets.0.key_as_string + - match: { aggregations.str_terms.buckets.0.doc_count: 1 } + - match: { aggregations.str_terms.buckets.0.max_n.value: 3.0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/290_geotile_grid.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/290_geotile_grid.yml new file mode 100644 index 0000000000000..2db498a0cacf0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/290_geotile_grid.yml @@ -0,0 +1,65 @@ +setup: + - skip: + version: " - 6.99.99" + reason: "added in 7.0.0" + - do: + indices.create: + include_type_name: false + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + location: + type: geo_point + +--- +"Basic test": + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 1 + - location: "52.374081,4.912350" + - index: + _index: test_1 + _id: 2 + - location: "52.369219,4.901618" + - index: + _index: test_1 + _id: 3 + - location: "52.371667,4.914722" + - index: + _index: test_1 + _id: 4 + - location: "51.222900,4.405200" + - index: + _index: test_1 + _id: 5 + - location: "48.861111,2.336389" + - index: + _index: test_1 + _id: 6 + - location: "48.860000,2.327000" + + - do: + search: + rest_total_hits_as_int: true + body: + aggregations: + grid: + geotile_grid: + field: location + precision: 8 + + + - match: { hits.total: 6 } + - match: { aggregations.grid.buckets.0.key: "8/131/84" } + - match: { aggregations.grid.buckets.0.doc_count: 3 } + - match: { aggregations.grid.buckets.1.key: "8/129/88" } + - match: { aggregations.grid.buckets.1.doc_count: 2 } + - match: { aggregations.grid.buckets.2.key: "8/131/85" } + - match: { aggregations.grid.buckets.2.doc_count: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/300_pipeline.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/300_pipeline.yml new file mode 100644 index 0000000000000..2e3d796383a7a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/300_pipeline.yml @@ -0,0 +1,100 @@ +setup: + - skip: + version: " - 7.1.99" + reason: These new error messages were added in 7.2 + + - do: + indices.create: + index: test_1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + int_field: + type : integer + + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 1 + - int_field: 1 + - index: + _index: test_1 + _id: 2 + - int_field: 2 + - index: + _index: test_1 + _id: 3 + - int_field: 3 + - index: + _index: test_1 + _id: 4 + - int_field: 4 + +--- +"Max pipeline through terms agg": + + - do: + catch: /\[Object\[\]\] at aggregation \[the_terms_2\]/ + search: + rest_total_hits_as_int: true + body: + aggs: + the_terms: + terms: + field: "int_field" + aggs: + the_terms_2: + terms: + field: "int_field" + aggs: + the_max: + max: + field: "int_field" + the_bad_max: + max_bucket: + buckets_path: "the_terms>the_terms_2>the_max" + +--- +"Max pipeline on terms agg": + + - do: + catch: /\[LongTerms\] at aggregation \[the_terms_2\]/ + search: + rest_total_hits_as_int: true + body: + aggs: + the_terms: + terms: + field: "int_field" + aggs: + the_terms_2: + terms: + field: "int_field" + the_bad_max: + max_bucket: + buckets_path: "the_terms>the_terms_2" + +--- +"Max pipeline on percentiles agg without specifying percent": + + - do: + catch: /buckets_path must reference either a number value or a single value numeric metric aggregation, but \[the_percentiles\] contains multiple values. Please specify which to use\./ + search: + rest_total_hits_as_int: true + body: + aggs: + the_terms: + terms: + field: "int_field" + aggs: + the_percentiles: + percentiles: + field: "int_field" + the_bad_max: + max_bucket: + buckets_path: "the_terms>the_percentiles" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/30_sig_terms.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/30_sig_terms.yml new file mode 100644 index 0000000000000..dabd4aebf815d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/30_sig_terms.yml @@ -0,0 +1,154 @@ +--- +"Default index": + - do: + indices.create: + index: goodbad + body: + settings: + number_of_shards: "1" + mappings: + properties: + text: + type: text + fielddata: true + class: + type: keyword + + - do: + index: + index: goodbad + id: 1 + body: { text: "good", class: "good" } + - do: + index: + index: goodbad + id: 2 + body: { text: "good", class: "good" } + - do: + index: + index: goodbad + id: 3 + body: { text: "bad", class: "bad" } + - do: + index: + index: goodbad + id: 4 + body: { text: "bad", class: "bad" } + - do: + index: + index: goodbad + id: 5 + body: { text: "good bad", class: "good" } + - do: + index: + index: goodbad + id: 6 + body: { text: "good bad", class: "bad" } + - do: + index: + index: goodbad + id: 7 + body: { text: "bad", class: "bad" } + + + + - do: + indices.refresh: + index: [goodbad] + + - do: + search: + rest_total_hits_as_int: true + index: goodbad + + - match: {hits.total: 7} + + - do: + search: + rest_total_hits_as_int: true + index: goodbad + body: {"aggs": {"class": {"terms": {"field": "class"},"aggs": {"sig_terms": {"significant_terms": {"field": "text"}}}}}} + + - match: {aggregations.class.buckets.0.sig_terms.buckets.0.key: "bad"} + - match: {aggregations.class.buckets.1.sig_terms.buckets.0.key: "good"} + +--- +"IP test": + - do: + indices.create: + index: ip_index + body: + mappings: + properties: + ip: + type: ip + + - do: + index: + index: ip_index + id: 1 + body: { ip: "::1" } + - do: + index: + index: ip_index + id: 2 + body: { } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "query" : { "exists" : { "field" : "ip" } }, "aggs" : { "ip_terms" : { "significant_terms" : { "field" : "ip", "min_doc_count" : 1 } } } } + + - match: { hits.total: 1 } + + - length: { aggregations.ip_terms.buckets: 1 } + + - match: { aggregations.ip_terms.buckets.0.key: "::1" } + + - is_false: aggregations.ip_terms.buckets.0.key_as_string + + - match: { aggregations.ip_terms.buckets.0.doc_count: 1 } + + - do: + search: + rest_total_hits_as_int: true + body: { "query" : { "exists" : { "field" : "ip" } }, "aggs" : { "ip_terms" : { "significant_terms" : { "field" : "ip", "min_doc_count" : 1, "include" : [ "::1" ] } } } } + + - match: { hits.total: 1 } + + - length: { aggregations.ip_terms.buckets: 1 } + + - match: { aggregations.ip_terms.buckets.0.key: "::1" } + + - do: + search: + rest_total_hits_as_int: true + body: { "query" : { "exists" : { "field" : "ip" } }, "aggs" : { "ip_terms" : { "significant_terms" : { "field" : "ip", "min_doc_count" : 1, "exclude" : [ "::1" ] } } } } + + - match: { hits.total: 1 } + + - length: { aggregations.ip_terms.buckets: 0 } + + - do: + catch: request + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "ip_terms" : { "significant_terms" : { "field" : "ip", "exclude" : "127.*" } } } } + +--- +'Misspelled fields get "did you mean"': + - skip: + version: " - 7.6.99" + reason: Implemented in 8.0 (to be backported to 7.7) + - do: + catch: /\[significant_terms\] unknown field \[jlp\] did you mean \[jlh\]\?/ + search: + body: + aggs: + foo: + significant_terms: + field: foo + jlp: {} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/310_date_agg_per_day_of_week.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/310_date_agg_per_day_of_week.yml new file mode 100644 index 0000000000000..10037bf737a7b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/310_date_agg_per_day_of_week.yml @@ -0,0 +1,44 @@ + +setup: + - skip: + version: " - 7.6.99" + reason: "Start of the week Monday was enabled in a backport to 7.7 PR#50916" + features: "spi_on_classpath_jdk9" + + - do: + indices.create: + index: test + body: + mappings: + properties: + date: + type: date + - do: + index: + index: test + id: 1 + body: { "date": "2009-11-15T14:12:12" } + - do: + indices.refresh: + index: [test] +--- +# The inserted document has a field date=2009-11-15T14:12:12 which is Sunday. +# When aggregating per day of the week this should be considered as last day of the week (7) +# and this value should be used in 'key_as_string' +"Date aggregation per day of week": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + aggregations: + test: + "date_histogram": { + "field": "date", + "calendar_interval": "day", + "format": "e", + "offset": 0 + } + - match: {hits.total: 1} + - length: { aggregations.test.buckets: 1 } + - match: { aggregations.test.buckets.0.key_as_string: "7" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/40_range.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/40_range.yml new file mode 100644 index 0000000000000..b1f093c138048 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/40_range.yml @@ -0,0 +1,337 @@ +setup: + - do: + indices.create: + index: test + body: + settings: + number_of_replicas: 0 + mappings: + properties: + ip: + type: ip + double: + type: double + date: + type: date + format: epoch_second + + - do: + cluster.health: + wait_for_status: green + +--- +"Double range": + - do: + index: + index: test + id: 1 + body: { "double" : 42 } + + - do: + index: + index: test + id: 2 + body: { "double" : 100 } + + - do: + index: + index: test + id: 3 + body: { "double" : 50 } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "double_range" : { "range" : { "field" : "double", "ranges": [ { "to": 50 }, { "from": 50, "to": 150 }, { "from": 150 } ] } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.double_range.buckets: 3 } + + - match: { aggregations.double_range.buckets.0.key: "*-50.0" } + + - is_false: aggregations.double_range.buckets.0.from + + - match: { aggregations.double_range.buckets.0.to: 50.0 } + + - match: { aggregations.double_range.buckets.0.doc_count: 1 } + + - match: { aggregations.double_range.buckets.1.key: "50.0-150.0" } + + - match: { aggregations.double_range.buckets.1.from: 50.0 } + + - match: { aggregations.double_range.buckets.1.to: 150.0 } + + - match: { aggregations.double_range.buckets.1.doc_count: 2 } + + - match: { aggregations.double_range.buckets.2.key: "150.0-*" } + + - match: { aggregations.double_range.buckets.2.from: 150.0 } + + - is_false: aggregations.double_range.buckets.2.to + + - match: { aggregations.double_range.buckets.2.doc_count: 0 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "double_range" : { "range" : { "field" : "double", "ranges": [ { "from": null, "to": 50 }, { "from": 50, "to": 150 }, { "from": 150, "to": null } ] } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.double_range.buckets: 3 } + + - match: { aggregations.double_range.buckets.0.key: "*-50.0" } + + - is_false: aggregations.double_range.buckets.0.from + + - match: { aggregations.double_range.buckets.0.to: 50.0 } + + - match: { aggregations.double_range.buckets.0.doc_count: 1 } + + - match: { aggregations.double_range.buckets.1.key: "50.0-150.0" } + + - match: { aggregations.double_range.buckets.1.from: 50.0 } + + - match: { aggregations.double_range.buckets.1.to: 150.0 } + + - match: { aggregations.double_range.buckets.1.doc_count: 2 } + + - match: { aggregations.double_range.buckets.2.key: "150.0-*" } + + - match: { aggregations.double_range.buckets.2.from: 150.0 } + + - is_false: aggregations.double_range.buckets.2.to + + - match: { aggregations.double_range.buckets.2.doc_count: 0 } + +--- +"IP range": + - do: + index: + index: test + id: 1 + body: { "ip" : "::1" } + + - do: + index: + index: test + id: 2 + body: { "ip" : "192.168.0.1" } + + - do: + index: + index: test + id: 3 + body: { "ip" : "192.168.0.7" } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "ip_range" : { "ip_range" : { "field" : "ip", "ranges": [ { "to": "192.168.0.0" }, { "from": "192.168.0.0", "to": "192.169.0.0" }, { "from": "192.169.0.0" } ] } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.ip_range.buckets: 3 } + + - is_false: aggregations.ip_range.buckets.0.from + + - match: { aggregations.ip_range.buckets.0.to: "192.168.0.0" } + + - match: { aggregations.ip_range.buckets.0.doc_count: 1 } + + - match: { aggregations.ip_range.buckets.1.from: "192.168.0.0" } + + - match: { aggregations.ip_range.buckets.1.to: "192.169.0.0" } + + - match: { aggregations.ip_range.buckets.1.doc_count: 2 } + + - match: { aggregations.ip_range.buckets.2.from: "192.169.0.0" } + + - is_false: aggregations.ip_range.buckets.2.to + + - match: { aggregations.ip_range.buckets.2.doc_count: 0 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "ip_range" : { "ip_range" : { "field" : "ip", "ranges": [ { "from": null, "to": "192.168.0.0" }, { "from": "192.168.0.0", "to": "192.169.0.0" }, { "from": "192.169.0.0", "to": null } ] } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.ip_range.buckets: 3 } + + - is_false: aggregations.ip_range.buckets.0.from + + - match: { aggregations.ip_range.buckets.0.to: "192.168.0.0" } + + - match: { aggregations.ip_range.buckets.0.doc_count: 1 } + + - match: { aggregations.ip_range.buckets.1.from: "192.168.0.0" } + + - match: { aggregations.ip_range.buckets.1.to: "192.169.0.0" } + + - match: { aggregations.ip_range.buckets.1.doc_count: 2 } + + - match: { aggregations.ip_range.buckets.2.from: "192.169.0.0" } + + - is_false: aggregations.ip_range.buckets.2.to + + - match: { aggregations.ip_range.buckets.2.doc_count: 0 } + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "ip_range" : { "ip_range" : { "field" : "ip", "ranges": [ { "mask": "::/24" }, { "mask": "192.168.0.0/16" } ] } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.ip_range.buckets: 2 } + + - match: { aggregations.ip_range.buckets.0.key: "::/24" } + + - match: { aggregations.ip_range.buckets.0.to: "0:100::" } + + - match: { aggregations.ip_range.buckets.0.doc_count: 3 } + + - match: { aggregations.ip_range.buckets.1.key: "192.168.0.0/16" } + + - match: { aggregations.ip_range.buckets.1.from: "192.168.0.0" } + + - match: { aggregations.ip_range.buckets.1.to: "192.169.0.0" } + + - match: { aggregations.ip_range.buckets.1.doc_count: 2 } + +--- +"IP Range Key Generation": + - skip: + version: " - 6.3.99" + reason: "Before 6.4.0, ip_range did not always generate bucket keys (see #21045)." + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "ip_range" : { "ip_range" : { "field" : "ip", "ranges": [ { "to": "192.168.0.0" }, { "from": "192.168.0.0", "to": "192.169.0.0" }, { "from": "192.169.0.0" } ] } } } } + + - length: { aggregations.ip_range.buckets: 3 } + - match: { aggregations.ip_range.buckets.0.key: "*-192.168.0.0" } + - match: { aggregations.ip_range.buckets.1.key: "192.168.0.0-192.169.0.0" } + - match: { aggregations.ip_range.buckets.2.key: "192.169.0.0-*" } + +--- +"Date range": + - do: + index: + index: test + id: 1 + body: { "date" : 1000 } + + - do: + index: + index: test + id: 2 + body: { "date" : 2000 } + + - do: + index: + index: test + id: 3 + body: { "date" : 3000 } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "aggs" : { "date_range" : { "date_range" : { "field" : "date", "ranges": [ { "from" : 1000, "to": 3000 }, { "from": 3000, "to": 4000 } ] } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.date_range.buckets: 2 } + + - match: { aggregations.date_range.buckets.0.doc_count: 2 } + - match: { aggregations.date_range.buckets.0.key: "1000-3000" } + - match: { aggregations.date_range.buckets.0.from: 1000000 } + - match: { aggregations.date_range.buckets.0.to: 3000000 } + + - match: { aggregations.date_range.buckets.1.doc_count: 1 } + - match: { aggregations.date_range.buckets.1.key: "3000-4000" } + - match: { aggregations.date_range.buckets.1.from: 3000000 } + - match: { aggregations.date_range.buckets.1.to: 4000000 } + +--- +"Date Range Missing": + - do: + index: + index: test + id: 1 + body: { "date" : "28800000000" } + + - do: + index: + index: test + id: 2 + body: { "date" : "315561600000" } + + - do: + index: + index: test + id: 3 + body: { "date" : "631180800000" } + + - do: + index: + index: test + id: 4 + body: { "date" : "10000" } + + - do: + index: + index: test + id: 5 + body: { "ip" : "192.168.0.1" } + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: + aggs: + age_groups: + date_range: + field: date + missing: "0" + ranges: + - key: Generation Y + from: '315561600000' + to: '946713600000' + - key: Generation X + from: "200000" + to: '315561600000' + - key: Other + to: "200000" + + - match: { hits.total: 5 } + + - length: { aggregations.age_groups.buckets: 3 } + + - match: { aggregations.age_groups.buckets.0.key: "Other" } + + - match: { aggregations.age_groups.buckets.0.doc_count: 2 } + + - match: { aggregations.age_groups.buckets.1.key: "Generation X" } + + - match: { aggregations.age_groups.buckets.1.doc_count: 1 } + + - match: { aggregations.age_groups.buckets.2.key: "Generation Y" } + + - match: { aggregations.age_groups.buckets.2.doc_count: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/50_filter.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/50_filter.yml new file mode 100644 index 0000000000000..bc4105af85e65 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/50_filter.yml @@ -0,0 +1,156 @@ +setup: + - do: + indices.create: + index: test + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: + properties: + mentions: + type: keyword + notifications: + type: keyword + + - do: + index: + index: test + id: foo|bar|baz0 + body: { "notifications" : ["abc"] } + + - do: + index: + index: test + id: foo|bar|baz1 + body: { "mentions" : ["abc"] } + + - do: + indices.refresh: {} + +--- +"Filter aggs with terms lookup and ensure it's cached": + # Because the filter agg rewrites the terms lookup in the rewrite phase the request can be cached + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + search: + rest_total_hits_as_int: true + size: 0 + request_cache: true + body: {"aggs": { "itemsNotify": { "filter": { "terms": { "mentions": { "index": "test", "id": "foo|bar|baz0", "path": "notifications"}}}, "aggs": { "mentions" : {"terms" : { "field" : "mentions" }}}}}} + + # validate result + - match: { hits.total: 2 } + - match: { aggregations.itemsNotify.doc_count: 1 } + - length: { aggregations.itemsNotify.mentions.buckets: 1 } + - match: { aggregations.itemsNotify.mentions.buckets.0.key: "abc" } + # we are using a lookup - this should not cache + - do: + indices.stats: { index: test, metric: request_cache} + - match: { _shards.total: 1 } + - match: { _all.total.request_cache.hit_count: 0 } + - match: { _all.total.request_cache.miss_count: 1 } + - is_true: indices.test + +--- +"Filter aggs no lookup and ensure it's cached": + # now run without lookup and ensure we get cached or at least do the lookup + - do: + search: + rest_total_hits_as_int: true + size: 0 + request_cache: true + body: {"aggs": { "itemsNotify": { "filter": { "terms": { "mentions": ["abc"]}}, "aggs": { "mentions" : {"terms" : { "field" : "mentions" }}}}}} + + - match: { hits.total: 2 } + - match: { aggregations.itemsNotify.doc_count: 1 } + - length: { aggregations.itemsNotify.mentions.buckets: 1 } + - match: { aggregations.itemsNotify.mentions.buckets.0.key: "abc" } + - do: + indices.stats: { index: test, metric: request_cache} + - match: { _shards.total: 1 } + - match: { _all.total.request_cache.hit_count: 0 } + - match: { _all.total.request_cache.miss_count: 1 } + - is_true: indices.test + +--- +"As a child of terms": + - skip: + version: " - 6.99.99" + reason: the test is written for hits.total.value + + - do: + bulk: + refresh: true + index: test + body: | + {"index":{}} + {"category": "bar", "val": 8} + {"index":{}} + {"category": "bar", "val": 0} + - do: + search: + size: 0 + body: + aggs: + category: + terms: + field: category.keyword + aggs: + high: + filter: + range: + val: + gte: 7 + + - match: { hits.total.value: 4 } + - match: { aggregations.category.buckets.0.key: bar } + - match: { aggregations.category.buckets.0.doc_count: 2 } + - match: { aggregations.category.buckets.0.high.doc_count: 1 } + +--- +"Sorting terms": + - skip: + version: " - 7.6.99" + reason: fixed in 7.7.0 + + - do: + bulk: + refresh: true + index: test + body: | + {"index":{}} + {"category": "foo", "val": 7} + {"index":{}} + {"category": "bar", "val": 8} + {"index":{}} + {"category": "bar", "val": 9} + {"index":{}} + {"category": "bar", "val": 0} + - do: + search: + size: 0 + body: + aggs: + category: + terms: + field: category.keyword + order: + high.doc_count: desc + aggs: + high: + filter: + range: + val: + gte: 7 + + - match: { hits.total.value: 6 } + - match: { aggregations.category.buckets.0.key: bar } + - match: { aggregations.category.buckets.0.doc_count: 3 } + - match: { aggregations.category.buckets.0.high.doc_count: 2 } + - match: { aggregations.category.buckets.1.key: foo } + - match: { aggregations.category.buckets.1.doc_count: 1 } + - match: { aggregations.category.buckets.1.high.doc_count: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/51_filter_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/51_filter_with_types.yml new file mode 100644 index 0000000000000..54476ce6e65b1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/51_filter_with_types.yml @@ -0,0 +1,60 @@ +setup: + - do: + indices.create: + include_type_name: true + index: test + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: + test: + properties: + mentions: + type: keyword + notifications: + type: keyword + + - do: + index: + index: test + type: test + id: foo|bar|baz0 + body: { "notifications" : ["abc"] } + + - do: + index: + index: test + type: test + id: foo|bar|baz1 + body: { "mentions" : ["abc"] } + + - do: + indices.refresh: {} + +--- +"Filter aggs with terms lookup and ensure it's cached": + # Because the filter agg rewrites the terms lookup in the rewrite phase the request can be cached + - skip: + features: allowed_warnings + - do: + allowed_warnings: + - "Deprecated field [type] used, this field is unused and will be removed entirely" + search: + rest_total_hits_as_int: true + size: 0 + request_cache: true + body: {"aggs": { "itemsNotify": { "filter": { "terms": { "mentions": { "index": "test", "type": "test", "id": "foo|bar|baz0", "path": "notifications"}}}, "aggs": { "mentions" : {"terms" : { "field" : "mentions" }}}}}} + + # validate result + - match: { hits.total: 2 } + - match: { aggregations.itemsNotify.doc_count: 1 } + - length: { aggregations.itemsNotify.mentions.buckets: 1 } + - match: { aggregations.itemsNotify.mentions.buckets.0.key: "abc" } + # we are using a lookup - this should not cache + - do: + indices.stats: { index: test, metric: request_cache} + - match: { _shards.total: 1 } + - match: { _all.total.request_cache.hit_count: 0 } + - match: { _all.total.request_cache.miss_count: 1 } + - is_true: indices.test diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/70_adjacency_matrix.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/70_adjacency_matrix.yml new file mode 100644 index 0000000000000..3394b9a5a602a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/70_adjacency_matrix.yml @@ -0,0 +1,58 @@ +setup: + - do: + indices.create: + index: test + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: + properties: + num: + type: integer + + - do: + index: + index: test + id: 1 + body: { "num": [1, 2] } + + - do: + index: + index: test + id: 2 + body: { "num": [2, 3] } + + - do: + index: + index: test + id: 3 + body: { "num": [3, 4] } + + - do: + indices.refresh: {} + + +--- +"Filters intersections": + + - do: + search: + rest_total_hits_as_int: true + body: { "size": 0, "aggs": { "conns": { "adjacency_matrix": { "filters": { "1": { "term": { "num": 1 } }, "2": { "term": { "num": 2 } }, "4": { "term": { "num": 4 } } } } } } } + + - match: { hits.total: 3 } + + - length: { aggregations.conns.buckets: 4 } + + - match: { aggregations.conns.buckets.0.doc_count: 1 } + - match: { aggregations.conns.buckets.0.key: "1" } + + - match: { aggregations.conns.buckets.1.doc_count: 1 } + - match: { aggregations.conns.buckets.1.key: "1&2" } + + - match: { aggregations.conns.buckets.2.doc_count: 2 } + - match: { aggregations.conns.buckets.2.key: "2" } + + - match: { aggregations.conns.buckets.3.doc_count: 1 } + - match: { aggregations.conns.buckets.3.key: "4" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/80_typed_keys.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/80_typed_keys.yml new file mode 100644 index 0000000000000..d041432556430 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/80_typed_keys.yml @@ -0,0 +1,237 @@ +setup: + + - do: + indices.create: + index: test + body: + settings: + number_of_replicas: 0 + mappings: + properties: + name: + type: keyword + num: + type: integer + created: + type: date + + - do: + bulk: + refresh: true + index: test + body: + - '{"index": {}}' + - '{"name": "one", "num": 1, "created": "2010-03-12T01:07:45"}' + - '{"index": {}}' + - '{"name": "two", "num": 2, "created": "2010-03-12T04:11:00"}' + - '{"index": {}}' + - '{"name": "three", "num": 3, "created": "2010-04-27T03:43:34"}' + +--- +"Test typed keys parameter for avg aggregation": + - do: + search: + rest_total_hits_as_int: true + typed_keys: true + body: + size: 0 + aggregations: + test_avg: + avg: + field: num + - is_true: aggregations.avg#test_avg + +--- +"Test typed keys parameter for cardinality aggregation": + - do: + search: + rest_total_hits_as_int: true + typed_keys: true + body: + size: 0 + aggregations: + test_cardinality: + cardinality: + field: name + - is_true: aggregations.cardinality#test_cardinality + +--- +"Test typed keys parameter for extended_stats aggregation": + - do: + search: + rest_total_hits_as_int: true + typed_keys: true + body: + size: 0 + aggregations: + test_extended_stats: + extended_stats: + field: num + - is_true: aggregations.extended_stats#test_extended_stats + +--- +"Test typed keys parameter for max aggregation": + - do: + search: + rest_total_hits_as_int: true + typed_keys: true + body: + size: 0 + aggregations: + test_max: + max: + field: num + - is_true: aggregations.max#test_max + +--- +"Test typed keys parameter for min aggregation": + - do: + search: + rest_total_hits_as_int: true + typed_keys: true + body: + size: 0 + aggregations: + test_min: + min: + field: num + - is_true: aggregations.min#test_min + +--- +"Test typed keys parameter for percentiles aggregation": + - do: + search: + rest_total_hits_as_int: true + typed_keys: true + body: + size: 0 + aggregations: + test_percentiles: + percentiles: + field: num + - is_true: aggregations.tdigest_percentiles#test_percentiles + +--- +"Test typed keys parameter for percentile_ranks aggregation": + - do: + search: + rest_total_hits_as_int: true + typed_keys: true + body: + size: 0 + aggregations: + test_percentile_ranks: + percentile_ranks: + field: num + values: [0,10] + - is_true: aggregations.tdigest_percentile_ranks#test_percentile_ranks + +--- +"Test typed keys parameter for stats aggregation": + - do: + search: + rest_total_hits_as_int: true + typed_keys: true + body: + size: 0 + aggregations: + test_stats: + stats: + field: num + - is_true: aggregations.stats#test_stats + +--- +"Test typed keys parameter for sum aggregation": + - do: + search: + rest_total_hits_as_int: true + typed_keys: true + body: + size: 0 + aggregations: + test_sum: + sum: + field: num + - is_true: aggregations.sum#test_sum + +--- +"Test typed keys parameter for terms and top_hits aggregation": + - do: + search: + rest_total_hits_as_int: true + typed_keys: true + body: + size: 0 + aggregations: + test_terms: + terms: + field: name + aggs: + test_top_hits: + top_hits: + sort: num + - is_true: aggregations.sterms#test_terms + - is_true: aggregations.sterms#test_terms.buckets.0.top_hits#test_top_hits + - is_true: aggregations.sterms#test_terms.buckets.1.top_hits#test_top_hits + - is_true: aggregations.sterms#test_terms.buckets.2.top_hits#test_top_hits + +--- +"Test typed keys parameter for terms aggregation": + - do: + search: + rest_total_hits_as_int: true + typed_keys: true + body: + size: 0 + aggregations: + test_terms: + terms: + field: num + - is_true: aggregations.lterms#test_terms + +--- +"Test typed keys parameter for value_count aggregation": + - do: + search: + rest_total_hits_as_int: true + typed_keys: true + body: + size: 0 + aggregations: + test_value_count: + value_count: + field: num + - is_true: aggregations.value_count#test_value_count + +--- +"Test typed keys parameter for date_histogram aggregation and max_bucket pipeline aggregation": + - skip: + version: " - 7.1.99" + reason: "calendar_interval added in 7.2" + - do: + search: + rest_total_hits_as_int: true + typed_keys: true + body: + size: 0 + aggregations: + test_created_histogram: + date_histogram: + field: created + calendar_interval: month + aggregations: + test_sum: + sum: + field: num + test_deriv: + derivative: + buckets_path: "test_sum" + test_max_bucket: + max_bucket: + buckets_path: "test_created_histogram>test_sum" + + - is_true: aggregations.date_histogram#test_created_histogram + - is_true: aggregations.date_histogram#test_created_histogram.buckets.0.sum#test_sum + - is_true: aggregations.date_histogram#test_created_histogram.buckets.1.sum#test_sum + - is_true: aggregations.date_histogram#test_created_histogram.buckets.1.derivative#test_deriv + - is_true: aggregations.bucket_metric_value#test_max_bucket diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/90_sig_text.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/90_sig_text.yml new file mode 100644 index 0000000000000..673d19e04cf22 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/90_sig_text.yml @@ -0,0 +1,151 @@ +--- +"Default index": + + - do: + indices.create: + index: goodbad + body: + settings: + number_of_shards: "1" + mappings: + properties: + text: + type: text + fielddata: false + class: + type: keyword + + - do: + index: + index: goodbad + id: 1 + body: { text: "good", class: "good" } + - do: + index: + index: goodbad + id: 2 + body: { text: "good", class: "good" } + - do: + index: + index: goodbad + id: 3 + body: { text: "bad", class: "bad" } + - do: + index: + index: goodbad + id: 4 + body: { text: "bad", class: "bad" } + - do: + index: + index: goodbad + id: 5 + body: { text: "good bad", class: "good" } + - do: + index: + index: goodbad + id: 6 + body: { text: "good bad", class: "bad" } + - do: + index: + index: goodbad + id: 7 + body: { text: "bad", class: "bad" } + + + + - do: + indices.refresh: + index: [goodbad] + + - do: + search: + rest_total_hits_as_int: true + index: goodbad + + - match: {hits.total: 7} + + - do: + search: + rest_total_hits_as_int: true + index: goodbad + body: {"aggs": {"class": {"terms": {"field": "class"},"aggs": {"sig_text": {"significant_text": {"field": "text"}}}}}} + + - match: {aggregations.class.buckets.0.sig_text.buckets.0.key: "bad"} + - match: {aggregations.class.buckets.1.sig_text.buckets.0.key: "good"} + +--- +"Dedup noise": + + - do: + indices.create: + index: goodbad + body: + settings: + number_of_shards: "1" + mappings: + properties: + text: + type: text + fielddata: false + class: + type: keyword + + - do: + index: + index: goodbad + id: 1 + body: { text: "good noisewords1 g1 g2 g3 g4 g5 g6", class: "good" } + - do: + index: + index: goodbad + id: 2 + body: { text: "good noisewords2 g1 g2 g3 g4 g5 g6", class: "good" } + - do: + index: + index: goodbad + id: 3 + body: { text: "bad noisewords3 b1 b2 b3 b4 b5 b6", class: "bad" } + - do: + index: + index: goodbad + id: 4 + body: { text: "bad noisewords4 b1 b2 b3 b4 b5 b6", class: "bad" } + - do: + index: + index: goodbad + id: 5 + body: { text: "good bad noisewords5 gb1 gb2 gb3 gb4 gb5 gb6", class: "good" } + - do: + index: + index: goodbad + id: 6 + body: { text: "good bad noisewords6 gb1 gb2 gb3 gb4 gb5 gb6", class: "bad" } + - do: + index: + index: goodbad + id: 7 + body: { text: "bad noisewords7 b1 b2 b3 b4 b5 b6", class: "bad" } + + + + - do: + indices.refresh: + index: [goodbad] + + - do: + search: + rest_total_hits_as_int: true + index: goodbad + + - match: {hits.total: 7} + + - do: + search: + rest_total_hits_as_int: true + index: goodbad + body: {"aggs": {"class": {"terms": {"field": "class"},"aggs": {"sig_text": {"significant_text": {"field": "text", "filter_duplicate_text": true}}}}}} + + - match: {aggregations.class.buckets.0.sig_text.buckets.0.key: "bad"} + - length: { aggregations.class.buckets.0.sig_text.buckets: 1 } + - match: {aggregations.class.buckets.1.sig_text.buckets.0.key: "good"} + - length: { aggregations.class.buckets.1.sig_text.buckets: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/10_unified.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/10_unified.yml new file mode 100644 index 0000000000000..edb1ba1b05934 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/10_unified.yml @@ -0,0 +1,35 @@ +setup: + - do: + indices.create: + index: test + body: + mappings: + "properties": + "text": + "type": "text" + "fields": + "fvh": + "type": "text" + "term_vector": "with_positions_offsets" + "postings": + "type": "text" + "index_options": "offsets" + - do: + index: + index: test + id: 1 + body: + "text" : "The quick brown fox is brown." + - do: + indices.refresh: {} + +--- +"Basic": + - do: + search: + rest_total_hits_as_int: true + body: { "query" : {"multi_match" : { "query" : "quick brown fox", "fields" : [ "text*"] } }, "highlight" : { "type" : "unified", "fields" : { "*" : {} } } } + + - match: {hits.hits.0.highlight.text.0: "The quick brown fox is brown."} + - match: {hits.hits.0.highlight.text\.fvh.0: "The quick brown fox is brown."} + - match: {hits.hits.0.highlight.text\.postings.0: "The quick brown fox is brown."} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/20_fvh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/20_fvh.yml new file mode 100644 index 0000000000000..d411f55106d75 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/20_fvh.yml @@ -0,0 +1,45 @@ +setup: + - do: + indices.create: + index: test + body: + mappings: + "properties": + "title": + "type": "text" + "term_vector": "with_positions_offsets" + "description": + "type": "text" + "term_vector": "with_positions_offsets" + - do: + index: + index: test + id: 1 + body: + "title" : "The quick brown fox is brown" + "description" : "The quick pink panther is pink" + - do: + indices.refresh: {} + +--- +"Highlight query": + - do: + search: + rest_total_hits_as_int: true + body: + highlight: + type: fvh + fields: + description: + type: fvh + highlight_query: + prefix: + description: br + title: + type: fvh + highlight_query: + prefix: + title: br + + - match: {hits.hits.0.highlight.title.0: "The quick brown fox is brown"} + - is_false: hits.hits.0.highlight.description diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/30_max_analyzed_offset.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/30_max_analyzed_offset.yml new file mode 100644 index 0000000000000..334708b54b066 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/30_max_analyzed_offset.yml @@ -0,0 +1,81 @@ +--- +setup: + - do: + indices.create: + index: test1 + body: + settings: + number_of_shards: 1 + index.highlight.max_analyzed_offset: 10 + mappings: + properties: + field1: + type: text + field2: + type: text + index_options: offsets + + - do: + index: + index: test1 + id: 1 + body: + "field1" : "The quick brown fox went to the forest and saw another fox." + "field2" : "The quick brown fox went to the forest and saw another fox." + + - do: + indices.refresh: {} + +--- +"Unified highlighter on a field WITHOUT OFFSETS exceeding index.highlight.max_analyzed_offset should FAIL": + - skip: + version: " - 6.99.99" + reason: index.highlight.max_analyzed_offset setting has been added in 7.0.0 + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + index: test1 + body: {"query" : {"match" : {"field1" : "fox"}}, "highlight" : {"type" : "unified", "fields" : {"field1" : {}}}} + - match: { error.root_cause.0.type: "illegal_argument_exception" } + + +--- +"Plain highlighter on a field WITHOUT OFFSETS exceeding index.highlight.max_analyzed_offset should FAIL": + - skip: + version: " - 6.99.99" + reason: index.highlight.max_analyzed_offset setting has been added in 7.0.0 + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + index: test1 + body: {"query" : {"match" : {"field1" : "fox"}}, "highlight" : {"type" : "unified", "fields" : {"field1" : {}}}} + - match: { error.root_cause.0.type: "illegal_argument_exception" } + + +--- +"Unified highlighter on a field WITH OFFSETS exceeding index.highlight.max_analyzed_offset should SUCCEED": + - skip: + version: " - 6.99.99" + reason: index.highligt.max_analyzed_offset setting has been added in 7.0.0 + - do: + search: + rest_total_hits_as_int: true + index: test1 + body: {"query" : {"match" : {"field2" : "fox"}}, "highlight" : {"type" : "unified", "fields" : {"field2" : {}}}} + - match: {hits.hits.0.highlight.field2.0: "The quick brown fox went to the forest and saw another fox."} + + +--- +"Plain highlighter on a field WITH OFFSETS exceeding index.highlight.max_analyzed_offset should FAIL": + - skip: + version: " - 6.99.99" + reason: index.highlight.max_analyzed_offset setting has been added in 7.0.0 + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + index: test1 + body: {"query" : {"match" : {"field2" : "fox"}}, "highlight" : {"type" : "plain", "fields" : {"field2" : {}}}} + - match: { error.root_cause.0.type: "illegal_argument_exception" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/40_keyword_ignore.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/40_keyword_ignore.yml new file mode 100644 index 0000000000000..fe4f36364d2db --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/40_keyword_ignore.yml @@ -0,0 +1,64 @@ +--- +setup: + - do: + indices.create: + index: test-index + body: + mappings: + "properties": + "k1": + "type": "keyword" + "k2": + "type": "keyword" + "ignore_above": 3 + - do: + bulk: + index: test-index + refresh: true + body: + - '{"index": {"_id": "1"}}' + - '{"k1": "123", "k2" : "123"}' + - '{"index": {"_id": "2"}}' + - '{"k1": "1234", "k2" : "1234"}' + +--- +"Plain Highligher should skip highlighting ignored keyword values": + - skip: + version: " - 7.6.99" + reason: "skip highlighting of ignored values was introduced in 7.7" + - do: + search: + index: test-index + body: + query: + prefix: + k1: "12" + highlight: + require_field_match: false + fields: + k2: + type: plain + + - match: {hits.hits.0.highlight.k2.0: "123"} + - is_false: hits.hits.1.highlight # no highlight for a value that was ignored + +--- +"Unified Highligher should skip highlighting ignored keyword values": + - skip: + version: " - 7.6.99" + reason: "skip highlighting of ignored values was introduced in 7.7" + - do: + search: + index: test-index + body: + query: + prefix: + k1: "12" + highlight: + require_field_match: false + fields: + k2: + type: unified + + - match: {hits.hits.0.highlight.k2.0: "123"} + - is_false: hits.hits.1.highlight # no highlight for a value that was ignored diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.inner_hits/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.inner_hits/10_basic.yml new file mode 100644 index 0000000000000..629a6d4de34a1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search.inner_hits/10_basic.yml @@ -0,0 +1,94 @@ +--- +setup: + - do: + indices.create: + index: test + body: + mappings: + properties: + nested_field: + type: nested + +--- +"Nested inner hits": + - skip: + version: " - 6.1.99" + reason: "<= 6.1 nodes don't always include index or id in nested inner hits" + - do: + index: + index: test + id: 1 + body: + "nested_field" : [ { "foo": "bar" } ] + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "query" : { "nested" : { "path" : "nested_field", "query" : { "match_all" : {} }, "inner_hits" : {} } } } + - match: { hits.total: 1 } + - match: { hits.hits.0._index: "test" } + - match: { hits.hits.0._type: "_doc" } + - match: { hits.hits.0._id: "1" } + - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0._index: "test" } + - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0._type: "_doc" } + - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0._id: "1" } + - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0._nested.field: "nested_field" } + - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0._nested.offset: 0 } + - is_false: hits.hits.0.inner_hits.nested_field.hits.hits.0._nested.child + + +--- +"Nested doc version and seqIDs": + + - skip: + version: " - 6.99.99" + reason: "Triggers warnings before 7.0" + + - do: + index: + index: test + id: 1 + body: + "nested_field" : [ { "foo": "bar" } ] + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "query" : { "nested" : { "path" : "nested_field", "query" : { "match_all" : {} }, "inner_hits" : { version: true, "docvalue_fields": [ "_seq_no" ]} }}, "version": true, "docvalue_fields" : [ "_seq_no" ] } + + - match: { hits.total: 1 } + - match: { hits.hits.0._index: "test" } + - match: { hits.hits.0._type: "_doc" } + - match: { hits.hits.0._id: "1" } + - match: { hits.hits.0._version: 1 } + - match: { hits.hits.0.fields._seq_no: [0] } + - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0.fields._seq_no: [0] } + + + - do: + index: + index: test + id: 1 + body: + "nested_field" : [ { "foo": "baz" } ] + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: { "query" : { "nested" : { "path" : "nested_field", "query" : { "match_all" : {} }, "inner_hits" : { version: true, "docvalue_fields": [ "_seq_no" ]} }}, "version": true, "docvalue_fields" : [ "_seq_no" ] } + + - match: { hits.total: 1 } + - match: { hits.hits.0._index: "test" } + - match: { hits.hits.0._type: "_doc" } + - match: { hits.hits.0._id: "1" } + - match: { hits.hits.0._version: 2 } + - match: { hits.hits.0.fields._seq_no: [1] } + - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0._version: 2 } + - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0.fields._seq_no: [1] } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/100_stored_fields.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/100_stored_fields.yml new file mode 100644 index 0000000000000..a82d7fff480eb --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/100_stored_fields.yml @@ -0,0 +1,44 @@ +setup: + - do: + indices.create: + index: test + - do: + index: + index: test + id: 1 + body: { foo: bar } + - do: + indices.refresh: + index: [test] + +--- +"Stored fields": + - do: + search: + rest_total_hits_as_int: true + index: test + + - is_true: hits.hits.0._id + - is_true: hits.hits.0._type + - is_true: hits.hits.0._source + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + stored_fields: [] + + - is_true: hits.hits.0._id + - is_true: hits.hits.0._type + - is_false: hits.hits.0._source + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + stored_fields: "_none_" + + - is_false: hits.hits.0._id + - is_false: hits.hits.0._source diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/10_source_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/10_source_filtering.yml new file mode 100644 index 0000000000000..501fb1292da94 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/10_source_filtering.yml @@ -0,0 +1,201 @@ +--- +setup: + - do: + indices.create: + index: test + body: + mappings: + properties: + bigint: + type: keyword + + + - do: + index: + index: test_1 + id: 1 + body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1, "bigint": 72057594037927936 } + - do: + indices.refresh: {} + +--- +"_source: true": + + - do: + search: + body: { _source: true, query: { match_all: {} } } + + - length: { hits.hits: 1 } + - match: { hits.hits.0._source.count: 1 } + +--- +"_source: false": + - do: { search: { body: { _source: false, query: { match_all: {} } } } } + - length: { hits.hits: 1 } + - is_false: hits.hits.0._source + +--- +"no filtering": + - do: { search: { body: { query: { match_all: {} } } } } + - length: { hits.hits: 1 } + - match: { hits.hits.0._source.count: 1 } + +--- +"_source in body": + - do: { search: { body: { _source: include.field1, query: { match_all: {} } } } } + - match: { hits.hits.0._source.include.field1: v1 } + - is_false: hits.hits.0._source.include.field2 + +--- +"_source_includes and _source in body": + - do: { search: { _source_includes: include.field1, body: { _source: include.field2, query: { match_all: {} } } } } + - match: { hits.hits.0._source.include.field1: v1 } + - is_false: hits.hits.0._source.include.field2 + +--- +"_source_includes": + - do: { search: { _source_includes: include.field1, body: { query: { match_all: {} } } } } + - match: { hits.hits.0._source.include.field1: v1 } + - is_false: hits.hits.0._source.include.field2 + +--- +"_source_excludes": + - do: { search: { _source_excludes: count, body: { query: { match_all: {} } } } } + - match: { hits.hits.0._source.include: { field1 : v1 , field2: v2 }} + - is_false: hits.hits.0._source.count + +--- +"_source field1 field2": + - do: + search: + body: + _source: [ include.field1, include.field2 ] + query: { match_all: {} } + - match: { hits.hits.0._source.include.field1: v1 } + - match: { hits.hits.0._source.include.field2: v2 } + - is_false: hits.hits.0._source.count + +--- +"_source.include field1 field2": + - do: + search: + body: + _source: + includes: [ include.field1, include.field2 ] + query: { match_all: {} } + - match: { hits.hits.0._source.include.field1: v1 } + - match: { hits.hits.0._source.include.field2: v2 } + - is_false: hits.hits.0._source.count + +--- +"_source includes and excludes": + - do: + search: + body: + _source: + includes: include + excludes: "*.field2" + query: { match_all: {} } + - match: { hits.hits.0._source.include.field1: v1 } + - is_false: hits.hits.0._source.include.field2 + +--- +"_source include on bigint": + - do: + search: + body: + _source: + includes: bigint + query: { match_all: {} } + - match: { hits.hits.0._source.bigint: 72057594037927936 } + - is_false: hits.hits.0._source.include.field2 + + +--- +"_source filtering on bigint": +- do: + search: + body: + _source: ["bigint"] + query: { match_all: {} } +- match: { hits.hits.0._source.bigint: 72057594037927936 } + +--- +"fields in body": + - do: + search: + body: + stored_fields: [ include.field2 ] + query: { match_all: {} } + - is_false: hits.hits.0._source + +--- +"fields in body with source": + - do: + search: + body: + stored_fields: [ include.field2, _source ] + query: { match_all: {} } + - match: { hits.hits.0._source.include.field2: v2 } + - is_true: hits.hits.0._source + +--- +"docvalue_fields": + - skip: + version: " - 6.9.99" + reason: Triggers a deprecation warning before 7.0 + - do: + search: + body: + docvalue_fields: [ "count" ] + - match: { hits.hits.0.fields.count: [1] } + +--- +"multiple docvalue_fields": + - skip: + version: " - 6.9.99" + reason: Triggered a deprecation warning before 7.0 + - do: + search: + body: + docvalue_fields: [ "count", "include.field1.keyword" ] + - match: { hits.hits.0.fields.count: [1] } + +--- +"docvalue_fields as url param": + - skip: + version: " - 6.99.99" + reason: Triggered a deprecation warning before 7.0 + - do: + search: + docvalue_fields: [ "count" ] + - match: { hits.hits.0.fields.count: [1] } + +--- +"docvalue_fields with default format": + - skip: + version: " - 6.99.99" + reason: Only triggers warnings on 7.0+ + features: warnings + - do: + warnings: + - "[use_field_mapping] is a special format that was only used to ease the transition to 7.x. It has become the default and shouldn't be set explicitly anymore." + search: + body: + docvalue_fields: + - field: "count" + format: "use_field_mapping" + - match: { hits.hits.0.fields.count: [1] } + +--- +"docvalue_fields with explicit format": + - skip: + version: " - 6.3.99" + reason: format option was added in 6.4 + - do: + search: + body: + docvalue_fields: + - field: "count" + format: "#.0" + - match: { hits.hits.0.fields.count: ["1.0"] } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/110_field_collapsing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/110_field_collapsing.yml new file mode 100644 index 0000000000000..3ae293f38f23d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/110_field_collapsing.yml @@ -0,0 +1,469 @@ +setup: + - do: + indices.create: + index: test + body: + mappings: + properties: + numeric_group: { type: integer } + + - do: + index: + index: test + id: 1 + version_type: external + version: 11 + body: { numeric_group: 1, sort: 10 } + - do: + index: + index: test + id: 2 + version_type: external + version: 22 + body: { numeric_group: 1, sort: 6 } + - do: + index: + index: test + id: 3 + version_type: external + version: 33 + body: { numeric_group: 1, sort: 24 } + - do: + index: + index: test + id: 4 + version_type: external + version: 44 + body: { numeric_group: 25, sort: 10 } + - do: + index: + index: test + id: 5 + version_type: external + version: 55 + body: { numeric_group: 25, sort: 5 } + - do: + index: + index: test + id: 6 + version_type: external + version: 66 + body: { numeric_group: 3, sort: 36 } + - do: + indices.refresh: + index: test + +--- +"field collapsing": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + collapse: { field: numeric_group } + sort: [{ sort: desc }] + + - match: {hits.total: 6 } + - length: {hits.hits: 3 } + - match: {hits.hits.0._index: test } + - match: {hits.hits.0._type: _doc } + - match: {hits.hits.0.fields.numeric_group: [3] } + - match: {hits.hits.0.sort: [36] } + - match: {hits.hits.0._id: "6" } + - is_false: hits.hits.0.inner_hits + - match: {hits.hits.1._index: test } + - match: {hits.hits.1._type: _doc } + - match: {hits.hits.1.fields.numeric_group: [1] } + - match: {hits.hits.1.sort: [24] } + - match: {hits.hits.1._id: "3" } + - is_false: hits.hits.1.inner_hits + - match: {hits.hits.2._index: test } + - match: {hits.hits.2._type: _doc } + - match: {hits.hits.2.fields.numeric_group: [25] } + - match: {hits.hits.2.sort: [10] } + - match: {hits.hits.2._id: "4" } + - is_false: hits.hits.2.inner_hits + +--- +"field collapsing and from": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + from: 2 + collapse: { field: numeric_group } + sort: [{ sort: desc }] + + - match: {hits.total: 6 } + - length: {hits.hits: 1 } + - match: {hits.hits.0._index: test } + - match: {hits.hits.0._type: _doc } + - match: {hits.hits.0.fields.numeric_group: [25]} + - match: {hits.hits.0.sort: [10] } + - match: {hits.hits.0._id: "4" } + - is_false: hits.hits.0.inner_hits + +--- +"field collapsing and inner_hits": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + collapse: { field: numeric_group, inner_hits: { name: sub_hits, size: 2, sort: [{ sort: asc }] } } + sort: [{ sort: desc }] + + - match: { hits.total: 6 } + - length: { hits.hits: 3 } + - match: { hits.hits.0._index: test } + - match: { hits.hits.0._type: _doc } + - match: { hits.hits.0.fields.numeric_group: [3] } + - match: { hits.hits.0.sort: [36] } + - match: { hits.hits.0._id: "6" } + - match: { hits.hits.0.inner_hits.sub_hits.hits.total: 1 } + - length: { hits.hits.0.inner_hits.sub_hits.hits.hits: 1 } + - match: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._id: "6" } + - match: { hits.hits.1._index: test } + - match: { hits.hits.1._type: _doc } + - match: { hits.hits.1.fields.numeric_group: [1] } + - match: { hits.hits.1.sort: [24] } + - match: { hits.hits.1._id: "3" } + - match: { hits.hits.1.inner_hits.sub_hits.hits.total: 3 } + - length: { hits.hits.1.inner_hits.sub_hits.hits.hits: 2 } + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._id: "2" } + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._id: "1" } + - match: { hits.hits.2._index: test } + - match: { hits.hits.2._type: _doc } + - match: { hits.hits.2.fields.numeric_group: [25] } + - match: { hits.hits.2.sort: [10] } + - match: { hits.hits.2._id: "4" } + - match: { hits.hits.2.inner_hits.sub_hits.hits.total: 2 } + - length: { hits.hits.2.inner_hits.sub_hits.hits.hits: 2 } + - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._id: "5" } + - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._id: "4" } + +--- +"field collapsing, inner_hits and maxConcurrentGroupRequests": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + collapse: { field: numeric_group, max_concurrent_group_searches: 10, inner_hits: { name: sub_hits, size: 2, sort: [{ sort: asc }] } } + sort: [{ sort: desc }] + + - match: { hits.total: 6 } + - length: { hits.hits: 3 } + - match: { hits.hits.0._index: test } + - match: { hits.hits.0._type: _doc } + - match: { hits.hits.0.fields.numeric_group: [3] } + - match: { hits.hits.0.sort: [36] } + - match: { hits.hits.0._id: "6" } + - match: { hits.hits.0.inner_hits.sub_hits.hits.total: 1 } + - length: { hits.hits.0.inner_hits.sub_hits.hits.hits: 1 } + - match: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._id: "6" } + - match: { hits.hits.1._index: test } + - match: { hits.hits.1._type: _doc } + - match: { hits.hits.1.fields.numeric_group: [1] } + - match: { hits.hits.1.sort: [24] } + - match: { hits.hits.1._id: "3" } + - match: { hits.hits.1.inner_hits.sub_hits.hits.total: 3 } + - length: { hits.hits.1.inner_hits.sub_hits.hits.hits: 2 } + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._id: "2" } + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._id: "1" } + - match: { hits.hits.2._index: test } + - match: { hits.hits.2._type: _doc } + - match: { hits.hits.2.fields.numeric_group: [25] } + - match: { hits.hits.2.sort: [10] } + - match: { hits.hits.2._id: "4" } + - match: { hits.hits.2.inner_hits.sub_hits.hits.total: 2 } + - length: { hits.hits.2.inner_hits.sub_hits.hits.hits: 2 } + - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._id: "5" } + - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._id: "4" } + + +--- +"field collapsing and scroll": + + - do: + catch: /cannot use \`collapse\` in a scroll context/ + search: + rest_total_hits_as_int: true + index: test + scroll: 1s + body: + collapse: { field: numeric_group } + +--- +"field collapsing and search_after": + + - do: + catch: /cannot use \`collapse\` in conjunction with \`search_after\`/ + search: + rest_total_hits_as_int: true + index: test + body: + collapse: { field: numeric_group } + search_after: [6] + sort: [{ sort: desc }] + +--- +"field collapsing and rescore": + + - do: + catch: /cannot use \`collapse\` in conjunction with \`rescore\`/ + search: + rest_total_hits_as_int: true + index: test + body: + collapse: { field: numeric_group } + rescore: + window_size: 20 + query: + rescore_query: + match_all: {} + query_weight: 1 + rescore_query_weight: 2 + +--- +"no hits and inner_hits": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + size: 0 + collapse: { field: numeric_group, inner_hits: { name: sub_hits, size: 1} } + sort: [{ sort: desc }] + + - match: { hits.total: 6 } + - length: { hits.hits: 0 } + +--- +"no hits and inner_hits max_score null": + + - skip: + version: " - 6.99.99" + reason: max_score was set to 0 rather than null before 7.0 + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + size: 0 + collapse: { field: numeric_group, inner_hits: { name: sub_hits, size: 1} } + sort: [{ sort: desc }] + + - match: { hits.max_score: null } + +--- +"field collapsing and multiple inner_hits": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + collapse: + field: numeric_group + inner_hits: + - { name: sub_hits_asc, size: 2, sort: [{ sort: asc }] } + - { name: sub_hits_desc, size: 1, sort: [{ sort: desc }] } + sort: [{ sort: desc }] + + - match: { hits.total: 6 } + - length: { hits.hits: 3 } + - match: { hits.hits.0._index: test } + - match: { hits.hits.0._type: _doc } + - match: { hits.hits.0.fields.numeric_group: [3] } + - match: { hits.hits.0.sort: [36] } + - match: { hits.hits.0._id: "6" } + - match: { hits.hits.0.inner_hits.sub_hits_asc.hits.total: 1 } + - length: { hits.hits.0.inner_hits.sub_hits_asc.hits.hits: 1 } + - match: { hits.hits.0.inner_hits.sub_hits_asc.hits.hits.0._id: "6" } + - match: { hits.hits.0.inner_hits.sub_hits_desc.hits.total: 1 } + - length: { hits.hits.0.inner_hits.sub_hits_desc.hits.hits: 1 } + - match: { hits.hits.0.inner_hits.sub_hits_desc.hits.hits.0._id: "6" } + - match: { hits.hits.1._index: test } + - match: { hits.hits.1._type: _doc } + - match: { hits.hits.1.fields.numeric_group: [1] } + - match: { hits.hits.1.sort: [24] } + - match: { hits.hits.1._id: "3" } + - match: { hits.hits.1.inner_hits.sub_hits_asc.hits.total: 3 } + - length: { hits.hits.1.inner_hits.sub_hits_asc.hits.hits: 2 } + - match: { hits.hits.1.inner_hits.sub_hits_asc.hits.hits.0._id: "2" } + - match: { hits.hits.1.inner_hits.sub_hits_asc.hits.hits.1._id: "1" } + - match: { hits.hits.1.inner_hits.sub_hits_desc.hits.total: 3 } + - length: { hits.hits.1.inner_hits.sub_hits_desc.hits.hits: 1 } + - match: { hits.hits.1.inner_hits.sub_hits_desc.hits.hits.0._id: "3" } + - match: { hits.hits.2._index: test } + - match: { hits.hits.2._type: _doc } + - match: { hits.hits.2.fields.numeric_group: [25] } + - match: { hits.hits.2.sort: [10] } + - match: { hits.hits.2._id: "4" } + - match: { hits.hits.2.inner_hits.sub_hits_asc.hits.total: 2 } + - length: { hits.hits.2.inner_hits.sub_hits_asc.hits.hits: 2 } + - match: { hits.hits.2.inner_hits.sub_hits_asc.hits.hits.0._id: "5" } + - match: { hits.hits.2.inner_hits.sub_hits_asc.hits.hits.1._id: "4" } + - match: { hits.hits.2.inner_hits.sub_hits_desc.hits.total: 2 } + - length: { hits.hits.2.inner_hits.sub_hits_desc.hits.hits: 1 } + - match: { hits.hits.2.inner_hits.sub_hits_desc.hits.hits.0._id: "4" } + +--- +"field collapsing, inner_hits and version": + + - skip: + version: " - 6.1.0" + reason: "bug fixed in 6.1.1" + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + collapse: { field: numeric_group, inner_hits: { name: sub_hits, version: true, size: 2, sort: [{ sort: asc }] } } + sort: [{ sort: desc }] + version: true + + - match: { hits.total: 6 } + - length: { hits.hits: 3 } + - match: { hits.hits.0._index: test } + - match: { hits.hits.0._type: _doc } + - match: { hits.hits.0.fields.numeric_group: [3] } + - match: { hits.hits.0.sort: [36] } + - match: { hits.hits.0._id: "6" } + - match: { hits.hits.0._version: 66 } + - match: { hits.hits.0.inner_hits.sub_hits.hits.total: 1 } + - length: { hits.hits.0.inner_hits.sub_hits.hits.hits: 1 } + - match: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._id: "6" } + - match: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._version: 66 } + - match: { hits.hits.1._index: test } + - match: { hits.hits.1._type: _doc } + - match: { hits.hits.1.fields.numeric_group: [1] } + - match: { hits.hits.1.sort: [24] } + - match: { hits.hits.1._id: "3" } + - match: { hits.hits.1._version: 33 } + - match: { hits.hits.1.inner_hits.sub_hits.hits.total: 3 } + - length: { hits.hits.1.inner_hits.sub_hits.hits.hits: 2 } + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._id: "2" } + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._version: 22 } + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._id: "1" } + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._version: 11 } + - match: { hits.hits.2._index: test } + - match: { hits.hits.2._type: _doc } + - match: { hits.hits.2.fields.numeric_group: [25] } + - match: { hits.hits.2.sort: [10] } + - match: { hits.hits.2._id: "4" } + - match: { hits.hits.2._version: 44 } + - match: { hits.hits.2.inner_hits.sub_hits.hits.total: 2 } + - length: { hits.hits.2.inner_hits.sub_hits.hits.hits: 2 } + - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._id: "5" } + - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._version: 55 } + - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._id: "4" } + - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._version: 44 } + +--- +"field collapsing on a field alias": + - skip: + version: " - 7.5.1" + reason: the bug fix was introduced in 7.5.2 + - do: + indices.create: + index: alias-test + body: + mappings: + properties: + numeric_group: { type: alias, path: other_numeric_group } + other_numeric_group: { type: integer } + - do: + index: + index: alias-test + id: 1 + body: { other_numeric_group: 1, sort: 6 } + - do: + index: + index: alias-test + id: 2 + body: { other_numeric_group: 25, sort: 10 } + - do: + indices.refresh: + index: alias-test + + - do: + search: + rest_total_hits_as_int: true + index: [alias-test, test] + body: + collapse: { field: numeric_group, inner_hits: { name: sub_hits } } + sort: [{ sort: desc }] + + - match: { hits.total: 8 } + - length: { hits.hits: 3 } + + - match: { hits.hits.0.fields.numeric_group: [3] } + - match: { hits.hits.0.inner_hits.sub_hits.hits.total: 1} + - match: { hits.hits.1.fields.numeric_group: [1] } + - match: { hits.hits.1.inner_hits.sub_hits.hits.total: 4} + - match: { hits.hits.2.fields.numeric_group: [25] } + - match: { hits.hits.2.inner_hits.sub_hits.hits.total: 3} + +--- +"field collapsing, inner_hits and seq_no": + + - skip: + version: " - 6.99.0" + reason: "sequence numbers introduced in 7.0.0" + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + collapse: { field: numeric_group, inner_hits: { + name: sub_hits, seq_no_primary_term: true, size: 2, sort: [{ sort: asc }] + } } + sort: [{ sort: desc }] + + - match: { hits.total: 6 } + - length: { hits.hits: 3 } + - match: { hits.hits.0._index: test } + - match: { hits.hits.0.fields.numeric_group: [3] } + - match: { hits.hits.0.sort: [36] } + - match: { hits.hits.0._id: "6" } + - match: { hits.hits.0.inner_hits.sub_hits.hits.total: 1 } + - length: { hits.hits.0.inner_hits.sub_hits.hits.hits: 1 } + - match: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._id: "6" } + - gte: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._seq_no: 0 } + - gte: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._primary_term: 1 } + - match: { hits.hits.1._index: test } + - match: { hits.hits.1.fields.numeric_group: [1] } + - match: { hits.hits.1.sort: [24] } + - match: { hits.hits.1._id: "3" } + - match: { hits.hits.1.inner_hits.sub_hits.hits.total: 3 } + - length: { hits.hits.1.inner_hits.sub_hits.hits.hits: 2 } + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._id: "2" } + - gte: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._seq_no: 0 } + - gte: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._primary_term: 1 } + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._id: "1" } + - gte: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._seq_no: 0 } + - gte: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._primary_term: 1 } + - match: { hits.hits.2._index: test } + - match: { hits.hits.2._type: _doc } + - match: { hits.hits.2.fields.numeric_group: [25] } + - match: { hits.hits.2.sort: [10] } + - match: { hits.hits.2._id: "4" } + - match: { hits.hits.2.inner_hits.sub_hits.hits.total: 2 } + - length: { hits.hits.2.inner_hits.sub_hits.hits.hits: 2 } + - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._id: "5" } + - gte: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._seq_no: 0 } + - gte: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._primary_term: 1 } + - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._id: "4" } + - gte: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._seq_no: 0 } + - gte: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._primary_term: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/115_multiple_field_collapsing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/115_multiple_field_collapsing.yml new file mode 100644 index 0000000000000..b10401f48dbce --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/115_multiple_field_collapsing.yml @@ -0,0 +1,144 @@ +--- +"two levels fields collapsing": + - skip: + version: " - 6.99.99" + reason: using multiple field collapsing from 7.0 on + - do: + indices.create: + index: addresses + body: + settings: + number_of_shards: 1 + number_of_replicas: 1 + mappings: + properties: + country: {"type": "keyword"} + city: {"type": "keyword"} + address: {"type": "text"} + + - do: + bulk: + refresh: true + body: + - '{ "index" : { "_index" : "addresses", "_id" : "1" } }' + - '{"country" : "Canada", "city" : "Saskatoon", "address" : "701 Victoria Avenue" }' + - '{ "index" : { "_index" : "addresses", "_id" : "2" } }' + - '{"country" : "Canada", "city" : "Toronto", "address" : "74 Victoria Street, Suite, 74 Victoria Street, Suite 300" }' + - '{ "index" : { "_index" : "addresses", "_id" : "3" } }' + - '{"country" : "Canada", "city" : "Toronto", "address" : "350 Victoria St" }' + - '{ "index" : { "_index" : "addresses", "_id" : "4" } }' + - '{"country" : "Canada", "city" : "Toronto", "address" : "20 Victoria Street" }' + - '{ "index" : { "_index" : "addresses", "_id" : "5" } }' + - '{"country" : "UK", "city" : "London", "address" : "58 Victoria Street" }' + - '{ "index" : { "_index" : "addresses", "_id" : "6" } }' + - '{"country" : "UK", "city" : "London", "address" : "Victoria Street Victoria Palace Theatre" }' + - '{ "index" : { "_index" : "addresses", "_id" : "7" } }' + - '{"country" : "UK", "city" : "Manchester", "address" : "75 Victoria street Westminster" }' + - '{ "index" : { "_index" : "addresses", "_id" : "8" } }' + - '{"country" : "UK", "city" : "London", "address" : "Victoria Station Victoria Arcade" }' + + + # ************* error if internal collapse contains inner_hits + - do: + catch: /parse_exception/ + search: + rest_total_hits_as_int: true + index: addresses + body: + query: { "match" : { "address" : "victoria" }} + collapse: + field: country + inner_hits: + collapse: + field : city + inner_hits: {} + + + # ************* error if internal collapse contains another collapse + - do: + catch: /parse_exception/ + search: + rest_total_hits_as_int: true + index: addresses + body: + query: { "match" : { "address" : "victoria" }} + collapse: + field: country + inner_hits: + collapse: + field : city + collapse: { field: city } + + + + # ************* top scored + - do: + search: + rest_total_hits_as_int: true + index: addresses + body: + query: { "match" : { "address" : "victoria" }} + collapse: + field: country + inner_hits: + name: by_location + size: 3 + collapse: + field : city + + - match: { hits.total: 8 } + - length: { hits.hits: 2 } + - match: { hits.hits.0.fields.country: ["UK"] } + - match: { hits.hits.0.inner_hits.by_location.hits.total: 4 } + # 2 inner hits returned instead of requested 3 as they are collapsed by city + - length: { hits.hits.0.inner_hits.by_location.hits.hits : 2} + - match: { hits.hits.0.inner_hits.by_location.hits.hits.0._id: "8" } + - match: { hits.hits.0.inner_hits.by_location.hits.hits.0.fields.city: ["London"] } + - match: { hits.hits.0.inner_hits.by_location.hits.hits.1._id: "7" } + - match: { hits.hits.0.inner_hits.by_location.hits.hits.1.fields.city: ["Manchester"] } + + - match: { hits.hits.1.fields.country: ["Canada"] } + - match: { hits.hits.1.inner_hits.by_location.hits.total: 4 } + # 2 inner hits returned instead of requested 3 as they are collapsed by city + - length: { hits.hits.1.inner_hits.by_location.hits.hits : 2 } + - match: { hits.hits.1.inner_hits.by_location.hits.hits.0._id: "1" } + - match: { hits.hits.1.inner_hits.by_location.hits.hits.0.fields.city: ["Saskatoon"] } + - match: { hits.hits.1.inner_hits.by_location.hits.hits.1._id: "3" } + - match: { hits.hits.1.inner_hits.by_location.hits.hits.1.fields.city: ["Toronto"] } + + + # ************* sorted + - do: + search: + rest_total_hits_as_int: true + index: addresses + body: + query: { "match" : { "address" : "victoria" }} + collapse: + field: country + inner_hits: + name: by_location + size: 3 + sort: [{ "city": "desc" }] + collapse: + field : city + + - match: { hits.total: 8 } + - length: { hits.hits: 2 } + - match: { hits.hits.0.fields.country: ["UK"] } + - match: { hits.hits.0.inner_hits.by_location.hits.total: 4 } + # 2 inner hits returned instead of requested 3 as they are collapsed by city + - length: { hits.hits.0.inner_hits.by_location.hits.hits : 2} + - match: { hits.hits.0.inner_hits.by_location.hits.hits.0._id: "7" } + - match: { hits.hits.0.inner_hits.by_location.hits.hits.0.fields.city: ["Manchester"] } + - match: { hits.hits.0.inner_hits.by_location.hits.hits.1._id: "5" } + - match: { hits.hits.0.inner_hits.by_location.hits.hits.1.fields.city: ["London"] } + + - match: { hits.hits.1.fields.country: ["Canada"] } + - match: { hits.hits.1.inner_hits.by_location.hits.total: 4 } + # 2 inner hits returned instead of requested 3 as they are collapsed by city + - length: { hits.hits.1.inner_hits.by_location.hits.hits : 2 } + - match: { hits.hits.1.inner_hits.by_location.hits.hits.0._id: "2" } + - match: { hits.hits.1.inner_hits.by_location.hits.hits.0.fields.city: ["Toronto"] } + - match: { hits.hits.1.inner_hits.by_location.hits.hits.1._id: "1" } + - match: { hits.hits.1.inner_hits.by_location.hits.hits.1.fields.city: ["Saskatoon"] } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/120_batch_reduce_size.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/120_batch_reduce_size.yml new file mode 100644 index 0000000000000..9c23899fc12dc --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/120_batch_reduce_size.yml @@ -0,0 +1,60 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_shards: 5 + number_of_replicas: 0 + mappings: + properties: + str: + type: keyword + +--- +"batched_reduce_size lower limit": + - do: + catch: /batchedReduceSize must be >= 2/ + search: + rest_total_hits_as_int: true + index: test_1 + batched_reduce_size: 1 + + +--- +"batched_reduce_size 2 with 5 shards": + - do: + index: + index: test_1 + id: 1 + body: { "str" : "abc" } + + - do: + index: + index: test_1 + id: 2 + body: { "str": "abc" } + + - do: + index: + index: test_1 + id: 3 + body: { "str": "bcd" } + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + batched_reduce_size: 2 + body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str" } } } } + + - match: { num_reduce_phases: 4 } + - match: { hits.total: 3 } + - length: { aggregations.str_terms.buckets: 2 } + - match: { aggregations.str_terms.buckets.0.key: "abc" } + - is_false: aggregations.str_terms.buckets.0.key_as_string + - match: { aggregations.str_terms.buckets.0.doc_count: 2 } + - match: { aggregations.str_terms.buckets.1.key: "bcd" } + - is_false: aggregations.str_terms.buckets.1.key_as_string + - match: { aggregations.str_terms.buckets.1.doc_count: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/140_pre_filter_search_shards.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/140_pre_filter_search_shards.yml new file mode 100644 index 0000000000000..31f6f35003e2d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/140_pre_filter_search_shards.yml @@ -0,0 +1,157 @@ +setup: + - do: + indices.create: + index: index_1 + body: + settings: + number_of_shards: 1 + mappings: + properties: + created_at: + type: date + format: "strict_date" + - do: + indices.create: + index: index_2 + body: + settings: + number_of_shards: 1 + mappings: + properties: + created_at: + type: date + format: "strict_date" + + - do: + indices.create: + index: index_3 + body: + settings: + number_of_shards: 1 + mappings: + properties: + created_at: + type: date + format: "strict_date" + + +--- +"pre_filter_shard_size with invalid parameter": + - do: + catch: /preFilterShardSize must be >= 1/ + search: + rest_total_hits_as_int: true + index: test_1 + pre_filter_shard_size: 0 + +--- +"pre_filter_shard_size with shards that have no hit": + - do: + index: + index: index_1 + id: 1 + body: { "created_at": "2016-01-01"} + - do: + index: + index: index_2 + id: 2 + body: { "created_at": "2017-01-01" } + + - do: + index: + index: index_3 + id: 3 + body: { "created_at": "2018-01-01" } + - do: + indices.refresh: {} + + + - do: + search: + rest_total_hits_as_int: true + body: { "size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2016-02-01", "lt": "2018-02-01"} } } } + + - match: { _shards.total: 3 } + - match: { _shards.successful: 3 } + - match: { _shards.skipped: 0 } + - match: { _shards.failed: 0 } + - match: { hits.total: 2 } + + # this is the case where we have an empty body and don't skip anything since it's match_all + - do: + search: + rest_total_hits_as_int: true + pre_filter_shard_size: 1 + + - match: { _shards.total: 3 } + - match: { _shards.successful: 3 } + - match: { _shards.skipped: 0 } + - match: { _shards.failed: 0 } + - match: { hits.total: 3 } + + # this is a case where we can actually skip due to rewrite + - do: + search: + rest_total_hits_as_int: true + pre_filter_shard_size: 1 + body: { "size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2016-02-01", "lt": "2018-02-01"} } } } + + - match: { _shards.total: 3 } + - match: { _shards.successful: 3 } + - match: { _shards.skipped : 1} + - match: { _shards.failed: 0 } + - match: { hits.total: 2 } + + # this case we skip all except of one since we need a real result + - do: + search: + rest_total_hits_as_int: true + pre_filter_shard_size: 1 + body: { "size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2019-02-01", "lt": "2020-02-01"} } } } + + - match: { _shards.total: 3 } + - match: { _shards.successful: 3 } + # skip 2 and execute one to fetch the actual empty result + - match: { _shards.skipped : 2} + - match: { _shards.failed: 0 } + - match: { hits.total: 0 } + + - do: + search: + rest_total_hits_as_int: true + pre_filter_shard_size: 1 + body: {"size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2016-02-01", "lt": "2018-02-01"} } }, "aggs" : { "some_agg" : { "global" : {} }}} + + - match: { _shards.total: 3 } + - match: { _shards.successful: 3 } + - match: { _shards.skipped : 0 } + - match: { _shards.failed: 0 } + - match: { hits.total: 2 } + - match: { aggregations.some_agg.doc_count: 3 } + + - do: + search: + rest_total_hits_as_int: true + pre_filter_shard_size: 1 + body: { "size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2016-02-01", "lt": "2018-02-01"}}}, "aggs" : { "idx_terms" : { "terms" : { "field" : "_index", "min_doc_count" : 0 } } } } + + - match: { _shards.total: 3 } + - match: { _shards.successful: 3 } + - match: { _shards.skipped : 0 } + - match: { _shards.failed: 0 } + - match: { hits.total: 2 } + - length: { aggregations.idx_terms.buckets: 3 } + + - do: + search: + rest_total_hits_as_int: true + pre_filter_shard_size: 1 + body: { "size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2016-02-01", "lt": "2018-02-01"}}}, "aggs" : { "idx_terms" : { "terms" : { "field" : "_index" } } } } + + - match: { _shards.total: 3 } + - match: { _shards.successful: 3 } + - match: { _shards.skipped : 1 } + - match: { _shards.failed: 0 } + - match: { hits.total: 2 } + - length: { aggregations.idx_terms.buckets: 2 } + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/150_rewrite_on_coordinator.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/150_rewrite_on_coordinator.yml new file mode 100644 index 0000000000000..be34e10ddcd74 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/150_rewrite_on_coordinator.yml @@ -0,0 +1,78 @@ +"Ensure that we fetch the document only once": + - skip: + features: allowed_warnings + - do: + indices.create: + index: search_index + body: + settings: + number_of_shards: 5 + mappings: + properties: + user: + type: keyword + - do: + index: + index: search_index + id: 1 + body: { "user": "1" } + + - do: + index: + index: search_index + id: 2 + body: { "user": "2" } + + - do: + index: + index: search_index + id: 3 + body: { "user": "3" } + + - do: + indices.refresh: {} + + - do: + allowed_warnings: + - "Deprecated field [type] used, this field is unused and will be removed entirely" + catch: /no such index/ + search: + rest_total_hits_as_int: true + index: "search_index" + body: { "size" : 0, "query" : { "terms" : { "user" : { "index": "lookup_index", "type" : "_doc", "id": "1", "path": "followers"} } } } + - do: + indices.create: + index: lookup_index + body: + settings: + number_of_shards: 1 + mappings: + properties: + followers: + type: keyword + - do: + index: + index: lookup_index + id: 1 + body: { "followers" : ["1", "3"] } + - do: + indices.refresh: {} + + - do: + allowed_warnings: + - "Deprecated field [type] used, this field is unused and will be removed entirely" + search: + rest_total_hits_as_int: true + index: "search_index" + body: { "size" : 0, "query" : { "terms" : { "user" : { "index": "lookup_index", "type" : "_doc", "id": "1", "path": "followers"} } } } + + - match: { _shards.total: 5 } + - match: { _shards.successful: 5 } + - match: { _shards.skipped: 0 } + - match: { _shards.failed: 0 } + - match: { hits.total: 2 } + + - do: + indices.stats: { index: 'lookup_index', "metric": "get"} + + - match: { indices.lookup_index.total.get.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/160_exists_query.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/160_exists_query.yml new file mode 100644 index 0000000000000..d94e86bb6c565 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/160_exists_query.yml @@ -0,0 +1,1336 @@ +setup: + - skip: + features: ["headers"] + + - do: + indices.create: + index: test + body: + mappings: + dynamic: false + properties: + binary: + type: binary + doc_values: true + boolean: + type: boolean + date: + type: date + geo_point: + type: geo_point + geo_shape: + type: geo_shape + ip: + type: ip + keyword: + type: keyword + byte: + type: byte + double: + type: double + float: + type: float + half_float: + type: half_float + integer: + type: integer + long: + type: long + short: + type: short + object: + type: object + properties: + inner1: + type: keyword + inner2: + type: keyword + text: + type: text + + - do: + headers: + Content-Type: application/json + index: + index: "test" + id: 1 + body: + binary: "YWJjZGUxMjM0" + boolean: true + date: "2017-01-01" + geo_point: [0.0, 20.0] + geo_shape: + type: "point" + coordinates: [0.0, 20.0] + ip: "192.168.0.1" + keyword: "foo" + byte: 1 + double: 1.0 + float: 1.0 + half_float: 1.0 + integer: 1 + long: 1 + short: 1 + object: + inner1: "foo" + inner2: "bar" + text: "foo bar" + + - do: + headers: + Content-Type: application/json + index: + index: "test" + id: 2 + body: + binary: "YWJjZGUxMjM0" + boolean: false + date: "2017-01-01" + geo_point: [0.0, 20.0] + geo_shape: + type: "point" + coordinates: [0.0, 20.0] + ip: "192.168.0.1" + keyword: "foo" + byte: 1 + double: 1.0 + float: 1.0 + half_float: 1.0 + integer: 1 + long: 1 + short: 1 + object: + inner1: "foo" + text: "foo bar" + + - do: + headers: + Content-Type: application/json + index: + index: "test" + id: 3 + routing: "route_me" + body: + binary: "YWJjZGUxMjM0" + boolean: true + date: "2017-01-01" + geo_point: [0.0, 20.0] + geo_shape: + type: "point" + coordinates: [0.0, 20.0] + ip: "192.168.0.1" + keyword: "foo" + byte: 1 + double: 1.0 + float: 1.0 + half_float: 1.0 + integer: 1 + long: 1 + short: 1 + object: + inner2: "bar" + text: "foo bar" + + - do: + index: + index: "test" + id: 4 + body: {} + + - do: + indices.create: + index: test-no-dv + body: + mappings: + dynamic: false + properties: + binary: + type: binary + doc_values: false + store: true + boolean: + type: boolean + doc_values: false + date: + type: date + doc_values: false + geo_point: + type: geo_point + doc_values: false + geo_shape: + type: geo_shape + ip: + type: ip + doc_values: false + keyword: + type: keyword + doc_values: false + byte: + type: byte + doc_values: false + double: + type: double + doc_values: false + float: + type: float + doc_values: false + half_float: + type: half_float + doc_values: false + integer: + type: integer + doc_values: false + long: + type: long + doc_values: false + short: + type: short + doc_values: false + object: + type: object + properties: + inner1: + type: keyword + doc_values: false + inner2: + type: keyword + doc_values: false + text: + type: text + doc_values: false + + - do: + headers: + Content-Type: application/json + index: + index: "test-no-dv" + id: 1 + body: + binary: "YWJjZGUxMjM0" + boolean: true + date: "2017-01-01" + geo_point: [0.0, 20.0] + geo_shape: + type: "point" + coordinates: [0.0, 20.0] + ip: "192.168.0.1" + keyword: "foo" + byte: 1 + double: 1.0 + float: 1.0 + half_float: 1.0 + integer: 1 + long: 1 + short: 1 + object: + inner1: "foo" + inner2: "bar" + text: "foo bar" + + - do: + headers: + Content-Type: application/json + index: + index: "test-no-dv" + id: 2 + body: + binary: "YWJjZGUxMjM0" + boolean: false + date: "2017-01-01" + geo_point: [0.0, 20.0] + geo_shape: + type: "point" + coordinates: [0.0, 20.0] + ip: "192.168.0.1" + keyword: "foo" + byte: 1 + double: 1.0 + float: 1.0 + half_float: 1.0 + integer: 1 + long: 1 + short: 1 + object: + inner1: "foo" + text: "foo bar" + + - do: + headers: + Content-Type: application/json + index: + index: "test-no-dv" + id: 3 + routing: "route_me" + body: + binary: "YWJjZGUxMjM0" + boolean: true + date: "2017-01-01" + geo_point: [0.0, 20.0] + geo_shape: + type: "point" + coordinates: [0.0, 20.0] + ip: "192.168.0.1" + keyword: "foo" + byte: 1 + double: 1.0 + float: 1.0 + half_float: 1.0 + integer: 1 + long: 1 + short: 1 + object: + inner2: "bar" + text: "foo bar" + + - do: + index: + index: "test-no-dv" + id: 4 + body: {} + + - do: + indices.create: + index: test-unmapped + body: + mappings: + dynamic: false + properties: + unrelated: + type: keyword + + - do: + index: + index: "test-unmapped" + id: 1 + body: + unrelated: "foo" + + - do: + indices.create: + index: test-empty + body: + mappings: + dynamic: false + properties: + binary: + type: binary + date: + type: date + geo_point: + type: geo_point + geo_shape: + type: geo_shape + ip: + type: ip + keyword: + type: keyword + byte: + type: byte + double: + type: double + float: + type: float + half_float: + type: half_float + integer: + type: integer + long: + type: long + short: + type: short + object: + type: object + properties: + inner1: + type: keyword + inner2: + type: keyword + text: + type: text + + - do: + indices.refresh: + index: [test, test-unmapped, test-empty, test-no-dv] + +--- +"Test exists query on mapped binary field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: binary + + - match: {hits.total: 3} + +--- +"Test exists query on mapped boolean field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: boolean + + - match: {hits.total: 3} + +--- +"Test exists query on mapped date field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: date + + - match: {hits.total: 3} + +--- +"Test exists query on mapped geo_point field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: geo_point + + - match: {hits.total: 3} + +--- +"Test exists query on mapped geo_shape field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: geo_shape + + - match: {hits.total: 3} + +--- +"Test exists query on mapped ip field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: ip + + - match: {hits.total: 3} + +--- +"Test exists query on mapped keyword field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: keyword + + - match: {hits.total: 3} + +--- +"Test exists query on mapped byte field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: byte + + - match: {hits.total: 3} + +--- +"Test exists query on mapped double field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: double + + - match: {hits.total: 3} + +--- +"Test exists query on mapped float field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: float + + - match: {hits.total: 3} + +--- +"Test exists query on mapped half_float field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: half_float + + - match: {hits.total: 3} + +--- +"Test exists query on mapped integer field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: integer + + - match: {hits.total: 3} + +--- +"Test exists query on mapped long field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: long + + - match: {hits.total: 3} + +--- +"Test exists query on mapped short field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: short + + - match: {hits.total: 3} + +--- +"Test exists query on mapped object field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: object + + - match: {hits.total: 3} + +--- +"Test exists query on mapped object inner field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: object.inner1 + + - match: {hits.total: 2} + +--- +"Test exists query on mapped text field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: text + + - match: {hits.total: 3} + +--- +"Test exists query on _id field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: _id + + - match: {hits.total: 4} + +--- +"Test exists query on _index field": + - skip: + version: " - 6.0.99" + reason: exists on _index not supported prior to 6.1.0 + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: _index + + - match: {hits.total: 4} + +--- +"Test exists query on _type field": + - skip: + version: " - 6.0.99" + reason: exists on _type not supported prior to 6.1.0 + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: _type + + - match: {hits.total: 4} + +--- +"Test exists query on _routing field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: _routing + + - match: {hits.total: 1} + +--- +"Test exists query on _seq_no field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: _seq_no + + - match: {hits.total: 4} + +--- +"Test exists query on _source field": + - skip: + version: " - 6.0.99" + reason: exists on _source not supported prior to 6.1.0 + - do: + catch: /query_shard_exception/ + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: _source + +--- +"Test exists query on _version field": + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + exists: + field: _version + + - match: {hits.total: 4} + +--- +"Test exists query on unmapped binary field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: binary + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped boolean field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: boolean + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped date field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: date + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped geo_point field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: geo_point + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped geo_shape field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: geo_shape + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped ip field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: ip + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped keyword field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: keyword + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped byte field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: byte + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped double field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: double + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped float field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: float + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped half_float field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: half_float + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped integer field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: integer + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped long field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: long + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped short field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: short + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped object field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: object + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped object inner field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: object.inner1 + + - match: {hits.total: 0} + +--- +"Test exists query on unmapped text field": + - do: + search: + rest_total_hits_as_int: true + index: test-unmapped + body: + query: + exists: + field: text + + - match: {hits.total: 0} + +--- +"Test exists query on binary field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: binary + + - match: {hits.total: 0} + +--- +"Test exists query on boolean field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: boolean + + - match: {hits.total: 0} + +--- +"Test exists query on date field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: date + + - match: {hits.total: 0} + +--- +"Test exists query on geo_point field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: geo_point + + - match: {hits.total: 0} + +--- +"Test exists query on geo_shape field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: geo_shape + + - match: {hits.total: 0} + +--- +"Test exists query on ip field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: ip + + - match: {hits.total: 0} + +--- +"Test exists query on keyword field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: keyword + + - match: {hits.total: 0} + +--- +"Test exists query on byte field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: byte + + - match: {hits.total: 0} + +--- +"Test exists query on double field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: double + + - match: {hits.total: 0} + +--- +"Test exists query on float field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: float + + - match: {hits.total: 0} + +--- +"Test exists query on half_float field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: half_float + + - match: {hits.total: 0} + +--- +"Test exists query on integer field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: integer + + - match: {hits.total: 0} + +--- +"Test exists query on long field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: long + + - match: {hits.total: 0} + +--- +"Test exists query on short field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: short + + - match: {hits.total: 0} + +--- +"Test exists query on object field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: object + + - match: {hits.total: 0} + +--- +"Test exists query on object inner field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: object.inner1 + + - match: {hits.total: 0} + +--- +"Test exists query on text field in empty index": + - do: + search: + rest_total_hits_as_int: true + index: test-empty + body: + query: + exists: + field: text + + - match: {hits.total: 0} + +--- +"Test exists query on mapped binary field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: binary + + - match: {hits.total: 3} + +--- +"Test exists query on mapped boolean field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: boolean + + - match: {hits.total: 3} + +--- +"Test exists query on mapped date field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: date + + - match: {hits.total: 3} + +--- +"Test exists query on mapped geo_point field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: geo_point + + - match: {hits.total: 3} + +--- +"Test exists query on mapped geo_shape field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: geo_shape + + - match: {hits.total: 3} + +--- +"Test exists query on mapped ip field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: ip + + - match: {hits.total: 3} + +--- +"Test exists query on mapped keyword field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: keyword + + - match: {hits.total: 3} + +--- +"Test exists query on mapped byte field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: byte + + - match: {hits.total: 3} + +--- +"Test exists query on mapped double field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: double + + - match: {hits.total: 3} + +--- +"Test exists query on mapped float field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: float + + - match: {hits.total: 3} + +--- +"Test exists query on mapped half_float field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: half_float + + - match: {hits.total: 3} + +--- +"Test exists query on mapped integer field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: integer + + - match: {hits.total: 3} + +--- +"Test exists query on mapped long field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: long + + - match: {hits.total: 3} + +--- +"Test exists query on mapped short field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: short + + - match: {hits.total: 3} + +--- +"Test exists query on mapped object field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: object + + - match: {hits.total: 3} + +--- +"Test exists query on mapped object inner field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: object.inner1 + + - match: {hits.total: 2} + +--- +"Test exists query on mapped text field with no doc values": + - do: + search: + rest_total_hits_as_int: true + index: test-no-dv + body: + query: + exists: + field: text + + - match: {hits.total: 3} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/170_terms_query.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/170_terms_query.yml new file mode 100644 index 0000000000000..89ea24618c68f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/170_terms_query.yml @@ -0,0 +1,58 @@ +--- +"Terms Query with No.of terms exceeding index.max_terms_count should FAIL": + - skip: + version: " - 6.99.99" + reason: index.max_terms_count setting has been added in 7.0.0 + - do: + indices.create: + index: test_index + body: + settings: + number_of_shards: 1 + index.max_terms_count: 2 + mappings: + properties: + user: + type: keyword + followers: + type: keyword + - do: + bulk: + refresh: true + body: + - '{"index": {"_index": "test_index", "_id": "u1"}}' + - '{"user": "u1", "followers": ["u2", "u3"]}' + - '{"index": {"_index": "test_index", "_id": "u2"}}' + - '{"user": "u2", "followers": ["u1", "u3", "u4"]}' + - '{"index": {"_index": "test_index", "_id": "u3"}}' + - '{"user": "u3", "followers": ["u1"]}' + - '{"index": {"_index": "test_index", "_id": "u4"}}' + - '{"user": "u4", "followers": ["u3"]}' + + - do: + search: + rest_total_hits_as_int: true + index: test_index + body: {"query" : {"terms" : {"user" : ["u1", "u2"]}}} + - match: { hits.total: 2 } + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + index: test_index + body: {"query" : {"terms" : {"user" : ["u1", "u2", "u3"]}}} + + - do: + search: + rest_total_hits_as_int: true + index: test_index + body: {"query" : {"terms" : {"user" : {"index" : "test_index", "id" : "u1", "path" : "followers"}}}} + - match: { hits.total: 2 } + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + index: test_index + body: {"query" : {"terms" : {"user" : {"index" : "test_index", "id" : "u2", "path" : "followers"}}}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/171_terms_query_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/171_terms_query_with_types.yml new file mode 100644 index 0000000000000..d3d48eae4082d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/171_terms_query_with_types.yml @@ -0,0 +1,63 @@ +--- +"Terms Query with No.of terms exceeding index.max_terms_count should FAIL": + - skip: + version: " - 6.99.99" + reason: index.max_terms_count setting has been added in 7.0.0 + features: allowed_warnings + - do: + indices.create: + include_type_name: true + index: test_index + body: + settings: + number_of_shards: 1 + index.max_terms_count: 2 + mappings: + test_type: + properties: + user: + type: keyword + followers: + type: keyword + - do: + bulk: + refresh: true + body: + - '{"index": {"_index": "test_index", "_type": "test_type", "_id": "u1"}}' + - '{"user": "u1", "followers": ["u2", "u3"]}' + - '{"index": {"_index": "test_index", "_type": "test_type", "_id": "u2"}}' + - '{"user": "u2", "followers": ["u1", "u3", "u4"]}' + - '{"index": {"_index": "test_index", "_type": "test_type", "_id": "u3"}}' + - '{"user": "u3", "followers": ["u1"]}' + - '{"index": {"_index": "test_index", "_type": "test_type", "_id": "u4"}}' + - '{"user": "u4", "followers": ["u3"]}' + + - do: + search: + rest_total_hits_as_int: true + index: test_index + body: {"query" : {"terms" : {"user" : ["u1", "u2"]}}} + - match: { hits.total: 2 } + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + index: test_index + body: {"query" : {"terms" : {"user" : ["u1", "u2", "u3"]}}} + + - do: + allowed_warnings: + - "Deprecated field [type] used, this field is unused and will be removed entirely" + search: + rest_total_hits_as_int: true + index: test_index + body: {"query" : {"terms" : {"user" : {"index" : "test_index", "type" : "test_type", "id" : "u1", "path" : "followers"}}}} + - match: { hits.total: 2 } + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + index: test_index + body: {"query" : {"terms" : {"user" : {"index" : "test_index", "type" : "test_type", "id" : "u2", "path" : "followers"}}}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml new file mode 100644 index 0000000000000..29237dcee48e0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml @@ -0,0 +1,41 @@ +--- +"Test Index and Search locale dependent mappings / dates": + + - skip: + version: "all" + reason: "Awaits fix: https://github.com/elastic/elasticsearch/issues/49719" + + - do: + indices.create: + index: test_index + body: + settings: + number_of_shards: 1 + mappings: + properties: + date_field: + type: date + format: "8E, d MMM uuuu HH:mm:ss Z" + locale: "de" + - do: + bulk: + refresh: true + body: + - '{"index": {"_index": "test_index", "_id": "1"}}' + - '{"date_field": "Mi, 06 Dez 2000 02:55:00 -0800"}' + - '{"index": {"_index": "test_index", "_id": "2"}}' + - '{"date_field": "Do, 07 Dez 2000 02:55:00 -0800"}' + + - do: + search: + rest_total_hits_as_int: true + index: test_index + body: {"query" : {"range" : {"date_field" : {"gte": "Di, 05 Dez 2000 02:55:00 -0800", "lte": "Do, 07 Dez 2000 00:00:00 -0800"}}}} + - match: { hits.total: 1 } + + - do: + search: + rest_total_hits_as_int: true + index: test_index + body: {"query" : {"range" : {"date_field" : {"gte": "Di, 05 Dez 2000 02:55:00 -0800", "lte": "Fr, 08 Dez 2000 00:00:00 -0800"}}}} + - match: { hits.total: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/190_index_prefix_search.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/190_index_prefix_search.yml new file mode 100644 index 0000000000000..40c80b88cfb1b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/190_index_prefix_search.yml @@ -0,0 +1,104 @@ +setup: + - skip: + version: " - 6.2.99" + reason: index_prefixes is only available as of 6.3.0 + + - do: + indices.create: + index: test + body: + mappings: + properties: + text: + type: text + index_prefixes: + min_chars: 2 + max_chars: 5 + + - do: + index: + index: test + id: 1 + body: { text: some short words with a stupendously long one } + + - do: + indices.refresh: + index: [test] + +--- +"search with index prefixes": + - skip: + version: " - 6.2.99" + reason: index_prefixes is only available as of 6.3.0 + - do: + search: + rest_total_hits_as_int: true + index: test + q: shor* + df: text + + - match: {hits.total: 1} + - match: {hits.max_score: 1} + - match: {hits.hits.0._score: 1} + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + query_string: + default_field: text + query: shor* + boost: 2 + + - match: {hits.total: 1} + - match: {hits.max_score: 2} + - match: {hits.hits.0._score: 2} + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + explain: true + query: + query_string: + default_field: text + query: a* + boost: 2 + + - match: {hits.total: 1} + - match: {hits.max_score: 2} + - match: {hits.hits.0._score: 2} + + - do: + search: + rest_total_hits_as_int: true + index: test + q: stupendousl* + df: text + + - match: {hits.total: 1} + - match: {hits.max_score: 1} + - match: {hits.hits.0._score: 1} + +--- +"search index prefixes with span_multi": + - skip: + version: " - 6.99.99" + reason: span_multi throws an exception with prefix fields on < versions + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + span_near: + clauses: [ + { "span_term": { "text": "short" } }, + { "span_multi": { "match": { "prefix": { "text": "word" } } } } + ] + + - match: {hits.total: 1} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/200_ignore_malformed.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/200_ignore_malformed.yml new file mode 100644 index 0000000000000..71ddb32302396 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/200_ignore_malformed.yml @@ -0,0 +1,93 @@ +--- +setup: + - skip: + version: " - 6.3.99" + reason: _ignored was added in 6.4.0 + + - do: + indices.create: + index: test + body: + mappings: + properties: + my_date: + type: date + ignore_malformed: true + store: true + my_ip: + type: ip + ignore_malformed: true + + - do: + index: + index: test + id: 1 + body: { "my_date": "2018-05-11", "my_ip": ":::1" } + + - do: + index: + index: test + id: 2 + body: { "my_date": "bar", "my_ip": "192.168.1.42" } + + - do: + index: + index: test + id: 3 + body: { "my_date": "bar", "my_ip": "quux" } + + - do: + indices.refresh: {} + +--- +"Exists on _ignored": + + - do: + search: + rest_total_hits_as_int: true + body: { query: { exists: { "field": "_ignored" } } } + + - length: { hits.hits: 3 } + +--- +"Search on _ignored with term": + + - do: + search: + rest_total_hits_as_int: true + body: { query: { term: { "_ignored": "my_date" } } } + + - length: { hits.hits: 2 } + +--- +"Search on _ignored with terms": + + - do: + search: + rest_total_hits_as_int: true + body: { query: { terms: { "_ignored": [ "my_date", "my_ip" ] } } } + + - length: { hits.hits: 3 } + +--- +"_ignored is returned by default": + + - do: + search: + rest_total_hits_as_int: true + body: { query: { ids: { "values": [ "3" ] } } } + + - length: { hits.hits: 1 } + - length: { hits.hits.0._ignored: 2} + +--- +"_ignored is still returned with explicit list of stored fields": + + - do: + search: + rest_total_hits_as_int: true + stored_fields: [ "my_date" ] + body: { query: { ids: { "values": [ "3" ] } } } + + - length: { hits.hits: 1 } + - is_true: hits.hits.0._ignored diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/200_index_phrase_search.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/200_index_phrase_search.yml new file mode 100644 index 0000000000000..b48857be4e7a1 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/200_index_phrase_search.yml @@ -0,0 +1,67 @@ +--- +"search with indexed phrases": + - skip: + version: " - 6.99.99" + reason: index_phrase is only available as of 7.0.0 + - do: + indices.create: + index: test + body: + mappings: + properties: + text: + type: text + index_phrases: true + + - do: + index: + index: test + id: 1 + body: { text: "peter piper picked a peck of pickled peppers" } + + - do: + indices.refresh: + index: [test] + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + match_phrase: + text: + query: "peter piper" + + - match: {hits.total: 1} + + - do: + search: + rest_total_hits_as_int: true + index: test + q: '"peter piper"~1' + df: text + + - match: {hits.total: 1} + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + match_phrase: + text: "peter piper picked" + + - match: {hits.total: 1} + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + match_phrase: + text: "piper" + + - match: {hits.total: 1} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/20_default_values.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/20_default_values.yml new file mode 100644 index 0000000000000..fd4621e48cad3 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/20_default_values.yml @@ -0,0 +1,89 @@ +setup: + - do: + indices.create: + index: test_2 + - do: + indices.create: + index: test_1 + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + index: + index: test_2 + id: 42 + body: { foo: bar } + + - do: + indices.refresh: + index: [test_1, test_2] + +--- +"Basic search": + + - do: + search: + rest_total_hits_as_int: true + index: _all + body: + query: + match: + foo: bar + + - match: {hits.total: 2} + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: + match: + foo: bar + + - match: {hits.total: 1} + - match: {hits.hits.0._index: test_1 } + - match: {hits.hits.0._type: _doc } + - match: {hits.hits.0._id: "1" } + + - do: + search: + rest_total_hits_as_int: true + index: test_2 + body: + query: + match: + foo: bar + + - match: {hits.total: 1} + - match: {hits.hits.0._index: test_2 } + - match: {hits.hits.0._type: _doc } + - match: {hits.hits.0._id: "42" } + +--- +"Search body without query element": + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + body: + match: + foo: bar + +--- +"Search with new response format": + - skip: + version: " - 6.99.99" + reason: hits.total is returned as an object in 7.0.0 + - do: + search: + body: + query: + match_all: {} + + - match: {hits.total.value: 2} + - match: {hits.total.relation: eq} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/210_rescore_explain.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/210_rescore_explain.yml new file mode 100644 index 0000000000000..92bb049980dff --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/210_rescore_explain.yml @@ -0,0 +1,41 @@ +--- +"Score should match explanation in rescore": + - skip: + version: " - 6.99.99" + reason: Explanation for rescoring was corrected after these versions + - do: + bulk: + refresh: true + body: + - '{"index": {"_index": "test_index", "_id": "1"}}' + - '{"f1": "1"}' + - '{"index": {"_index": "test_index", "_id": "2"}}' + - '{"f1": "2"}' + - '{"index": {"_index": "test_index", "_id": "3"}}' + - '{"f1": "3"}' + + - do: + search: + rest_total_hits_as_int: true + index: test_index + body: + explain: true + query: + match_all: {} + rescore: + window_size: 2 + query: + rescore_query: + match_all: {} + query_weight: 5 + rescore_query_weight: 10 + + - match: {hits.max_score: 15} + - match: { hits.hits.0._score: 15 } + - match: { hits.hits.0._explanation.value: 15 } + + - match: { hits.hits.1._score: 15 } + - match: { hits.hits.1._explanation.value: 15 } + + - match: { hits.hits.2._score: 5 } + - match: { hits.hits.2._explanation.value: 5 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/220_total_hits_object.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/220_total_hits_object.yml new file mode 100644 index 0000000000000..0aad77c02cb1f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/220_total_hits_object.yml @@ -0,0 +1,176 @@ +setup: + - do: + indices.create: + index: test_2 + + - do: + indices.create: + index: test_1 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + index: + index: test_1 + id: 3 + body: { foo: baz } + + - do: + index: + index: test_1 + id: 2 + body: { foo: bar } + + - do: + index: + index: test_1 + id: 4 + body: { foo: bar } + + - do: + index: + index: test_2 + id: 42 + body: { foo: bar } + + - do: + index: + index: test_2 + id: 24 + body: { foo: baz } + + - do: + index: + index: test_2 + id: 36 + body: { foo: bar } + + - do: + indices.refresh: + index: [test_1, test_2] + +--- +"hits.total as an object": + - skip: + version: " - 7.0.99" + reason: hits.total is rendered as an object in 7.0.0 + + - do: + search: + index: _all + body: + query: + match: + foo: bar + + - match: {hits.total.value: 5} + - match: {hits.total.relation: eq} + + - do: + search: + index: test_1 + body: + query: + match: + foo: bar + + - match: {hits.total.value: 3} + - match: {hits.total.relation: eq} + + - do: + search: + track_total_hits: false + index: _all + body: + query: + match: + foo: bar + + - is_false: hits.total + + - do: + search: + track_total_hits: 4 + body: + query: + match: + foo: bar + + - match: {hits.total.value: 4} + - match: {hits.total.relation: gte} + + + - do: + search: + size: 0 + track_total_hits: 4 + body: + query: + match: + foo: bar + + - match: {hits.total.value: 4} + - match: {hits.total.relation: gte} + + - do: + search: + size: 0 + track_total_hits: 5 + body: + query: + match: + foo: bar + + - match: {hits.total.value: 5} + - match: {hits.total.relation: eq} + + - do: + catch: /\[rest_total_hits_as_int\] cannot be used if the tracking of total hits is not accurate, got 100/ + search: + rest_total_hits_as_int: true + index: test_2 + track_total_hits: 100 + body: + query: + match: + foo: bar + + - do: + catch: /\[track_total_hits\] parameter must be positive or equals to -1, got -2/ + search: + rest_total_hits_as_int: true + index: test_2 + track_total_hits: -2 + body: + query: + match: + foo: bar + +--- +"track_total_hits with rest_total_hits_as_int": + - do: + search: + track_total_hits: false + rest_total_hits_as_int: true + index: _all + body: + query: + match: + foo: bar + + - match: {hits.total: -1} + + - do: + search: + rest_total_hits_as_int: true + index: test_2 + body: + query: + match: + foo: bar + + - match: {hits.total: 2} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/230_interval_query.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/230_interval_query.yml new file mode 100644 index 0000000000000..78380d0da6a71 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/230_interval_query.yml @@ -0,0 +1,450 @@ +setup: + - skip: + version: " - 6.99.99" + reason: "Implemented in 7.0" + + - do: + indices.create: + index: test + body: + mappings: + properties: + text: + type: text + analyzer: standard + - do: + bulk: + refresh: true + body: + - '{"index": {"_index": "test", "_id": "1"}}' + - '{"text" : "Some like it hot, some like it cold"}' + - '{"index": {"_index": "test", "_id": "2"}}' + - '{"text" : "Its cold outside, theres no kind of atmosphere"}' + - '{"index": {"_index": "test", "_id": "3"}}' + - '{"text" : "Baby its cold there outside"}' + - '{"index": {"_index": "test", "_id": "4"}}' + - '{"text" : "Outside it is cold and wet"}' + +--- +"Test ordered matching": + - do: + search: + index: test + body: + query: + intervals: + text: + match: + query: "cold outside" + ordered: true + - match: { hits.total.value: 2 } + +--- +"Test default unordered matching": + - do: + search: + index: test + body: + query: + intervals: + text: + match: + query: "cold outside" + - match: { hits.total.value: 3 } + +--- +"Test explicit unordered matching": + - do: + search: + index: test + body: + query: + intervals: + text: + match: + query: "cold outside" + ordered: false + - match: { hits.total.value: 3 } + +--- +"Test phrase matching": + - do: + search: + index: test + body: + query: + intervals: + text: + match: + query: "cold outside" + ordered: true + max_gaps: 0 + - match: { hits.total.value: 1 } + +--- +"Test unordered max_gaps matching": + - do: + search: + index: test + body: + query: + intervals: + text: + match: + query: "cold outside" + max_gaps: 1 + - match: { hits.total.value: 2 } + +--- +"Test ordered max_gaps matching": + - do: + search: + index: test + body: + query: + intervals: + text: + match: + query: "cold outside" + max_gaps: 0 + ordered: true + - match: { hits.total.value: 1 } + +--- +"Test ordered combination with disjunction": + - do: + search: + index: test + body: + query: + intervals: + text: + all_of: + intervals: + - any_of: + intervals: + - match: + query: "cold" + - match: + query: "outside" + - match: + query: "atmosphere" + ordered: true + - match: { hits.total.value: 1 } + +--- +"Test ordered combination with max_gaps": + - do: + search: + index: test + body: + query: + intervals: + text: + all_of: + intervals: + - match: + query: "cold" + - match: + query: "outside" + max_gaps: 0 + ordered: true + - match: { hits.total.value: 1 } + +--- +"Test ordered combination": + - do: + search: + index: test + body: + query: + intervals: + text: + all_of: + intervals: + - match: + query: "cold" + - match: + query: "outside" + ordered: true + - match: { hits.total.value: 2 } + +--- +"Test unordered combination": + - do: + search: + index: test + body: + query: + intervals: + text: + all_of: + intervals: + - match: + query: "cold" + - match: + query: "outside" + max_gaps: 1 + ordered: false + - match: { hits.total.value: 2 } + +--- +"Test block combination": + - do: + search: + index: test + body: + query: + intervals: + text: + all_of: + intervals: + - match: + query: "cold" + - match: + query: "outside" + ordered: true + max_gaps: 0 + - match: { hits.total.value: 1 } + + +--- +"Test containing": + - do: + search: + index: test + body: + query: + intervals: + text: + all_of: + intervals: + - match: + query: "cold" + - match: + query: "outside" + ordered: false + filter: + containing: + match: + query: "is" + - match: { hits.total.value: 1 } + + +--- +"Test not containing": + - do: + search: + index: test + body: + query: + intervals: + text: + all_of: + intervals: + - match: + query: "cold" + - match: + query: "outside" + ordered: false + filter: + not_containing: + match: + query: "is" + - match: { hits.total.value: 2 } + +--- +"Test contained_by": + - do: + search: + index: test + body: + query: + intervals: + text: + match: + query: "is" + filter: + contained_by: + all_of: + intervals: + - match: + query: "cold" + - match: + query: "outside" + ordered: false + - match: { hits.total.value: 1 } + +--- +"Test not_contained_by": + - do: + search: + index: test + body: + query: + intervals: + text: + match: + query: "it" + filter: + not_contained_by: + all_of: + intervals: + - match: + query: "cold" + - match: + query: "outside" + - match: { hits.total.value: 1 } + +--- +"Test not_overlapping": + - do: + search: + index: test + body: + query: + intervals: + text: + all_of: + intervals: + - match: + query: "cold" + - match: + query: "outside" + ordered: true + filter: + not_overlapping: + all_of: + intervals: + - match: + query: "baby" + - match: + query: "there" + ordered: false + - match: { hits.total.value: 1 } + +--- +"Test overlapping": + - skip: + version: " - 7.1.99" + reason: "Implemented in 7.2" + - do: + search: + index: test + body: + query: + intervals: + text: + match: + query: "cold outside" + ordered: true + filter: + overlapping: + match: + query: "baby there" + ordered: false + - match: { hits.total.value: 1 } + - match: { hits.hits.0._id: "3" } + +--- +"Test before": + - skip: + version: " - 7.1.99" + reason: "Implemented in 7.2" + - do: + search: + index: test + body: + query: + intervals: + text: + match: + query: "cold" + filter: + before: + match: + query: "outside" + - match: { hits.total.value: 2 } + +--- +"Test after": + - skip: + version: " - 7.1.99" + reason: "Implemented in 7.2" + - do: + search: + index: test + body: + query: + intervals: + text: + match: + query: "cold" + filter: + after: + match: + query: "outside" + - match: { hits.total.value: 1 } + - match: { hits.hits.0._id: "4" } + +--- +"Test prefix": + - skip: + version: " - 7.2.99" + reason: "Implemented in 7.3" + - do: + search: + index: test + body: + query: + intervals: + text: + all_of: + intervals: + - match: + query: cold + - prefix: + prefix: out + - match: { hits.total.value: 3 } + +--- +"Test wildcard": + - skip: + version: " - 7.2.99" + reason: "Implemented in 7.3" + - do: + search: + index: test + body: + query: + intervals: + text: + all_of: + intervals: + - match: + query: cold + - wildcard: + pattern: out?ide + - match: { hits.total.value: 3 } + +--- +"Test fuzzy match": + - skip: + version: " - 7.5.99" + reason: "Implemented in 7.6" + - do: + search: + index: test + body: + query: + intervals: + text: + all_of: + intervals: + - fuzzy: + term: cald + - prefix: + prefix: out + - match: { hits.total.value: 3 } + + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/240_date_nanos.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/240_date_nanos.yml new file mode 100644 index 0000000000000..6aaece2f9c58d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/240_date_nanos.yml @@ -0,0 +1,164 @@ +setup: + - skip: + version: " - 6.99.99" + reason: "Implemented in 7.0" + + - do: + indices.create: + index: date_ns + body: + settings: + number_of_shards: 3 + number_of_replicas: 0 + mappings: + properties: + date: + type: date_nanos + field: + type: long + + - do: + indices.create: + index: date_ms + body: + settings: + number_of_shards: 3 + number_of_replicas: 0 + mappings: + properties: + date: + type: date + field: + type: long + +--- +"test sorting against date_nanos only fields": + + - do: + bulk: + refresh: true + body: + - '{ "index" : { "_index" : "date_ns", "_id" : "first" } }' + # millis [1540815132987] to nanos [1540815132987654321] + - '{"date" : "2018-10-29T12:12:12.123456789Z", "field" : 1 }' + - '{ "index" : { "_index" : "date_ns", "_id" : "second" } }' + # millis [1540815132123] to nanos [1540815132123456789] + - '{"date" : "2018-10-29T12:12:12.987654321Z", "field" : 2 }' + + - do: + search: + rest_total_hits_as_int: true + index: date_ns* + body: + sort: [ { "date": "desc" } ] + + - match: { hits.total: 2 } + - length: { hits.hits: 2 } + - match: { hits.hits.0._id: "second" } + - match: { hits.hits.0.sort: [1540815132987654321] } + - match: { hits.hits.1._id: "first" } + - match: { hits.hits.1.sort: [1540815132123456789] } + + - do: + search: + rest_total_hits_as_int: true + index: date_ns* + body: + sort: [ { "date": "asc" } ] + + - match: { hits.total: 2 } + - length: { hits.hits: 2 } + - match: { hits.hits.0._id: "first" } + - match: { hits.hits.0.sort: [1540815132123456789] } + - match: { hits.hits.1._id: "second" } + - match: { hits.hits.1.sort: [1540815132987654321] } + + +--- +"date_nanos requires dates after 1970 and before 2262": + + - do: + bulk: + refresh: true + body: + - '{ "index" : { "_index" : "date_ns", "_id" : "date_ns_1" } }' + - '{"date" : "1969-10-28T12:12:12.123456789Z" }' + - '{ "index" : { "_index" : "date_ns", "_id" : "date_ns_2" } }' + - '{"date" : "2263-10-29T12:12:12.123456789Z" }' + + - match: { errors: true } + - match: { items.0.index.status: 400 } + - match: { items.0.index.error.type: mapper_parsing_exception } + - match: { items.0.index.error.caused_by.reason: "date[1969-10-28T12:12:12.123456789Z] is before the epoch in 1970 and cannot be stored in nanosecond resolution" } + - match: { items.1.index.status: 400 } + - match: { items.1.index.error.type: mapper_parsing_exception } + - match: { items.1.index.error.caused_by.reason: "date[2263-10-29T12:12:12.123456789Z] is after 2262-04-11T23:47:16.854775807 and cannot be stored in nanosecond resolution" } + + +--- +"doc value fields are working as expected across date and date_nanos fields": + + - do: + bulk: + refresh: true + body: + - '{ "index" : { "_index" : "date_ns", "_id" : "date_ns_1" } }' + - '{"date" : "2018-10-29T12:12:12.123456789Z", "field" : 1 }' + - '{ "index" : { "_index" : "date_ms", "_id" : "date_ms_1" } }' + - '{"date" : "2018-10-29T12:12:12.987Z" }' + + - do: + search: + rest_total_hits_as_int: true + index: date* + body: + docvalue_fields: [ { "field": "date", "format" : "strict_date_optional_time" }, { "field": "date", "format": "epoch_millis" }, { "field" : "date", "format": "uuuu-MM-dd'T'HH:mm:ss.SSSSSSSSSX" } ] + sort: [ { "date": "desc" } ] + + - match: { hits.total: 2 } + - length: { hits.hits: 2 } + - match: { hits.hits.0._id: "date_ns_1" } + - match: { hits.hits.1._id: "date_ms_1" } + - match: { hits.hits.0.fields.date: [ "2018-10-29T12:12:12.123Z", "1540815132123.456789", "2018-10-29T12:12:12.123456789Z" ] } + - match: { hits.hits.1.fields.date: [ "2018-10-29T12:12:12.987Z", "1540815132987", "2018-10-29T12:12:12.987000000Z" ] } + +--- +"date histogram aggregation with date and date_nanos mapping": + - skip: + version: " - 7.1.99" + reason: calendar_interval introduced in 7.2.0 + + - do: + bulk: + refresh: true + body: + - '{ "index" : { "_index" : "date_ns", "_id" : "date_ns_1" } }' + - '{"date" : "2018-10-29T12:12:12.123456789Z" }' + - '{ "index" : { "_index" : "date_ms", "_id" : "date_ms_1" } }' + - '{"date" : "2018-10-29T12:12:12.987Z" }' + - '{ "index" : { "_index" : "date_ns", "_id" : "date_ns_2" } }' + - '{"date" : "2018-10-30T12:12:12.123456789Z" }' + - '{ "index" : { "_index" : "date_ms", "_id" : "date_ms_2" } }' + - '{"date" : "2018-10-30T12:12:12.987Z" }' + + - do: + search: + rest_total_hits_as_int: true + index: date* + body: + size: 0 + aggs: + date: + date_histogram: + field: date + calendar_interval: 1d + + - match: { hits.total: 4 } + - length: { aggregations.date.buckets: 2 } + - match: { aggregations.date.buckets.0.key: 1540771200000 } + - match: { aggregations.date.buckets.0.key_as_string: "2018-10-29T00:00:00.000Z" } + - match: { aggregations.date.buckets.0.doc_count: 2 } + - match: { aggregations.date.buckets.1.key: 1540857600000 } + - match: { aggregations.date.buckets.1.key_as_string: "2018-10-30T00:00:00.000Z" } + - match: { aggregations.date.buckets.1.doc_count: 2 } + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/250_distance_feature.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/250_distance_feature.yml new file mode 100644 index 0000000000000..bafb7d52c7186 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/250_distance_feature.yml @@ -0,0 +1,87 @@ +setup: + - skip: + version: " - 7.1.99" + reason: "Implemented in 7.2" + + - do: + indices.create: + index: index1 + body: + settings: + number_of_replicas: 0 + mappings: + properties: + my_date: + type: date + my_date_nanos: + type: date_nanos + my_geo: + type: geo_point + + - do: + bulk: + refresh: true + body: + - '{ "index" : { "_index" : "index1", "_id" : "1" } }' + - '{ "my_date": "2018-02-01T10:00:00Z", "my_date_nanos": "2018-02-01T00:00:00.223456789Z", "my_geo": [-71.34, 41.13] }' + - '{ "index" : { "_index" : "index1", "_id" : "2" } }' + - '{ "my_date": "2018-02-01T11:00:00Z", "my_date_nanos": "2018-02-01T00:00:00.123456789Z", "my_geo": [-71.34, 41.14] }' + - '{ "index" : { "_index" : "index1", "_id" : "3" } }' + - '{ "my_date": "2018-02-01T09:00:00Z", "my_date_nanos": "2018-02-01T00:00:00.323456789Z", "my_geo": [-71.34, 41.12] }' + +--- +"test distance_feature query on date type": + +- do: + search: + rest_total_hits_as_int: true + index: index1 + body: + query: + distance_feature: + field: my_date + pivot: 1h + origin: 2018-02-01T08:00:30Z + +- length: { hits.hits: 3 } +- match: { hits.hits.0._id: "3" } +- match: { hits.hits.1._id: "1" } +- match: { hits.hits.2._id: "2" } + +--- +"test distance_feature query on date_nanos type": + +- do: + search: + rest_total_hits_as_int: true + index: index1 + body: + query: + distance_feature: + field: my_date_nanos + pivot: 100000000nanos + origin: 2018-02-01T00:00:00.323456789Z + +- length: { hits.hits: 3 } +- match: { hits.hits.0._id: "3" } +- match: { hits.hits.1._id: "1" } +- match: { hits.hits.2._id: "2" } + +--- +"test distance_feature query on geo_point type": + +- do: + search: + rest_total_hits_as_int: true + index: index1 + body: + query: + distance_feature: + field: my_geo + pivot: 1km + origin: [-71.35, 41.12] + +- length: { hits.hits: 3 } +- match: { hits.hits.0._id: "3" } +- match: { hits.hits.1._id: "1" } +- match: { hits.hits.2._id: "2" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/300_sequence_numbers.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/300_sequence_numbers.yml new file mode 100644 index 0000000000000..61bbfdcc267ac --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/300_sequence_numbers.yml @@ -0,0 +1,64 @@ +setup: + - do: + indices.create: + index: test_1 + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: foo } + +## we index again in order to make the seq# 1 (so we can check for the field existence with is_false) + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + indices.refresh: + index: [test_1] + +--- +"sequence numbers are returned if requested from body": + - do: + search: + index: _all + body: + query: + match: + foo: bar + seq_no_primary_term: true + + - match: {hits.hits.0._seq_no: 1} + - gte: {hits.hits.0._primary_term: 1} + +--- +"sequence numbers are returned if requested from url": + - do: + search: + index: _all + body: + query: + match: + foo: bar + seq_no_primary_term: true + + - match: {hits.hits.0._seq_no: 1} + - gte: {hits.hits.0._primary_term: 1} + +--- +"sequence numbers are not returned if not requested": + - do: + search: + index: _all + body: + query: + match: + foo: bar + + - is_false: hits.hits.0._seq_no + - is_false: hits.hits.0._primary_term diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/30_limits.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/30_limits.yml new file mode 100644 index 0000000000000..17735c7fd451a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/30_limits.yml @@ -0,0 +1,150 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + index.max_docvalue_fields_search: 2 + index.max_script_fields: 2 + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + indices.refresh: {} + +--- +"Request window limits without scroll": + - do: + catch: /Result window is too large, from \+ size must be less than or equal to[:] \[10000\] but was \[10010\]\. See the scroll api for a more efficient way to request large data sets\./ + search: + rest_total_hits_as_int: true + index: test_1 + from: 10000 + +--- +"Request with negative from value": + - do: + catch: /\[from\] parameter cannot be negative/ + search: + rest_total_hits_as_int: true + index: test_1 + from: -2 + +--- +"Request window limits with scroll": + - do: + catch: /Batch size is too large, size must be less than or equal to[:] \[10000\] but was \[10010\]\. Scroll batch sizes cost as much memory as result windows so they are controlled by the \[index.max_result_window\] index level setting\./ + search: + rest_total_hits_as_int: true + index: test_1 + scroll: 5m + size: 10010 + +--- +"Rescore window limits": + - do: + catch: /Rescore window \[10001\] is too large\. It must be less than \[10000\]\./ + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: + match_all: {} + rescore: + - window_size: 10001 + query: + rescore_query: + match_all: {} + query_weight: 1 + rescore_query_weight: 2 + +--- +"Docvalues_fields size limit": + + - skip: + version: " - 6.99.99" + reason: "Triggers warnings before 7.0" + - do: + catch: /Trying to retrieve too many docvalue_fields\. Must be less than or equal to[:] \[2\] but was \[3\]\. This limit can be set by changing the \[index.max_docvalue_fields_search\] index level setting\./ + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: + match_all: {} + docvalue_fields: + - "one" + - "two" + - "three" + +--- +"Script_fields size limit": + + - do: + catch: /Trying to retrieve too many script_fields\. Must be less than or equal to[:] \[2\] but was \[3\]\. This limit can be set by changing the \[index.max_script_fields\] index level setting\./ + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: + match_all: {} + script_fields: + "test1" : { "script" : { "lang": "painless", "source": "1;" }} + "test2" : { "script" : { "lang": "painless", "source": "1;" }} + "test3" : { "script" : { "lang": "painless", "source": "1;" }} + +--- +"Regexp length limit": + - skip: + version: " - 6.99.99" + reason: "The regex length limit was introduced in 7.0.0" + + - do: + catch: /The length of regex \[1110\] used in the Regexp Query request has exceeded the allowed maximum of \[1000\]\. This maximum can be set by changing the \[index.max_regex_length\] index level setting\./ + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: + regexp: + foo: "^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*)(?:\\.(?:(?:\\r\\n)?[\\t])*(?:[^()<>@,;:\\\\\" | + .\\[\\]\\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\ | + ]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*))*(?:,@(?:(?:\\r\\n)?[ \\t])*(?:[^()<>@,;:\\\\\".\\ | + [\\]\\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\]\\ | + r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*)(?:\\.(?:(?:\\r\\n)?[\\t])*(?:[^()<>@,;:\\\\\".\\[\\] | + \\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\]\\r\\\\] | + |\\\\.)*\\](?:(?:\\r\\n)?[\\t])*))*)*:(?:(?:\\r\\n)?[\\t])*)?(?:[^()<>@,;:\\\\\".\\[\\] \\0 | + 00-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\ | + .|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[\\t])*)(?:\\.(?:(?:\\r\\n)?[ \\t])*(?:[^()<>@, | + ;:\\\\\".\\[\\]\\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\"(? | + :[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[\\t])*))*@(?:(?:\\r\\n)?[ \\t])* | + ]))|\\[([^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*))*\\>(?:(?:\\r\\n)?[ \\t])*)(?:,\\s*( | + \".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[ \\t])*)(?:\\.(?:( | + \\[\"()<>@,;:\\\\\".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[\\t" + + - do: + catch: /The length of regex \[1110\]/ + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: + query_string: + query: "/^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*)(?:\\.(?:(?:\\r\\n)?[\\t])*(?:[^()<>@,;:\\\\\" | + .\\[\\]\\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\ | + ]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*))*(?:,@(?:(?:\\r\\n)?[ \\t])*(?:[^()<>@,;:\\\\\".\\ | + [\\]\\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\]\\ | + r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*)(?:\\.(?:(?:\\r\\n)?[\\t])*(?:[^()<>@,;:\\\\\".\\[\\] | + \\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\]\\r\\\\] | + |\\\\.)*\\](?:(?:\\r\\n)?[\\t])*))*)*:(?:(?:\\r\\n)?[\\t])*)?(?:[^()<>@,;:\\\\\".\\[\\] \\0 | + 00-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\ | + .|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[\\t])*)(?:\\.(?:(?:\\r\\n)?[ \\t])*(?:[^()<>@, | + ;:\\\\\".\\[\\]\\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\"(? | + :[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[\\t])*))*@(?:(?:\\r\\n)?[ \\t])* | + ]))|\\[([^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*))*\\>(?:(?:\\r\\n)?[ \\t])*)(?:,\\s*( | + \".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[ \\t])*)(?:\\.(?:( | + \\[\"()<>@,;:\\\\\".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[\\t/" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/310_match_bool_prefix.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/310_match_bool_prefix.yml new file mode 100644 index 0000000000000..aa6a5158b4795 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/310_match_bool_prefix.yml @@ -0,0 +1,363 @@ +setup: + - skip: + version: " - 7.1.99" + reason: "added in 7.2.0" + + - do: + indices.create: + index: test + body: + mappings: + properties: + my_field1: + type: text + my_field2: + type: text + + - do: + index: + index: test + id: 1 + body: + my_field1: "brown fox jump" + my_field2: "xylophone" + + - do: + index: + index: test + id: 2 + body: + my_field1: "brown emu jump" + my_field2: "xylophone" + + - do: + index: + index: test + id: 3 + body: + my_field1: "jumparound" + my_field2: "emu" + + - do: + index: + index: test + id: 4 + body: + my_field1: "dog" + my_field2: "brown fox jump lazy" + + - do: + indices.refresh: {} + +--- +"scoring complete term": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + match_bool_prefix: + my_field1: "brown fox jump" + + - match: { hits.total: 3 } + - match: { hits.hits.0._source.my_field1: "brown fox jump" } + - match: { hits.hits.1._source.my_field1: "brown emu jump" } + - match: { hits.hits.2._source.my_field1: "jumparound" } + +--- +"scoring partial term": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + match_bool_prefix: + my_field1: "brown fox ju" + + - match: { hits.total: 3 } + - match: { hits.hits.0._id: "1" } + - match: { hits.hits.0._source.my_field1: "brown fox jump" } + - match: { hits.hits.1._id: "2" } + - match: { hits.hits.1._source.my_field1: "brown emu jump" } + - match: { hits.hits.2._id: "3" } + - match: { hits.hits.2._source.my_field1: "jumparound" } + +--- +"minimum should match": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + match_bool_prefix: + my_field1: + query: "brown fox jump" + minimum_should_match: 3 + + - match: { hits.total: 1 } + - match: { hits.hits.0._id: "1" } + - match: { hits.hits.0._source.my_field1: "brown fox jump" } + +--- +"analyzer": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + match_bool_prefix: + my_field1: + query: "BROWN dog" + analyzer: whitespace # this analyzer doesn't lowercase terms + + - match: { hits.total: 1 } + - match: { hits.hits.0._id: "4" } + - match: { hits.hits.0._source.my_field1: "dog" } + +--- +"operator": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + match_bool_prefix: + my_field1: + query: "brown fox jump" + operator: AND + + - match: { hits.total: 1 } + - match: { hits.hits.0._id: "1" } + - match: { hits.hits.0._source.my_field1: "brown fox jump" } + +--- +"fuzziness": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + match_bool_prefix: + my_field2: + query: "xylophoen foo" + fuzziness: 1 + prefix_length: 1 + max_expansions: 10 + fuzzy_transpositions: true + fuzzy_rewrite: constant_score + + - match: { hits.total: 2 } + - match: { hits.hits.0._source.my_field2: "xylophone" } + - match: { hits.hits.1._source.my_field2: "xylophone" } + +--- +"multi_match single field complete term": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + multi_match: + query: "brown fox jump" + type: bool_prefix + fields: [ "my_field1" ] + + - match: { hits.total: 3 } + - match: { hits.hits.0._id: "1" } + - match: { hits.hits.0._source.my_field1: "brown fox jump" } + - match: { hits.hits.1._id: "2" } + - match: { hits.hits.1._source.my_field1: "brown emu jump" } + - match: { hits.hits.2._id: "3" } + - match: { hits.hits.2._source.my_field1: "jumparound" } + +--- +"multi_match single field partial term": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + multi_match: + query: "brown fox ju" + type: bool_prefix + fields: [ "my_field1" ] + + - match: { hits.total: 3 } + - match: { hits.hits.0._id: "1" } + - match: { hits.hits.0._source.my_field1: "brown fox jump" } + - match: { hits.hits.1._id: "2" } + - match: { hits.hits.1._source.my_field1: "brown emu jump" } + - match: { hits.hits.2._id: "3" } + - match: { hits.hits.2._source.my_field1: "jumparound" } + +--- +"multi_match multiple fields complete term": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + multi_match: + query: "brown fox jump lazy" + type: bool_prefix + fields: [ "my_field1", "my_field2" ] + + - match: { hits.total: 3 } + - match: { hits.hits.0._id: "4" } + - match: { hits.hits.0._source.my_field1: "dog" } + - match: { hits.hits.0._source.my_field2: "brown fox jump lazy" } + - match: { hits.hits.1._id: "1" } + - match: { hits.hits.1._source.my_field1: "brown fox jump" } + - match: { hits.hits.2._id: "2" } + - match: { hits.hits.2._source.my_field1: "brown emu jump" } + +--- +"multi_match multiple fields partial term": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + multi_match: + query: "brown fox jump laz" + type: bool_prefix + fields: [ "my_field1", "my_field2" ] + + - match: { hits.total: 3 } + - match: { hits.hits.0._id: "4" } + - match: { hits.hits.0._source.my_field1: "dog" } + - match: { hits.hits.0._source.my_field2: "brown fox jump lazy" } + - match: { hits.hits.1._id: "1" } + - match: { hits.hits.1._source.my_field1: "brown fox jump" } + - match: { hits.hits.2._id: "2" } + - match: { hits.hits.2._source.my_field1: "brown emu jump" } + +--- +"multi_match multiple fields with analyzer": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + multi_match: + query: "BROWN FOX JUMP dog" + type: bool_prefix + fields: [ "my_field1", "my_field2" ] + analyzer: whitespace # this analyzer doesn't lowercase terms + + - match: { hits.total: 1 } + - match: { hits.hits.0._id: "4" } + - match: { hits.hits.0._source.my_field1: "dog" } + - match: { hits.hits.0._source.my_field2: "brown fox jump lazy" } + +--- +"multi_match multiple fields with minimum_should_match": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + multi_match: + query: "brown fox jump la" + type: bool_prefix + fields: [ "my_field1", "my_field2" ] + minimum_should_match: 4 + + - match: { hits.total: 1 } + - match: { hits.hits.0._id: "4" } + - match: { hits.hits.0._source.my_field1: "dog" } + - match: { hits.hits.0._source.my_field2: "brown fox jump lazy" } + +--- +"multi_match multiple fields with fuzziness": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + multi_match: + query: "dob nomatch" + type: bool_prefix + fields: [ "my_field1", "my_field2" ] + fuzziness: 1 + + - match: { hits.total: 1 } + - match: { hits.hits.0._id: "4" } + - match: { hits.hits.0._source.my_field1: "dog" } + - match: { hits.hits.0._source.my_field2: "brown fox jump lazy" } + +--- +"multi_match multiple fields with boost": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + query: + multi_match: + query: "brown emu" + type: bool_prefix + fields: [ "my_field1", "my_field2^10" ] + fuzziness: 1 + + - match: { hits.hits.0._id: "3" } + - match: { hits.hits.0._source.my_field2: "emu" } + +--- +"multi_match multiple fields with slop throws exception": + + - do: + catch: /\[slop\] not allowed for type \[bool_prefix\]/ + search: + rest_total_hits_as_int: true + index: test + body: + query: + multi_match: + query: "brown" + type: bool_prefix + fields: [ "my_field1", "my_field2" ] + slop: 1 + +--- +"multi_match multiple fields with cutoff_frequency throws exception": + + - do: + catch: /\[cutoff_frequency\] not allowed for type \[bool_prefix\]/ + search: + rest_total_hits_as_int: true + index: test + body: + query: + multi_match: + query: "brown" + type: bool_prefix + fields: [ "my_field1", "my_field2" ] + cutoff_frequency: 0.001 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/320_disallow_queries.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/320_disallow_queries.yml new file mode 100644 index 0000000000000..7135c8642736c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/320_disallow_queries.yml @@ -0,0 +1,147 @@ +--- +setup: + - skip: + version: " - 7.6.99" + reason: "implemented in 7.7.0" + + - do: + indices.create: + index: test + body: + mappings: + properties: + text: + type: text + analyzer: standard + fields: + raw: + type: keyword + nested1: + type: nested + + - do: + bulk: + refresh: true + body: + - '{"index": {"_index": "test", "_id": "1"}}' + - '{"text" : "Some like it hot, some like it cold", "nested1": [{"foo": "bar1"}]}' + - '{"index": {"_index": "test", "_id": "2"}}' + - '{"text" : "Its cold outside, theres no kind of atmosphere", "nested1": [{"foo": "bar2"}]}' + - '{"index": {"_index": "test", "_id": "3"}}' + - '{"text" : "Baby its cold there outside", "nested1": [{"foo": "bar3"}]}' + - '{"index": {"_index": "test", "_id": "4"}}' + - '{"text" : "Outside it is cold and wet", "nested1": [{"foo": "bar4"}]}' + +--- +teardown: + - skip: + version: " - 7.6.99" + reason: "implemented in 7.7.0" + + - do: + cluster.put_settings: + body: + transient: + search.allow_expensive_queries: null + +--- +"Test disallow expensive queries": + - skip: + version: " - 7.6.99" + reason: "implemented in 7.7.0" + + ### Check for initial setting = null -> false + - do: + cluster.get_settings: + flat_settings: true + + - is_false: search.allow_expensive_queries + + ### Update setting to false + - do: + cluster.put_settings: + body: + transient: + search.allow_expensive_queries: "false" + flat_settings: true + + - match: {transient: {search.allow_expensive_queries: "false"}} + + ### Prefix + - do: + catch: /\[prefix\] queries cannot be executed when \'search.allow_expensive_queries\' is set to false. For optimised prefix queries on text fields please enable \[index_prefixes\]./ + search: + index: test + body: + query: + prefix: + text: + value: out + + ### Fuzzy + - do: + catch: /\[fuzzy\] queries cannot be executed when \'search.allow_expensive_queries\' is set to false./ + search: + index: test + body: + query: + fuzzy: + text: + value: outwide + + ### Regexp + - do: + catch: /\[regexp\] queries cannot be executed when \'search.allow_expensive_queries\' is set to false./ + search: + index: test + body: + query: + regexp: + text: + value: .*ou.*id.* + + ### Wildcard + - do: + catch: /\[wildcard\] queries cannot be executed when \'search.allow_expensive_queries\' is set to false./ + search: + index: test + body: + query: + wildcard: + text: + value: out?ide + + ### Range on text + - do: + catch: /\[range\] queries on \[text\] or \[keyword\] fields cannot be executed when \'search.allow_expensive_queries\' is set to false./ + search: + index: test + body: + query: + range: + text: + gte: "theres" + + ### Range on keyword + - do: + catch: /\[range\] queries on \[text\] or \[keyword\] fields cannot be executed when \'search.allow_expensive_queries\' is set to false./ + search: + index: test + body: + query: + range: + text.raw: + gte : "Outside it is cold and wet" + + ### Nested + - do: + catch: /\[joining\] queries cannot be executed when \'search.allow_expensive_queries\' is set to false./ + search: + index: test + body: + query: + nested: + path: "nested1" + query: + bool: + must: [{"match" : {"nested1.foo" : "bar2"}}] diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/330_distributed_sort.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/330_distributed_sort.yml new file mode 100644 index 0000000000000..57846ccee5ab9 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/330_distributed_sort.yml @@ -0,0 +1,130 @@ +setup: + - do: + indices.create: + index: index_1 + body: + settings: + number_of_shards: 1 + mappings: + properties: + created_at: + type: date + format: "strict_date" + - do: + indices.create: + index: index_2 + body: + settings: + number_of_shards: 1 + mappings: + properties: + created_at: + type: date + format: "strict_date" + + - do: + indices.create: + index: index_3 + body: + settings: + number_of_shards: 1 + mappings: + properties: + created_at: + type: date + format: "strict_date" + + +--- +"test distributed sort can rewrite query to match no docs": + + - skip: + version: " - 7.6.99" + reason: "distributed sort optimization was added in 7.7.0" + - do: + index: + index: index_1 + id: 1 + body: { "created_at": "2016-01-01"} + - do: + index: + index: index_2 + id: 2 + body: { "created_at": "2017-01-01" } + + - do: + index: + index: index_3 + id: 3 + body: { "created_at": "2018-01-01" } + - do: + indices.refresh: {} + + # check that empty responses are correctly handled when rewriting to match_no_docs + - do: + search: + # ensure that one shard can return empty response + max_concurrent_shard_requests: 1 + body: { "size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2016-02-01", "lt": "2018-02-01"}}}, "aggs" : { "idx_terms" : { "terms" : { "field" : "_index" } } } } + + - match: { _shards.total: 3 } + - match: { _shards.successful: 3 } + - match: { _shards.skipped : 0 } + - match: { _shards.failed: 0 } + - match: { hits.total.value: 2 } + - length: { aggregations.idx_terms.buckets: 2 } + + - do: + search: + # ensure that one shard can return empty response + max_concurrent_shard_requests: 2 + body: { "size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2019-02-01"}}}, "aggs" : { "idx_terms" : { "terms" : { "field" : "_index" } } } } + + - match: { _shards.total: 3 } + - match: { _shards.successful: 3 } + - match: { _shards.skipped : 0 } + - match: { _shards.failed: 0 } + - match: { hits.total.value: 0 } + - length: { aggregations.idx_terms.buckets: 0 } + + # check field sort is correct when skipping query phase + - do: + search: + # ensure that one shard can return empty response + max_concurrent_shard_requests: 1 + pre_filter_shard_size: 1 + body: + "size": 1 + "track_total_hits": 1 + "sort": [{ "created_at": { "order": "desc" } }] + + - match: { _shards.total: 3 } + - match: { _shards.successful: 3 } + - match: { _shards.skipped: 0 } + - match: { _shards.failed: 0 } + - match: { hits.total.value: 1 } + - match: { hits.total.relation: "gte" } + - length: { hits.hits: 1 } + - match: { hits.hits.0._id: "3" } + + # same with aggs + - do: + search: + # ensure that one shard can return empty response + max_concurrent_shard_requests: 1 + pre_filter_shard_size: 1 + body: + "size": 1 + "track_total_hits": 1 + "sort": [{ "created_at": { "order": "desc" } }] + "aggs" : { "idx_terms" : { "terms" : { "field" : "_index" } } } + + - match: { _shards.total: 3 } + - match: { _shards.successful: 3 } + - match: { _shards.skipped: 0 } + - match: { _shards.failed: 0 } + - match: { hits.total.value: 1 } + - match: { hits.total.relation: "gte" } + - length: { hits.hits: 1 } + - match: {hits.hits.0._id: "3" } + - length: { aggregations.idx_terms.buckets: 3 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/40_indices_boost.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/40_indices_boost.yml new file mode 100644 index 0000000000000..37d53fe8a6d59 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/40_indices_boost.yml @@ -0,0 +1,187 @@ +setup: + - do: + indices.create: + index: test_1 + - do: + indices.create: + index: test_2 + + - do: + indices.put_alias: + index: test_1 + name: alias_1 + + - do: + indices.put_alias: + index: test_2 + name: alias_2 + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + index: + index: test_2 + type: test + id: 1 + body: { foo: bar } + + - do: + indices.refresh: + index: [test_1, test_2] + +--- +"Indices boost using object": + - skip: + reason: deprecation was added in 5.2.0 + features: "warnings" + + - do: + warnings: + - 'Object format in indices_boost is deprecated, please use array format instead' + search: + rest_total_hits_as_int: true + index: _all + body: + indices_boost: {test_1: 2.0, test_2: 1.0} + + - match: { hits.total: 2 } + - match: { hits.hits.0._index: test_1 } + - match: { hits.hits.1._index: test_2 } + + - do: + warnings: + - 'Object format in indices_boost is deprecated, please use array format instead' + search: + rest_total_hits_as_int: true + index: _all + body: + indices_boost: {test_1: 1.0, test_2: 2.0} + + - match: { hits.total: 2 } + - match: { hits.hits.0._index: test_2 } + - match: { hits.hits.1._index: test_1 } + +--- +"Indices boost using array": + - do: + search: + rest_total_hits_as_int: true + index: _all + body: + indices_boost: [{test_1: 2.0}, {test_2: 1.0}] + + - match: { hits.total: 2 } + - match: { hits.hits.0._index: test_1 } + - match: { hits.hits.1._index: test_2 } + + - do: + search: + rest_total_hits_as_int: true + index: _all + body: + indices_boost: [{test_1: 1.0}, {test_2: 2.0}] + + - match: { hits.total: 2 } + - match: { hits.hits.0._index: test_2 } + - match: { hits.hits.1._index: test_1 } + +--- +"Indices boost using array with alias": + - do: + search: + rest_total_hits_as_int: true + index: _all + body: + indices_boost: [{alias_1: 2.0}] + + - match: { hits.total: 2} + - match: { hits.hits.0._index: test_1 } + - match: { hits.hits.1._index: test_2 } + + - do: + search: + rest_total_hits_as_int: true + index: _all + body: + indices_boost: [{alias_2: 2.0}] + + - match: { hits.total: 2} + - match: { hits.hits.0._index: test_2 } + - match: { hits.hits.1._index: test_1 } + +--- +"Indices boost using array with wildcard": + - do: + search: + rest_total_hits_as_int: true + index: _all + body: + indices_boost: [{"*_1": 2.0}] + + - match: { hits.total: 2} + - match: { hits.hits.0._index: test_1 } + - match: { hits.hits.1._index: test_2 } + + - do: + search: + rest_total_hits_as_int: true + index: _all + body: + indices_boost: [{"*_2": 2.0}] + + - match: { hits.total: 2} + - match: { hits.hits.0._index: test_2 } + - match: { hits.hits.1._index: test_1 } + +--- +"Indices boost using array multiple match": + - do: + search: + rest_total_hits_as_int: true + index: _all + body: + # First match (3.0) is used for test_1 + indices_boost: [{"*_1": 3.0}, {alias_1: 1.0}, {test_2: 2.0}] + + - match: { hits.total: 2} + - match: { hits.hits.0._index: test_1 } + - match: { hits.hits.1._index: test_2 } + + - do: + search: + rest_total_hits_as_int: true + index: _all + body: + # First match (1.0) is used for test_1 + indices_boost: [{"*_1": 1.0}, {test_2: 2.0}, {alias_1: 3.0}] + + - match: { hits.total: 2} + - match: { hits.hits.0._index: test_2 } + - match: { hits.hits.1._index: test_1 } + +--- +"Indices boost for nonexistent index/alias": + - do: + catch: /no such index/ + search: + rest_total_hits_as_int: true + index: _all + body: + indices_boost: [{nonexistent: 2.0}, {test_1: 1.0}, {test_2: 2.0}] + + - do: + search: + rest_total_hits_as_int: true + index: _all + ignore_unavailable: true + body: + indices_boost: [{nonexistent: 2.0}, {test_1: 1.0}, {test_2: 2.0}] + + - match: { hits.total: 2} + - match: { hits.hits.0._index: test_2 } + - match: { hits.hits.1._index: test_1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/60_query_string.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/60_query_string.yml new file mode 100644 index 0000000000000..131c8f92a231e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/60_query_string.yml @@ -0,0 +1,63 @@ +--- +"search with query_string parameters": + - do: + indices.create: + index: test + body: + mappings: + properties: + number: + type: integer + + - do: + index: + index: test + id: 1 + body: { field: foo bar} + + - do: + indices.refresh: + index: [test] + + - do: + search: + rest_total_hits_as_int: true + index: test + q: bar + df: field + + - match: {hits.total: 1} + + - do: + search: + rest_total_hits_as_int: true + index: test + q: field:foo field:xyz + + - match: {hits.total: 1} + + - do: + search: + rest_total_hits_as_int: true + index: test + q: field:foo field:xyz + default_operator: AND + + - match: {hits.total: 0} + + - do: + search: + rest_total_hits_as_int: true + index: test + q: field:BA* + + - match: {hits.total: 1} + + - do: + search: + rest_total_hits_as_int: true + index: test + q: number:foo + lenient: true + + - match: {hits.total: 0} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/70_response_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/70_response_filtering.yml new file mode 100644 index 0000000000000..d306cb7b1ad50 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/70_response_filtering.yml @@ -0,0 +1,153 @@ +--- +"Search with response filtering": + - do: + indices.create: + index: test + - do: + index: + index: test + id: 1 + body: { foo: bar } + + - do: + index: + index: test + id: 2 + body: { foo: bar } + + - do: + indices.refresh: + index: [test] + + - do: + search: + rest_total_hits_as_int: true + index: test + filter_path: "*" + body: "{ \"query\": { \"match_all\": {} } }" + + - gte: { took: 0 } + - is_false: _clusters + - is_true: _shards.total + - is_true: hits.total + - is_true: hits.hits.0._index + - is_true: hits.hits.0._type + - is_true: hits.hits.0._id + - is_true: hits.hits.1._index + - is_true: hits.hits.1._type + - is_true: hits.hits.1._id + + - do: + search: + rest_total_hits_as_int: true + index: test + filter_path: "took" + body: "{ \"query\": { \"match_all\": {} } }" + + - gte: { took: 0 } + - is_false: _shards.total + - is_false: hits.total + - is_false: hits.hits.0._index + - is_false: hits.hits.0._type + - is_false: hits.hits.0._id + - is_false: hits.hits.1._index + - is_false: hits.hits.1._type + - is_false: hits.hits.1._id + + - do: + search: + rest_total_hits_as_int: true + index: test + filter_path: "_shards.*" + body: "{ \"query\": { \"match_all\": {} } }" + + - is_false: took + - is_true: _shards.total + - is_false: hits.total + - is_false: hits.hits.0._index + - is_false: hits.hits.0._type + - is_false: hits.hits.0._id + - is_false: hits.hits.1._index + - is_false: hits.hits.1._type + - is_false: hits.hits.1._id + + - do: + search: + rest_total_hits_as_int: true + index: test + filter_path: [ "hits.**._i*", "**.total" ] + body: "{ \"query\": { \"match_all\": {} } }" + + - is_false: took + - is_true: _shards.total + - is_true: hits.total + - is_true: hits.hits.0._index + - is_false: hits.hits.0._type + - is_true: hits.hits.0._id + - is_true: hits.hits.1._index + - is_false: hits.hits.1._type + - is_true: hits.hits.1._id + +--- +"Search results filtered using both includes and excludes filters": + - do: + bulk: + refresh: true + body: | + {"index": {"_index": "index-1", "_id": "1"}} + {"name": "First document", "properties": {"size": 123, "meta": {"foo": "bar"}}} + {"index": {"_index": "index-1", "_id": "2"}} + {"name": "Second document", "properties": {"size": 465, "meta": {"foo": "bar", "baz": "qux"}}} + + - do: + search: + rest_total_hits_as_int: true + filter_path: [ "-**._source.properties", "**._source" ] + body: { query: { match_all: {} } } + + - is_false: took + - is_true: hits.hits.0._source + - is_true: hits.hits.0._source.name + - is_false: hits.hits.0._source.properties + - is_true: hits.hits.1._source + - is_true: hits.hits.1._source.name + - is_false: hits.hits.1._source.properties + + - do: + search: + rest_total_hits_as_int: true + filter_path: [ "**.properties" , "-hits.hits._source.properties.meta" ] + body: { query: { match_all: {} } } + + - is_false: took + - is_true: hits.hits.0._source + - is_false: hits.hits.0._source.name + - is_true: hits.hits.0._source.properties + - is_true: hits.hits.0._source.properties.size + - is_false: hits.hits.0._source.properties.meta + - is_true: hits.hits.1._source + - is_false: hits.hits.1._source.name + - is_true: hits.hits.1._source.properties + - is_true: hits.hits.1._source.properties.size + - is_false: hits.hits.1._source.properties.meta + + - do: + search: + rest_total_hits_as_int: true + filter_path: "**._source,-**.meta.foo" + body: { query: { match_all: {} } } + + - is_false: took + - is_true: hits.hits.0._source + - is_true: hits.hits.0._source.name + - is_true: hits.hits.0._source.properties + - is_true: hits.hits.0._source.properties.size + - is_false: hits.hits.0._source.properties.meta.foo + + - do: + count: + filter_path: "-*" + body: { query: { match_all: {} } } + + - is_false: count + - is_false: _shards diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/80_indices_options.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/80_indices_options.yml new file mode 100644 index 0000000000000..71b554f2a5a5e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/80_indices_options.yml @@ -0,0 +1,71 @@ +--- +"Missing index date math with catch": + + - do: + catch: /logstash-\d{4}\.\d{2}\.\d{2}/ + search: + rest_total_hits_as_int: true + index: + +--- +"Missing index": + + - do: + catch: missing + search: + rest_total_hits_as_int: true + index: missing_index + + - do: + search: + rest_total_hits_as_int: true + index: missing_index + ignore_unavailable: true + + - match: {hits.total: 0} + +--- +"Closed index": + + - do: + indices.create: + index: index_closed + + - do: + indices.close: + index: index_closed + + - do: + catch: /index_closed_exception/ + search: + rest_total_hits_as_int: true + index: index_closed + + - do: + search: + rest_total_hits_as_int: true + index: index_closed + ignore_unavailable: true + + - match: {hits.total: 0} + + - do: + search: + rest_total_hits_as_int: true + index: index* + + - match: {hits.total: 0} + + - do: + catch: missing + search: + rest_total_hits_as_int: true + index: index* + allow_no_indices: false + + - do: + catch: /index_closed_exception/ + search: + rest_total_hits_as_int: true + index: index* + expand_wildcards: ["open","closed"] diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/90_search_after.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/90_search_after.yml new file mode 100644 index 0000000000000..aa283cda4c27f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/90_search_after.yml @@ -0,0 +1,99 @@ +setup: + - do: + indices.create: + index: test + - do: + index: + index: test + id: 1 + body: { id: 1, foo: bar, age: 18 } + + - do: + index: + index: test + id: 42 + body: { id: 42, foo: bar, age: 18 } + + - do: + index: + index: test + id: 172 + body: { id: 172, foo: bar, age: 24 } + + - do: + indices.refresh: + index: test + +--- +"search with search_after parameter": + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + size: 1 + query: + match: + foo: bar + sort: [{ age: desc }, { id: desc }] + + - match: {hits.total: 3 } + - length: {hits.hits: 1 } + - match: {hits.hits.0._index: test } + - match: {hits.hits.0._type: _doc } + - match: {hits.hits.0._id: "172" } + - match: {hits.hits.0.sort: [24, 172] } + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + size: 1 + query: + match: + foo: bar + sort: [{ age: desc }, { id: desc }] + search_after: [24, 172] + + - match: {hits.total: 3 } + - length: {hits.hits: 1 } + - match: {hits.hits.0._index: test } + - match: {hits.hits.0._type: _doc } + - match: {hits.hits.0._id: "42" } + - match: {hits.hits.0.sort: [18, 42] } + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + size: 1 + query: + match: + foo: bar + sort: [ { age: desc }, { id: desc } ] + search_after: [18, 42] + + - match: {hits.total: 3} + - length: {hits.hits: 1 } + - match: {hits.hits.0._index: test } + - match: {hits.hits.0._type: _doc } + - match: {hits.hits.0._id: "1" } + - match: {hits.hits.0.sort: [18, 1] } + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + size: 1 + query: + match: + foo: bar + sort: [{ age: desc }, { id: desc } ] + search_after: [18, 1] + + - match: {hits.total: 3} + - length: {hits.hits: 0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/issue4895.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/issue4895.yml new file mode 100644 index 0000000000000..4d8b1484c74ac --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/issue4895.yml @@ -0,0 +1,33 @@ +--- +setup: + - do: + indices.create: + index: test + + - do: + index: + index: test + id: 1 + body: + user : foo + amount : 35 + data : some + + - do: + indices.refresh: + index: [test] + +--- +"Test with _local preference placed in query body - should fail": + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + index: test + body: + query: + term: + data: some + preference: _local + stored_fields: [user,amount] diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/issue9606.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/issue9606.yml new file mode 100644 index 0000000000000..9f5025093c652 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search/issue9606.yml @@ -0,0 +1,43 @@ +--- +setup: + - do: + indices.create: + index: test + + - do: + index: + index: test + id: 1 + body: { foo: bar } + + - do: + indices.refresh: + index: [test] + +--- +"Test search_type=query_and_fetch not supported from REST layer": + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + index: test + search_type: query_and_fetch + body: + query: + match: + foo: bar + +--- +"Test search_type=dfs_query_and_fetch not supported from REST layer": + + - do: + catch: bad_request + search: + rest_total_hits_as_int: true + index: test + search_type: dfs_query_and_fetch + body: + query: + match: + foo: bar diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search_shards/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search_shards/10_basic.yml new file mode 100644 index 0000000000000..653979073b707 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/search_shards/10_basic.yml @@ -0,0 +1,101 @@ +--- +"Basic /_search_shards test": + - do: + indices.create: + index: test_1 + + - do: + search_shards: + index: test_1 + routing: foo + + - match: { shards.0.0.index: test_1 } + +--- +"Search shards aliases with and without filters": + - do: + indices.create: + index: test_index + body: + settings: + index: + number_of_shards: 1 + number_of_replicas: 0 + mappings: + properties: + field: + type: text + aliases: + test_alias_no_filter: {} + test_alias_filter_1: + filter: + term: + field : value1 + test_alias_filter_2: + filter: + term: + field : value2 + + - do: + search_shards: + index: test_alias_no_filter + + - length: { shards: 1 } + - match: { shards.0.0.index: test_index } + - is_true: indices.test_index + - is_false: indices.test_index.filter + - match: { indices.test_index.aliases: [test_alias_no_filter]} + + - do: + search_shards: + index: test_alias_filter_1 + + - length: { shards: 1 } + - match: { shards.0.0.index: test_index } + - match: { indices.test_index.aliases: [test_alias_filter_1] } + - match: { indices.test_index.filter.term.field.value: value1 } + - lte: { indices.test_index.filter.term.field.boost: 1.0 } + - gte: { indices.test_index.filter.term.field.boost: 1.0 } + + - do: + search_shards: + index: ["test_alias_filter_1","test_alias_filter_2"] + + - length: { shards: 1 } + - match: { shards.0.0.index: test_index } + - match: { indices.test_index.aliases: [test_alias_filter_1, test_alias_filter_2]} + - length: { indices.test_index.filter.bool.should: 2 } + - lte: { indices.test_index.filter.bool.should.0.term.field.boost: 1.0 } + - gte: { indices.test_index.filter.bool.should.0.term.field.boost: 1.0 } + - lte: { indices.test_index.filter.bool.should.1.term.field.boost: 1.0 } + - gte: { indices.test_index.filter.bool.should.1.term.field.boost: 1.0 } + - match: { indices.test_index.filter.bool.adjust_pure_negative: true} + - lte: { indices.test_index.filter.bool.boost: 1.0 } + - gte: { indices.test_index.filter.bool.boost: 1.0 } + + - do: + search_shards: + index: "test*" + + - length: { shards: 1 } + - match: { shards.0.0.index: test_index } + - match: { indices.test_index.aliases: [test_alias_filter_1, test_alias_filter_2, test_alias_no_filter]} + - is_false: indices.test_index.filter + + - do: + search_shards: + index: ["test_alias_filter_1","test_alias_no_filter"] + + - length: { shards: 1 } + - match: { shards.0.0.index: test_index } + - match: { indices.test_index.aliases: [test_alias_filter_1, test_alias_no_filter]} + - is_false: indices.test_index.filter + + - do: + search_shards: + index: ["test_alias_no_filter"] + + - length: { shards: 1 } + - match: { shards.0.0.index: test_index } + - match: { indices.test_index.aliases: [test_alias_no_filter]} + - is_false: indices.test_index.filter diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.create/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.create/10_basic.yml new file mode 100644 index 0000000000000..fe70620c6ef62 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.create/10_basic.yml @@ -0,0 +1,119 @@ +--- +setup: + + - do: + snapshot.create_repository: + repository: test_repo_create_1 + body: + type: fs + settings: + location: "test_repo_create_1_loc" + + - do: + indices.create: + index: test_index + body: + settings: + number_of_shards: 1 + number_of_replicas: 1 + +--- +"Create a snapshot": + + - do: + snapshot.create: + repository: test_repo_create_1 + snapshot: test_snapshot + wait_for_completion: true + + - match: { snapshot.snapshot: test_snapshot } + - match: { snapshot.state : SUCCESS } + - match: { snapshot.shards.successful: 1 } + - match: { snapshot.shards.failed : 0 } + + - do: + snapshot.delete: + repository: test_repo_create_1 + snapshot: test_snapshot + + - match: { acknowledged: true } + +--- +"Create a snapshot and clean up repository": + - skip: + version: " - 7.3.99" + reason: cleanup introduced in 7.4 + + - do: + snapshot.cleanup_repository: + repository: test_repo_create_1 + + - match: { results.deleted_bytes: 0 } + - match: { results.deleted_blobs: 0 } + + - do: + snapshot.create: + repository: test_repo_create_1 + snapshot: test_snapshot + wait_for_completion: true + + - match: { snapshot.snapshot: test_snapshot } + - match: { snapshot.state : SUCCESS } + - match: { snapshot.shards.successful: 1 } + - match: { snapshot.shards.failed : 0 } + + - do: + snapshot.cleanup_repository: + repository: test_repo_create_1 + + - match: { results.deleted_bytes: 0 } + - match: { results.deleted_blobs: 0 } + + - do: + snapshot.delete: + repository: test_repo_create_1 + snapshot: test_snapshot + + - match: { acknowledged: true } + + - do: + snapshot.cleanup_repository: + repository: test_repo_create_1 + + - match: { results.deleted_bytes: 0 } + - match: { results.deleted_blobs: 0 } + +--- +"Create a snapshot for missing index": + - skip: + version: " - 6.0.0" + reason: ignore_unavailable default is false in 6.0.0 + + - do: + catch: missing + snapshot.create: + repository: test_repo_create_1 + snapshot: test_snapshot_1 + wait_for_completion: true + body: | + { "indices": "missing_1" } + + - do: + snapshot.create: + repository: test_repo_create_1 + snapshot: test_snapshot_2 + wait_for_completion: true + body: | + { "indices": "missing_2", "ignore_unavailable": true } + + - match: { snapshot.snapshot: test_snapshot_2 } + - match: { snapshot.state : SUCCESS } + - match: { snapshot.shards.successful: 0 } + - match: { snapshot.shards.failed : 0 } + + - do: + snapshot.delete: + repository: test_repo_create_1 + snapshot: test_snapshot_2 + + - match: { acknowledged: true } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get/10_basic.yml new file mode 100644 index 0000000000000..874dda3606c4a --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get/10_basic.yml @@ -0,0 +1,193 @@ +--- +setup: + + - do: + snapshot.create_repository: + repository: test_repo_get_1 + body: + type: fs + settings: + location: "test_repo_get_1_loc" + +--- +"Get snapshot info": + + - do: + indices.create: + index: test_index + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + snapshot.create: + repository: test_repo_get_1 + snapshot: test_snapshot + wait_for_completion: true + + - do: + snapshot.get: + repository: test_repo_get_1 + snapshot: test_snapshot + + - is_true: snapshots + - is_true: snapshots.0.failures + + - do: + snapshot.delete: + repository: test_repo_get_1 + snapshot: test_snapshot + +--- +"Get missing snapshot info throws an exception": + + - do: + catch: /snapshot_missing_exception.+ is missing/ + snapshot.get: + repository: test_repo_get_1 + snapshot: test_nonexistent_snapshot + +--- +"Get missing snapshot info succeeds when ignore_unavailable is true": + + - do: + snapshot.get: + repository: test_repo_get_1 + snapshot: test_nonexistent_snapshot + ignore_unavailable: true + + - is_true: snapshots + +--- +"Get snapshot info when verbose is false": + - do: + indices.create: + index: test_index + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + snapshot.create: + repository: test_repo_get_1 + snapshot: test_snapshot + wait_for_completion: true + + - do: + snapshot.get: + repository: test_repo_get_1 + snapshot: test_snapshot + verbose: false + + - is_true: snapshots + - match: { snapshots.0.snapshot: test_snapshot } + - match: { snapshots.0.state: SUCCESS } + - is_false: snapshots.0.failures + - is_false: snapshots.0.shards + - is_false: snapshots.0.version + - is_false: snapshots.0._meta + + - do: + snapshot.delete: + repository: test_repo_get_1 + snapshot: test_snapshot + +--- +"Get snapshot info contains include_global_state": + - skip: + version: " - 6.1.99" + reason: "include_global_state field has been added in the response in 6.2.0" + + - do: + indices.create: + index: test_index + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + snapshot.create: + repository: test_repo_get_1 + snapshot: test_snapshot_with_include_global_state + wait_for_completion: true + body: | + { "include_global_state": true } + + - do: + snapshot.get: + repository: test_repo_get_1 + snapshot: test_snapshot_with_include_global_state + + - is_true: snapshots + - match: { snapshots.0.snapshot: test_snapshot_with_include_global_state } + - match: { snapshots.0.state: SUCCESS } + - match: { snapshots.0.include_global_state: true } + + - do: + snapshot.delete: + repository: test_repo_get_1 + snapshot: test_snapshot_with_include_global_state + + - do: + snapshot.create: + repository: test_repo_get_1 + snapshot: test_snapshot_without_include_global_state + wait_for_completion: true + body: | + { "include_global_state": false } + + - do: + snapshot.get: + repository: test_repo_get_1 + snapshot: test_snapshot_without_include_global_state + + - is_true: snapshots + - match: { snapshots.0.snapshot: test_snapshot_without_include_global_state } + - match: { snapshots.0.state: SUCCESS } + - match: { snapshots.0.include_global_state: false } + + - do: + snapshot.delete: + repository: test_repo_get_1 + snapshot: test_snapshot_without_include_global_state + +--- +"Get snapshot info with metadata": + - skip: + version: " - 7.2.99" + reason: "Introduced with 7.3" + + - do: + indices.create: + index: test_index + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + snapshot.create: + repository: test_repo_get_1 + snapshot: test_snapshot_with_metadata + wait_for_completion: true + body: | + { "metadata": {"taken_by": "test", "foo": {"bar": "baz"}} } + + - do: + snapshot.get: + repository: test_repo_get_1 + snapshot: test_snapshot_with_metadata + + - is_true: snapshots + - match: { snapshots.0.snapshot: test_snapshot_with_metadata } + - match: { snapshots.0.state: SUCCESS } + - match: { snapshots.0.metadata.taken_by: test } + - match: { snapshots.0.metadata.foo.bar: baz } + + - do: + snapshot.delete: + repository: test_repo_get_1 + snapshot: test_snapshot_with_metadata diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get_repository/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get_repository/10_basic.yml new file mode 100644 index 0000000000000..aa854d7456e00 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get_repository/10_basic.yml @@ -0,0 +1,65 @@ +--- +setup: + + - do: + snapshot.create_repository: + repository: test_repo_get_1 + body: + type: fs + settings: + location: "test_repo_get_1_loc" + + - do: + snapshot.create_repository: + repository: test_repo_get_2 + body: + type: fs + settings: + readonly: true + location: "test_repo_get_1_loc" + +--- +"Get all repositories": + - do: + snapshot.get_repository: {} + + - is_true: test_repo_get_1 + - is_true: test_repo_get_2 + +--- +"Get repository by name": + - do: + snapshot.get_repository: + repository: test_repo_get_1 + + - is_true: test_repo_get_1 + - is_false: test_repo_get_2 + +--- +"Get missing repository by name": + - do: + snapshot.get_repository: + repository: test_repo_get_2 + +--- +"Get all repositories with local flag": + - do: + snapshot.get_repository: + local: true + + - is_true: test_repo_get_1 + - is_true: test_repo_get_2 + +--- +"Verify created repository": + - do: + snapshot.verify_repository: + repository: test_repo_get_1 + + - is_true: nodes + + - do: + snapshot.verify_repository: + repository: test_repo_get_2 + + - is_true: nodes diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.restore/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.restore/10_basic.yml new file mode 100644 index 0000000000000..4bce99d5d97b6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.restore/10_basic.yml @@ -0,0 +1,59 @@ +--- +setup: + + - do: + snapshot.create_repository: + repository: test_repo_restore_1 + body: + type: fs + settings: + location: "test_repo_restore_1_loc" + + - do: + indices.create: + index: test_index + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + +--- +"Create a snapshot and then restore it": + + - do: + snapshot.create: + repository: test_repo_restore_1 + snapshot: test_snapshot + wait_for_completion: true + + - match: { snapshot.snapshot: test_snapshot } + - match: { snapshot.state : SUCCESS } + - match: { snapshot.shards.successful: 1 } + - match: { snapshot.shards.failed : 0 } + - is_true: snapshot.version + - gt: { snapshot.version_id: 0} + + - do: + indices.close: + index : test_index + + - do: + snapshot.restore: + repository: test_repo_restore_1 + snapshot: test_snapshot + wait_for_completion: true + + - do: + indices.recovery: + index: test_index + + - match: { test_index.shards.0.type: SNAPSHOT } + - match: { test_index.shards.0.stage: DONE } + - match: { test_index.shards.0.index.files.recovered: 1} + - gt: { test_index.shards.0.index.size.recovered_in_bytes: 0} + - match: { test_index.shards.0.index.files.reused: 0} + - match: { test_index.shards.0.index.size.reused_in_bytes: 0} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.status/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.status/10_basic.yml new file mode 100644 index 0000000000000..c35f2419bdc91 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.status/10_basic.yml @@ -0,0 +1,62 @@ +--- +setup: + + - do: + snapshot.create_repository: + repository: test_repo_status_1 + body: + type: fs + settings: + location: "test_repo_status_1_loc" + +--- +"Get snapshot status": + - do: + indices.create: + index: test_index + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + snapshot.create: + repository: test_repo_status_1 + snapshot: test_snapshot + wait_for_completion: true + + - do: + snapshot.status: + repository: test_repo_status_1 + snapshot: test_snapshot + + - is_true: snapshots + - match: { snapshots.0.snapshot: test_snapshot } + - match: { snapshots.0.state: SUCCESS } + - gt: { snapshots.0.stats.incremental.file_count: 0 } + - gt: { snapshots.0.stats.incremental.size_in_bytes: 0 } + - gt: { snapshots.0.stats.total.file_count: 0 } + - gt: { snapshots.0.stats.total.size_in_bytes: 0 } + - is_true: snapshots.0.stats.start_time_in_millis +## fast in memory snapshots can take less than one millisecond to complete. + - gte: { snapshots.0.stats.time_in_millis: 0 } + +--- +"Get missing snapshot status throws an exception": + + - do: + catch: /snapshot_missing_exception.+ is missing/ + snapshot.status: + repository: test_repo_status_1 + snapshot: test_nonexistent_snapshot + +--- +"Get missing snapshot status succeeds when ignoreUnavailable is true": + + - do: + snapshot.status: + repository: test_repo_status_1 + snapshot: test_nonexistent_snapshot + ignore_unavailable: true + + - is_true: snapshots diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/10_basic.yml new file mode 100644 index 0000000000000..4b6db06e29f36 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/10_basic.yml @@ -0,0 +1,25 @@ +setup: + - do: + index: + index: test + id: testing_document + body: + body: Amsterdam meetup + - do: + indices.refresh: {} + +--- +"Basic tests for suggest API": + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + test_suggestion: + text: "The Amsterdma meetpu" + term: + field: body + + - match: {suggest.test_suggestion.1.options.0.text: amsterdam} + - match: {suggest.test_suggestion.2.options.0.text: meetup} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/20_completion.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/20_completion.yml new file mode 100644 index 0000000000000..b64a51141dc6e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/20_completion.yml @@ -0,0 +1,329 @@ +# This test creates one huge mapping in the setup +# Every test should use its own field to make sure it works + +setup: + + - do: + indices.create: + index: test + body: + mappings: + "properties": + "suggest_1": + "type" : "completion" + "suggest_2": + "type" : "completion" + "suggest_3": + "type" : "completion" + "suggest_4": + "type" : "completion" + "suggest_5a": + "type" : "completion" + "suggest_5b": + "type" : "completion" + "suggest_6": + "type" : "completion" + title: + type: keyword + +--- +"Simple suggestion should work": + + - do: + index: + index: test + id: 1 + body: + suggest_1: "bar" + + - do: + index: + index: test + id: 2 + body: + suggest_1: "baz" + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + result: + text: "b" + completion: + field: suggest_1 + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 2 } + +--- +"Simple suggestion array should work": + + - do: + index: + index: test + id: 1 + body: + suggest_2: ["bar", "foo"] + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + result: + text: "f" + completion: + field: suggest_2 + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 1 } + - match: { suggest.result.0.options.0.text: "foo" } + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + result: + text: "b" + completion: + field: suggest_2 + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 1 } + - match: { suggest.result.0.options.0.text: "bar" } + +--- +"Suggestion entry should work": + + - do: + index: + index: test + id: 1 + body: + suggest_3: + input: "bar" + weight: 2 + + - do: + index: + index: test + id: 2 + body: + suggest_3: + input: "baz" + weight: 3 + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + result: + text: "b" + completion: + field: suggest_3 + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 2 } + - match: { suggest.result.0.options.0.text: "baz" } + - match: { suggest.result.0.options.1.text: "bar" } + +--- +"Suggestion entry array should work": + + - do: + index: + index: test + id: 1 + body: + suggest_4: + - input: "bar" + weight: 3 + - input: "fo" + weight: 3 + + - do: + index: + index: test + id: 2 + body: + suggest_4: + - input: "baz" + weight: 2 + - input: "foo" + weight: 1 + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + result: + text: "b" + completion: + field: suggest_4 + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 2 } + - match: { suggest.result.0.options.0.text: "bar" } + - match: { suggest.result.0.options.1.text: "baz" } + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + result: + text: "f" + completion: + field: suggest_4 + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 2 } + - match: { suggest.result.0.options.0.text: "fo" } + - match: { suggest.result.0.options.1.text: "foo" } + +--- +"Multiple Completion fields should work": + + - do: + index: + index: test + id: 1 + body: + suggest_5a: "bar" + suggest_5b: "baz" + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + result: + text: "b" + completion: + field: suggest_5a + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 1 } + - match: { suggest.result.0.options.0.text: "bar" } + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + result: + text: "b" + completion: + field: suggest_5b + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 1 } + - match: { suggest.result.0.options.0.text: "baz" } + +--- +"Suggestions with source should work": + + - do: + index: + index: test + id: 1 + body: + suggest_6: + input: "bar" + weight: 2 + title: "title_bar" + count: 4 + + - do: + index: + index: test + id: 2 + body: + suggest_6: + input: "baz" + weight: 3 + title: "title_baz" + count: 3 + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + result: + text: "b" + completion: + field: suggest_6 + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 2 } + - match: { suggest.result.0.options.0.text: "baz" } + - match: { suggest.result.0.options.0._index: "test" } + - match: { suggest.result.0.options.0._type: "_doc" } + - match: { suggest.result.0.options.0._source.title: "title_baz" } + - match: { suggest.result.0.options.0._source.count: 3 } + - match: { suggest.result.0.options.1.text: "bar" } + - match: { suggest.result.0.options.1._index: "test" } + - match: { suggest.result.0.options.1._type: "_doc" } + - match: { suggest.result.0.options.1._source.title: "title_bar" } + - match: { suggest.result.0.options.1._source.count: 4 } + +--- +"Skip duplicates should work": + - skip: + version: " - 6.0.99" + reason: skip_duplicates was added in 6.1 + + - do: + index: + index: test + id: 1 + body: + suggest_1: "bar" + + - do: + index: + index: test + id: 2 + body: + suggest_1: "bar" + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + result: + text: "b" + completion: + field: suggest_1 + skip_duplicates: true + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 1 } + - match: { suggest.result.0.options.0.text: "bar" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/30_context.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/30_context.yml new file mode 100644 index 0000000000000..e2c7ccfb421e3 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/30_context.yml @@ -0,0 +1,403 @@ +# This test creates one huge mapping in the setup +# Every test should use its own field to make sure it works + +setup: + + - do: + indices.create: + index: test + body: + mappings: + "properties": + "location": + "type": "geo_point" + "suggest_context": + "type" : "completion" + "contexts": + - + "name" : "color" + "type" : "category" + "suggest_context_with_path": + "type" : "completion" + "contexts": + - + "name" : "color" + "type" : "category" + "path" : "color" + "suggest_geo": + "type" : "completion" + "contexts": + - + "name" : "location" + "type" : "geo" + "precision" : "5km" + "suggest_multi_contexts": + "type" : "completion" + "contexts": + - + "name" : "location" + "type" : "geo" + "precision" : "5km" + "path" : "location" + - + "name" : "color" + "type" : "category" + "path" : "color" + +--- +"Simple context suggestion should work": + + - do: + index: + index: test + id: 1 + body: + suggest_context: + input: "foo red" + contexts: + color: "red" + + - do: + index: + index: test + id: 2 + body: + suggest_context: + input: "foo blue" + contexts: + color: "blue" + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + result: + text: "foo" + completion: + field: suggest_context + contexts: + color: "red" + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 1 } + - match: { suggest.result.0.options.0.text: "foo red" } + +--- +"Category suggest context from path should work": + + - do: + index: + index: test + id: 1 + body: + suggest_context_with_path: + input: "Foo red" + contexts: + color: "red" + + - do: + index: + index: test + id: 2 + body: + suggest_context_with_path: "Foo blue" + color: "blue" + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + result: + text: "foo" + completion: + field: suggest_context_with_path + contexts: + color: "red" + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 1 } + - match: { suggest.result.0.options.0.text: "Foo red" } + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + result: + text: "foo" + completion: + field: suggest_context_with_path + contexts: + color: "blue" + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 1 } + - match: { suggest.result.0.options.0.text: "Foo blue" } + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + result: + text: "foo" + completion: + field: suggest_context_with_path + contexts: + color: ["blue", "red"] + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 2 } + +--- +"Geo suggest should work": + + - do: + index: + index: test + id: 1 + body: + suggest_geo: + input: "Marriot in Amsterdam" + contexts: + location: + lat : 52.22 + lon : 4.53 + + - do: + index: + index: test + id: 2 + body: + suggest_geo: + input: "Marriot in Berlin" + contexts: + location: + lat : 53.31 + lon : 13.24 + + - do: + indices.refresh: {} + + - do: + indices.get_mapping: {} + - do: + search: + rest_total_hits_as_int: true + index: test + body: + suggest: + result: + text: "mar" + completion: + field: suggest_geo + contexts: + location: + lat : 52.2263 + lon : 4.543 + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 1 } + - match: { suggest.result.0.options.0.text: "Marriot in Amsterdam" } + +--- +"Multi contexts should work": + + - do: + index: + index: test + id: 1 + body: + suggest_multi_contexts: "Marriot in Amsterdam" + location: + lat : 52.22 + lon : 4.53 + color: "red" + + - do: + index: + index: test + id: 2 + body: + suggest_multi_contexts: "Marriot in Berlin" + location: + lat : 53.31 + lon : 13.24 + color: "blue" + + - do: + indices.refresh: {} + + - do: + indices.get_mapping: {} + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + suggest: + result: + text: "mar" + completion: + field: suggest_multi_contexts + contexts: + location: + lat : 52.22 + lon : 4.53 + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 1 } + - match: { suggest.result.0.options.0.text: "Marriot in Amsterdam" } + + - do: + search: + rest_total_hits_as_int: true + index: test + body: + suggest: + result: + text: "mar" + completion: + field: suggest_multi_contexts + contexts: + color: "blue" + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 1 } + - match: { suggest.result.0.options.0.text: "Marriot in Berlin" } + +--- +"Skip duplicates with contexts should work": + - skip: + version: " - 6.0.99" + reason: skip_duplicates was added in 6.1 + + - do: + index: + index: test + id: 1 + body: + suggest_context: + input: "foo" + contexts: + color: "red" + + - do: + index: + index: test + id: 1 + body: + suggest_context: + input: "foo" + contexts: + color: "red" + + - do: + index: + index: test + id: 2 + body: + suggest_context: + input: "foo" + contexts: + color: "blue" + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + body: + suggest: + result: + text: "foo" + completion: + field: suggest_context + skip_duplicates: true + contexts: + color: "red" + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 1 } + - match: { suggest.result.0.options.0.text: "foo" } + +--- +"Indexing and Querying without contexts is forbidden": + - skip: + version: " - 6.99.99" + reason: this feature was removed in 7.0 + + - do: + index: + index: test + id: 1 + body: + suggest_context: + input: "foo" + contexts: + color: "red" + suggest_multi_contexts: + input: "bar" + contexts: + color: "blue" + + - do: + catch: /Contexts are mandatory in context enabled completion field \[suggest_context\]/ + index: + index: test + id: 2 + body: + suggest_context: + input: "foo" + + - do: + indices.refresh: {} + + - do: + catch: /Missing mandatory contexts in context query/ + search: + rest_total_hits_as_int: true + allow_partial_search_results: false + body: + suggest: + result: + text: "foo" + completion: + field: suggest_context + + - do: + catch: /Missing mandatory contexts in context query/ + search: + rest_total_hits_as_int: true + allow_partial_search_results: false + body: + suggest: + result: + text: "foo" + completion: + field: suggest_context + contexts: {} + + - do: + catch: /Missing mandatory contexts in context query/ + search: + rest_total_hits_as_int: true + allow_partial_search_results: false + body: + suggest: + result: + text: "foo" + completion: + field: suggest_multi_contexts + contexts: + location: [] diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/40_typed_keys.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/40_typed_keys.yml new file mode 100644 index 0000000000000..daac7d895611c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/40_typed_keys.yml @@ -0,0 +1,57 @@ +setup: + + - do: + indices.create: + index: test + body: + settings: + number_of_replicas: 0 + mappings: + properties: + title: + type: keyword + suggestions: + type: completion + contexts: + - + "name" : "format" + "type" : "category" + + - do: + bulk: + refresh: true + index: test + body: + - '{"index": {}}' + - '{"title": "Elasticsearch in Action", "suggestions": {"input": "ELK in Action", "contexts": {"format": "ebook"}}}' + - '{"index": {}}' + - '{"title": "Elasticsearch - The Definitive Guide", "suggestions": {"input": ["Elasticsearch in Action"], "contexts": {"format": "ebook"}}}' + +--- +"Test typed keys parameter for suggesters": + + - do: + search: + rest_total_hits_as_int: true + typed_keys: true + body: + query: + match_all: {} + suggest: + text: "Elastic" + term_suggester: + term: + field: title + context_suggester: + prefix: "Elastic" + completion: + field: suggestions + contexts: + format: "ebook" + phrase_suggester: + phrase: + field: title + + - is_true: suggest.term#term_suggester + - is_true: suggest.completion#context_suggester + - is_true: suggest.phrase#phrase_suggester diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/50_completion_with_multi_fields.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/50_completion_with_multi_fields.yml new file mode 100644 index 0000000000000..a29019183e199 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/50_completion_with_multi_fields.yml @@ -0,0 +1,290 @@ + +--- +"Search by suggestion and by keyword sub-field should work": + + - skip: + version: " - 6.99.99" + reason: "Search by suggestion with multi-fields was introduced 7.0.0" + + - do: + indices.create: + index: completion_with_sub_keyword + body: + mappings: + "properties": + "suggest_1": + "type" : "completion" + "fields": + "text_raw": + "type" : "keyword" + + - do: + index: + index: completion_with_sub_keyword + id: 1 + body: + suggest_1: "bar" + + - do: + index: + index: completion_with_sub_keyword + id: 2 + body: + suggest_1: "baz" + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + index: completion_with_sub_keyword + body: + suggest: + result: + text: "b" + completion: + field: suggest_1 + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 2 } + + + - do: + search: + rest_total_hits_as_int: true + index: completion_with_sub_keyword + body: + query: { term: { suggest_1.text_raw: "bar" }} + + - match: { hits.total: 1 } + + + +--- +"Search by suggestion on sub field should work": + + - skip: + version: " - 6.99.99" + reason: "Search by suggestion with multi-fields was introduced 7.0.0" + + - do: + indices.create: + index: completion_with_sub_completion + body: + mappings: + "properties": + "suggest_1": + "type": "completion" + "fields": + "suggest_2": + "type": "completion" + + - do: + index: + index: completion_with_sub_completion + id: 1 + body: + suggest_1: "bar" + + - do: + index: + index: completion_with_sub_completion + id: 2 + body: + suggest_1: "baz" + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + index: completion_with_sub_completion + body: + suggest: + result: + text: "b" + completion: + field: suggest_1.suggest_2 + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 2 } + +--- +"Search by suggestion on sub field with context should work": + + - skip: + version: " - 6.99.99" + reason: "Search by suggestion with multi-fields was introduced 7.0.0" + + - do: + indices.create: + index: completion_with_context + body: + mappings: + "properties": + "suggest_1": + "type": "completion" + "contexts": + - + "name": "color" + "type": "category" + "fields": + "suggest_2": + "type": "completion" + "contexts": + - + "name": "color" + "type": "category" + + + - do: + index: + index: completion_with_context + id: 1 + body: + suggest_1: + input: "foo red" + contexts: + color: "red" + + - do: + index: + index: completion_with_context + id: 2 + body: + suggest_1: + input: "foo blue" + contexts: + color: "blue" + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + index: completion_with_context + body: + suggest: + result: + prefix: "foo" + completion: + field: suggest_1.suggest_2 + contexts: + color: "red" + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 1 } + - match: { suggest.result.0.options.0.text: "foo red" } + + +--- +"Search by suggestion on sub field with weight should work": + + - skip: + version: " - 6.99.99" + reason: "Search by suggestion with multi-fields was introduced 7.0.0" + + - do: + indices.create: + index: completion_with_weight + body: + mappings: + "properties": + "suggest_1": + "type": "completion" + "fields": + "suggest_2": + "type": "completion" + + - do: + index: + index: completion_with_weight + id: 1 + body: + suggest_1: + input: "bar" + weight: 2 + + - do: + index: + index: completion_with_weight + id: 2 + body: + suggest_1: + input: "baz" + weight: 3 + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + index: completion_with_weight + body: + suggest: + result: + text: "b" + completion: + field: suggest_1.suggest_2 + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 2 } + - match: { suggest.result.0.options.0.text: "baz" } + - match: { suggest.result.0.options.1.text: "bar" } + +--- +"Search by suggestion on geofield-hash on sub field should work": + + - skip: + version: " - 6.99.99" + reason: "Search by suggestion with multi-fields was introduced 7.0.0" + + - do: + indices.create: + index: geofield_with_completion + body: + mappings: + "properties": + "geofield": + "type": "geo_point" + "fields": + "suggest_1": + "type": "completion" + + - do: + index: + index: geofield_with_completion + id: 1 + body: + geofield: "hgjhrwysvqw7" + #41.12,-72.34,12 + + - do: + index: + index: geofield_with_completion + id: 1 + body: + geofield: "hgm4psywmkn7" + #41.12,-71.34,12 + + - do: + indices.refresh: {} + + - do: + search: + rest_total_hits_as_int: true + index: geofield_with_completion + body: + suggest: + result: + prefix: "hgm" + completion: + field: geofield.suggest_1 + + + - length: { suggest.result: 1 } + - length: { suggest.result.0.options: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.cancel/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.cancel/10_basic.yml new file mode 100644 index 0000000000000..d65ee04211b9d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.cancel/10_basic.yml @@ -0,0 +1,7 @@ +--- +"tasks_cancel test": + - do: + tasks.cancel: + actions: "unknown_action" + + - length: { nodes: 0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.get/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.get/10_basic.yml new file mode 100644 index 0000000000000..addeb3226c575 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.get/10_basic.yml @@ -0,0 +1,8 @@ +--- +"get task test": + # Note that this gets much better testing in reindex's tests because it actually saves the task + - do: + catch: missing + tasks.get: + task_id: foo:1 + - match: {error.reason: "/task.\\[foo:1\\].belongs.to.the.node.\\[foo\\].which.isn't.part.of.the.cluster.and.there.is.no.record.of.the.task/"} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.list/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.list/10_basic.yml new file mode 100644 index 0000000000000..1742134af2b75 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.list/10_basic.yml @@ -0,0 +1,38 @@ +--- +"tasks_list test": + - skip: + features: [arbitrary_key] + + - do: + nodes.info: {} + - set: + nodes._arbitrary_key_: node_id + + - do: + tasks.list: {} + + - is_true: nodes + - is_true: nodes.$node_id.roles + + - do: + tasks.list: + group_by: parents + + - is_true: tasks + +--- +"tasks_list headers": + - skip: + version: " - 6.99.99" + features: headers + reason: task headers has been added in 7.0.0 + + - do: + headers: { "X-Opaque-Id": "That is me" } + tasks.list: + actions: "cluster:monitor/tasks/lists" + group_by: none + + - is_true: tasks + - match: { tasks.0.headers.X-Opaque-Id: "That is me" } + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/10_basic.yml new file mode 100644 index 0000000000000..62ec86118e5bb --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/10_basic.yml @@ -0,0 +1,36 @@ +setup: + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: testidx + body: + mappings: + "properties": + "text": + "type" : "text" + "term_vector" : "with_positions_offsets" + - do: + index: + index: testidx + id: testing_document + body: + "text" : "The quick brown fox is brown." + - do: + indices.refresh: {} + +--- +"Basic tests for termvector get": + + - do: + termvectors: + index: testidx + id: testing_document + "term_statistics" : true + + + - match: {term_vectors.text.field_statistics.sum_doc_freq: 5} + - match: {term_vectors.text.terms.brown.doc_freq: 1} + - match: {term_vectors.text.terms.brown.tokens.0.start_offset: 10} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/11_basic_with_types.yml new file mode 100644 index 0000000000000..992d6db7ca786 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/11_basic_with_types.yml @@ -0,0 +1,36 @@ +setup: + - do: + indices.create: + include_type_name: true + index: testidx + body: + mappings: + testtype: + "properties": + "text": + "type" : "text" + "term_vector" : "with_positions_offsets" + - do: + index: + index: testidx + type: testtype + id: testing_document + body: + "text" : "The quick brown fox is brown." + - do: + indices.refresh: {} + +--- +"Basic tests for termvector get": + + - do: + termvectors: + index: testidx + type: testtype + id: testing_document + "term_statistics" : true + + + - match: {term_vectors.text.field_statistics.sum_doc_freq: 5} + - match: {term_vectors.text.terms.brown.doc_freq: 1} + - match: {term_vectors.text.terms.brown.tokens.0.start_offset: 10} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/20_issue7121.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/20_issue7121.yml new file mode 100644 index 0000000000000..5f43e8a247923 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/20_issue7121.yml @@ -0,0 +1,44 @@ +setup: + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + +--- +"Term vector API should return 'found: false' for docs between index and refresh": + - do: + indices.create: + index: testidx + body: + settings: + index: + translog.flush_threshold_size: "512MB" + number_of_shards: 1 + number_of_replicas: 0 + refresh_interval: -1 + mappings: + properties: + text: + type : "text" + term_vector : "with_positions_offsets" + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: testidx + id: 1 + body: + text : "foo bar" + + - do: + termvectors: + index: testidx + id: 1 + realtime: false + + - match: { _index: "testidx" } + - match: { _type: "_doc" } + - match: { _id: "1" } + - is_false: found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/21_issue7121_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/21_issue7121_with_types.yml new file mode 100644 index 0000000000000..cf597bf141f61 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/21_issue7121_with_types.yml @@ -0,0 +1,42 @@ +"Term vector API should return 'found: false' for docs between index and refresh": + - do: + indices.create: + include_type_name: true + index: testidx + body: + settings: + index: + translog.flush_threshold_size: "512MB" + number_of_shards: 1 + number_of_replicas: 0 + refresh_interval: -1 + mappings: + doc: + properties: + text: + type : "text" + term_vector : "with_positions_offsets" + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: testidx + type: doc + id: 1 + body: + text : "foo bar" + + - do: + termvectors: + index: testidx + type: doc + id: 1 + realtime: false + + - match: { _index: "testidx" } + - match: { _type: "doc" } + - match: { _id: "1" } + - is_false: found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/30_realtime.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/30_realtime.yml new file mode 100644 index 0000000000000..0cb6dfc06904b --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/30_realtime.yml @@ -0,0 +1,42 @@ +setup: + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + +--- +"Realtime Term Vectors": + + - do: + indices.create: + index: test_1 + body: + settings: + index: + refresh_interval: -1 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + id: 1 + body: { foo: bar } + + - do: + termvectors: + index: test_1 + id: 1 + realtime: false + + - is_false: found + + - do: + termvectors: + index: test_1 + id: 1 + realtime: true + + - is_true: found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/31_realtime_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/31_realtime_with_types.yml new file mode 100644 index 0000000000000..26f441207ace8 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/31_realtime_with_types.yml @@ -0,0 +1,40 @@ +--- +"Realtime Term Vectors": + + - do: + indices.create: + index: test_1 + body: + settings: + index: + refresh_interval: -1 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - do: + termvectors: + index: test_1 + type: test + id: 1 + realtime: false + + - is_false: found + + - do: + termvectors: + index: test_1 + type: test + id: 1 + realtime: true + + - is_true: found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/50_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/50_mix_typeless_typeful.yml new file mode 100644 index 0000000000000..4382442dee4dd --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/50_mix_typeless_typeful.yml @@ -0,0 +1,46 @@ +--- +"Term vectors with typeless API on an index that has types": + + - skip: + version: " - 6.99.99" + reason: Typeless APIs were introduced in 7.0.0 + + - do: + indices.create: # not using include_type_name: false on purpose + include_type_name: true + index: index + body: + mappings: + not_doc: + properties: + foo: + type: "text" + term_vector: "with_positions" + + - do: + index: + index: index + type: not_doc + id: 1 + body: { foo: bar } + + - do: + indices.refresh: {} + + - do: + termvectors: + index: index + type: _doc # todo: remove when termvectors support typeless API + id: 1 + + - is_true: found + - match: {_type: _doc} + - match: {term_vectors.foo.terms.bar.term_freq: 1} + + - do: + termvectors: + index: index + type: some_random_type + id: 1 + + - is_false: found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/10_doc.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/10_doc.yml new file mode 100644 index 0000000000000..3a35ad46f9161 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/10_doc.yml @@ -0,0 +1,40 @@ +--- +"Partial document": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + body: + foo: bar + count: 1 + nested: { one: 1, two: 2 } + + - do: + update: + index: test_1 + id: 1 + body: + doc: + foo: baz + nested: + one: 3 + + - match: { _index: test_1 } + - match: { _type: _doc } + - match: { _id: "1" } + - match: { _version: 2 } + + - do: + get: + index: test_1 + id: 1 + + - match: { _source.foo: baz } + - match: { _source.count: 1 } + - match: { _source.nested.one: 3 } + - match: { _source.nested.two: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/11_shard_header.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/11_shard_header.yml new file mode 100644 index 0000000000000..41dba3551e64c --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/11_shard_header.yml @@ -0,0 +1,41 @@ +--- +"Update check shard header": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: foobar + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: foobar + id: 1 + body: { foo: bar } + + - do: + update: + index: foobar + id: 1 + body: + doc: + foo: baz + + - match: { _index: foobar } + - match: { _type: _doc } + - match: { _id: "1"} + - match: { _version: 2} + - match: { _shards.total: 1} + - match: { _shards.successful: 1} + - match: { _shards.failed: 0} + - is_false: _shards.pending diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/12_result.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/12_result.yml new file mode 100644 index 0000000000000..657c036291bd6 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/12_result.yml @@ -0,0 +1,51 @@ +--- +"Update result field": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + update: + index: test_1 + id: 1 + body: + doc: { foo: bar } + doc_as_upsert: true + + - match: { _version: 1 } + - match: { result: created } + + - do: + update: + index: test_1 + id: 1 + body: + doc: { foo: bar } + doc_as_upsert: true + + - match: { _version: 1 } + - match: { result: noop } + + - do: + update: + index: test_1 + id: 1 + body: + doc: { foo: bar } + doc_as_upsert: true + detect_noop: false + + - match: { _version: 2 } + - match: { result: updated } + + - do: + update: + index: test_1 + id: 1 + body: + doc: { foo: baz } + doc_as_upsert: true + detect_noop: true + + - match: { _version: 3 } + - match: { result: updated } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/13_legacy_doc.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/13_legacy_doc.yml new file mode 100644 index 0000000000000..08f3457400d4f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/13_legacy_doc.yml @@ -0,0 +1,36 @@ +--- +"Partial document": + + - do: + index: + index: test_1 + id: 1 + body: + foo: bar + count: 1 + nested: { one: 1, two: 2 } + + - do: + update: + index: test_1 + id: 1 + body: + doc: + foo: baz + nested: + one: 3 + + - match: { _index: test_1 } + - match: { _type: _doc } + - match: { _id: "1" } + - match: { _version: 2 } + + - do: + get: + index: test_1 + id: 1 + + - match: { _source.foo: baz } + - match: { _source.count: 1 } + - match: { _source.nested.one: 3 } + - match: { _source.nested.two: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/14_shard_header_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/14_shard_header_with_types.yml new file mode 100644 index 0000000000000..eb2e4ff9a9117 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/14_shard_header_with_types.yml @@ -0,0 +1,39 @@ +--- +"Update check shard header": + + - do: + indices.create: + index: foobar + body: + settings: + number_of_shards: "1" + number_of_replicas: "0" + + - do: + cluster.health: + wait_for_status: green + + - do: + index: + index: foobar + type: baz + id: 1 + body: { foo: bar } + + - do: + update: + index: foobar + type: baz + id: 1 + body: + doc: + foo: baz + + - match: { _index: foobar } + - match: { _type: baz } + - match: { _id: "1"} + - match: { _version: 2} + - match: { _shards.total: 1} + - match: { _shards.successful: 1} + - match: { _shards.failed: 0} + - is_false: _shards.pending diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/15_result_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/15_result_with_types.yml new file mode 100644 index 0000000000000..9adada6d54b4f --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/15_result_with_types.yml @@ -0,0 +1,52 @@ +--- +"Update result field": + + - do: + update: + index: test_1 + type: test + id: 1 + body: + doc: { foo: bar } + doc_as_upsert: true + + - match: { _version: 1 } + - match: { result: created } + + - do: + update: + index: test_1 + type: test + id: 1 + body: + doc: { foo: bar } + doc_as_upsert: true + + - match: { _version: 1 } + - match: { result: noop } + + - do: + update: + index: test_1 + type: test + id: 1 + body: + doc: { foo: bar } + doc_as_upsert: true + detect_noop: false + + - match: { _version: 2 } + - match: { result: updated } + + - do: + update: + index: test_1 + type: test + id: 1 + body: + doc: { foo: baz } + doc_as_upsert: true + detect_noop: true + + - match: { _version: 3 } + - match: { result: updated } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/16_noop.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/16_noop.yml new file mode 100644 index 0000000000000..bfb56541fb7eb --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/16_noop.yml @@ -0,0 +1,43 @@ +--- +"Noop": + - skip: + version: " - 7.3.99" + reason: "Noop does not return seq_no and primary_term until 7.4.0" + - do: + index: + index: test_1 + type: test + id: 1 + body: { foo: bar } + + - match: { _seq_no: 0 } + - match: { _version: 1 } + - match: { _primary_term: 1 } + - match: { result: created } + + - do: + update: + index: test_1 + type: test + id: 1 + body: + doc: { foo: bar } + + - match: { _seq_no: 0 } + - match: { _version: 1 } + - match: { _primary_term: 1 } + - match: { result: noop } + + - do: + update: + index: test_1 + type: test + id: 1 + body: + doc: { foo: bar } + detect_noop: false + + - match: { _seq_no: 1 } + - match: { _primary_term: 1 } + - match: { _version: 2 } + - match: { result: updated } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/20_doc_upsert.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/20_doc_upsert.yml new file mode 100644 index 0000000000000..a849eecc66629 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/20_doc_upsert.yml @@ -0,0 +1,40 @@ +--- +"Doc upsert": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + update: + index: test_1 + id: 1 + body: + doc: { foo: bar, count: 1 } + upsert: { foo: baz } + + - do: + get: + index: test_1 + id: 1 + + - match: { _source.foo: baz } + - is_false: _source.count + + + - do: + update: + index: test_1 + id: 1 + body: + doc: { foo: bar, count: 1 } + upsert: { foo: baz } + + - do: + get: + index: test_1 + id: 1 + + - match: { _source.foo: bar } + - match: { _source.count: 1 } + + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/21_doc_upsert_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/21_doc_upsert_with_types.yml new file mode 100644 index 0000000000000..f34e030ff66a0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/21_doc_upsert_with_types.yml @@ -0,0 +1,41 @@ +--- +"Doc upsert": + + - do: + update: + index: test_1 + type: test + id: 1 + body: + doc: { foo: bar, count: 1 } + upsert: { foo: baz } + + - do: + get: + index: test_1 + type: test + id: 1 + + - match: { _source.foo: baz } + - is_false: _source.count + + + - do: + update: + index: test_1 + type: test + id: 1 + body: + doc: { foo: bar, count: 1 } + upsert: { foo: baz } + + - do: + get: + index: test_1 + type: test + id: 1 + + - match: { _source.foo: bar } + - match: { _source.count: 1 } + + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/22_doc_as_upsert.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/22_doc_as_upsert.yml new file mode 100644 index 0000000000000..5bdc3ecea75fc --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/22_doc_as_upsert.yml @@ -0,0 +1,40 @@ +--- +"Doc as upsert": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + update: + index: test_1 + id: 1 + body: + doc: { foo: bar, count: 1 } + doc_as_upsert: true + + - do: + get: + index: test_1 + id: 1 + + - match: { _source.foo: bar } + - match: { _source.count: 1 } + + + - do: + update: + index: test_1 + id: 1 + body: + doc: { count: 2 } + doc_as_upsert: true + + - do: + get: + index: test_1 + id: 1 + + - match: { _source.foo: bar } + - match: { _source.count: 2 } + + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/24_doc_as_upsert_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/24_doc_as_upsert_with_types.yml new file mode 100644 index 0000000000000..7585b9f3e0b94 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/24_doc_as_upsert_with_types.yml @@ -0,0 +1,41 @@ +--- +"Doc as upsert": + + - do: + update: + index: test_1 + type: test + id: 1 + body: + doc: { foo: bar, count: 1 } + doc_as_upsert: true + + - do: + get: + index: test_1 + type: test + id: 1 + + - match: { _source.foo: bar } + - match: { _source.count: 1 } + + + - do: + update: + index: test_1 + type: test + id: 1 + body: + doc: { count: 2 } + doc_as_upsert: true + + - do: + get: + index: test_1 + type: test + id: 1 + + - match: { _source.foo: bar } + - match: { _source.count: 2 } + + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/35_if_seq_no.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/35_if_seq_no.yml new file mode 100644 index 0000000000000..f982adf693ad0 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/35_if_seq_no.yml @@ -0,0 +1,64 @@ +--- +"Update with if_seq_no": + + - skip: + version: " - 6.6.99" + reason: if_seq_no was added in 6.7.0 + + - do: + catch: missing + update: + index: test_1 + id: 1 + if_seq_no: 1 + if_primary_term: 1 + body: + doc: { foo: baz } + + - do: + index: + index: test_1 + id: 1 + body: + foo: baz + + - do: + catch: conflict + update: + index: test_1 + id: 1 + if_seq_no: 234 + if_primary_term: 1 + body: + doc: { foo: baz } + + - do: + update: + index: test_1 + id: 1 + if_seq_no: 0 + if_primary_term: 1 + body: + doc: { foo: bar } + + - do: + get: + index: test_1 + id: 1 + + - match: { _source: { foo: bar } } + + - do: + bulk: + body: + - update: + _index: test_1 + _id: 1 + if_seq_no: 100 + if_primary_term: 200 + - doc: + foo: baz + + - match: { errors: true } + - match: { items.0.update.status: 409 } + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/40_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/40_routing.yml new file mode 100644 index 0000000000000..6f43d381e0537 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/40_routing.yml @@ -0,0 +1,58 @@ +--- +"Routing": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + update: + index: test_1 + id: 1 + routing: 5 + body: + doc: { foo: baz } + upsert: { foo: bar } + + - do: + get: + index: test_1 + id: 1 + routing: 5 + stored_fields: _routing + + - match: { _routing: "5"} + + - do: + catch: missing + update: + index: test_1 + id: 1 + body: + doc: { foo: baz } + + - do: + update: + index: test_1 + id: 1 + routing: 5 + _source: foo + body: + doc: { foo: baz } + + - match: { get._source.foo: baz } + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/41_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/41_routing_with_types.yml new file mode 100644 index 0000000000000..977db506710c7 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/41_routing_with_types.yml @@ -0,0 +1,58 @@ +--- +"Routing": + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_shards: 5 + number_of_routing_shards: 5 + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: green + + - do: + update: + index: test_1 + type: test + id: 1 + routing: 5 + body: + doc: { foo: baz } + upsert: { foo: bar } + + - do: + get: + index: test_1 + type: test + id: 1 + routing: 5 + stored_fields: _routing + + - match: { _routing: "5"} + + - do: + catch: missing + update: + index: test_1 + type: test + id: 1 + body: + doc: { foo: baz } + + - do: + update: + index: test_1 + type: test + id: 1 + routing: 5 + _source: foo + body: + doc: { foo: baz } + + - match: { get._source.foo: baz } + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/60_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/60_refresh.yml new file mode 100644 index 0000000000000..3a74f75f4f11d --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/60_refresh.yml @@ -0,0 +1,123 @@ +--- +"Refresh": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + indices.create: + index: test_1 + body: + settings: + index.refresh_interval: -1 + number_of_replicas: 0 + + - do: + update: + index: test_1 + id: 1 + body: + doc: { foo: baz } + upsert: { foo: bar } + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 1 }} + + - match: { hits.total: 0 } + + - do: + update: + index: test_1 + id: 2 + refresh: true + body: + doc: { foo: baz } + upsert: { foo: bar } + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 2 }} + + - match: { hits.total: 1 } + +--- +"When refresh url parameter is an empty string that means \"refresh immediately\"": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: test_1 + id: 1 + refresh: true + body: { foo: bar } + - is_true: forced_refresh + + - do: + update: + index: test_1 + id: 1 + refresh: "" + body: + doc: {cat: dog} + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { cat: dog }} + + - match: { hits.total: 1 } + +--- +"refresh=wait_for waits until changes are visible in search": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + + - do: + index: + index: update_60_refresh_1 + id: update_60_refresh_id1 + body: { foo: bar } + refresh: true + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: update_60_refresh_1 + body: + query: { term: { _id: update_60_refresh_id1 }} + - match: { hits.total: 1 } + + - do: + update: + index: update_60_refresh_1 + id: update_60_refresh_id1 + refresh: wait_for + body: + doc: { test: asdf } + - is_false: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: update_60_refresh_1 + body: + query: { match: { test: asdf } } + - match: { hits.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/61_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/61_refresh_with_types.yml new file mode 100644 index 0000000000000..be2d9f9f7969e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/61_refresh_with_types.yml @@ -0,0 +1,115 @@ +--- +"Refresh": + + - do: + indices.create: + index: test_1 + body: + settings: + index.refresh_interval: -1 + number_of_replicas: 0 + + - do: + update: + index: test_1 + type: test + id: 1 + body: + doc: { foo: baz } + upsert: { foo: bar } + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 1 }} + + - match: { hits.total: 0 } + + - do: + update: + index: test_1 + type: test + id: 2 + refresh: true + body: + doc: { foo: baz } + upsert: { foo: bar } + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { _id: 2 }} + + - match: { hits.total: 1 } + +--- +"When refresh url parameter is an empty string that means \"refresh immediately\"": + - do: + index: + index: test_1 + type: test + id: 1 + refresh: true + body: { foo: bar } + - is_true: forced_refresh + + - do: + update: + index: test_1 + type: test + id: 1 + refresh: "" + body: + doc: {cat: dog} + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: test_1 + body: + query: { term: { cat: dog }} + + - match: { hits.total: 1 } + +--- +"refresh=wait_for waits until changes are visible in search": + - do: + index: + index: update_60_refresh_1 + type: test + id: update_60_refresh_id1 + body: { foo: bar } + refresh: true + - is_true: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: update_60_refresh_1 + body: + query: { term: { _id: update_60_refresh_id1 }} + - match: { hits.total: 1 } + + - do: + update: + index: update_60_refresh_1 + type: test + id: update_60_refresh_id1 + refresh: wait_for + body: + doc: { test: asdf } + - is_false: forced_refresh + + - do: + search: + rest_total_hits_as_int: true + index: update_60_refresh_1 + body: + query: { match: { test: asdf } } + - match: { hits.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/80_source_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/80_source_filtering.yml new file mode 100644 index 0000000000000..9e6d5a4671955 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/80_source_filtering.yml @@ -0,0 +1,21 @@ +--- +"Source filtering": + + - skip: + version: " - 6.99.99" + reason: types are required in requests before 7.0.0 + - do: + update: + index: test_1 + id: 1 + _source: [foo, bar] + body: + doc: { foo: baz } + upsert: { foo: bar } + + - match: { get._source.foo: bar } + - is_false: get._source.bar + +# TODO: +# +# - Add _routing diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/81_source_filtering_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/81_source_filtering_with_types.yml new file mode 100644 index 0000000000000..4bb22e6b8012e --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/81_source_filtering_with_types.yml @@ -0,0 +1,19 @@ +--- +"Source filtering": + + - do: + update: + index: test_1 + type: test + id: 1 + _source: [foo, bar] + body: + doc: { foo: baz } + upsert: { foo: bar } + + - match: { get._source.foo: bar } + - is_false: get._source.bar + +# TODO: +# +# - Add _routing diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/85_fields_meta.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/85_fields_meta.yml new file mode 100644 index 0000000000000..fe76ab5299cda --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/85_fields_meta.yml @@ -0,0 +1,31 @@ +--- +"Metadata Fields": + + - skip: + version: "all" + reason: "Update doesn't return metadata fields, waiting for #3259" + + - do: + indices.create: + index: test_1 + + - do: + update: + index: test_1 + id: 1 + parent: 5 + fields: [ _routing ] + body: + doc: { foo: baz } + upsert: { foo: bar } + + - match: { get._routing: "5" } + + - do: + get: + index: test_1 + id: 1 + parent: 5 + stored_fields: [ _routing ] + + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/86_fields_meta_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/86_fields_meta_with_types.yml new file mode 100644 index 0000000000000..f7791d0986399 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/86_fields_meta_with_types.yml @@ -0,0 +1,33 @@ +--- +"Metadata Fields": + + - skip: + version: "all" + reason: "Update doesn't return metadata fields, waiting for #3259" + + - do: + indices.create: + index: test_1 + + - do: + update: + index: test_1 + type: test + id: 1 + parent: 5 + fields: [ _routing ] + body: + doc: { foo: baz } + upsert: { foo: bar } + + - match: { get._routing: "5" } + + - do: + get: + index: test_1 + type: test + id: 1 + parent: 5 + stored_fields: [ _routing ] + + diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/90_error.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/90_error.yml new file mode 100644 index 0000000000000..9a48d24783b44 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/90_error.yml @@ -0,0 +1,13 @@ +--- +'Misspelled fields get "did you mean"': + - skip: + version: " - 7.5.99" + reason: Implemented in 7.6 + - do: + catch: /\[UpdateRequest\] unknown field \[dac\] did you mean \[doc\]\?/ + update: + index: test + id: 1 + body: + dac: { foo: baz } + upsert: { foo: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/90_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/90_mix_typeless_typeful.yml new file mode 100644 index 0000000000000..0ca25e8598c24 --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/90_mix_typeless_typeful.yml @@ -0,0 +1,86 @@ +--- +"Update with typeless API on an index that has types": + + - skip: + version: " - 6.99.99" + reason: Typeless APIs were introduced in 7.0.0 + + - do: + indices.create: # not using include_type_name: false on purpose + include_type_name: true + index: index + body: + mappings: + not_doc: + properties: + foo: + type: "keyword" + + - do: + index: + index: index + type: not_doc + id: 1 + body: { foo: bar } + + - do: + update: + index: index + id: 1 + body: + doc: + foo: baz + + - do: + get: + index: index + type: not_doc + id: 1 + + - match: { _source.foo: baz } + +--- +"Update call that introduces new field mappings": + + - skip: + version: " - 6.99.99" + reason: Typeless APIs were introduced in 7.0.0 + + - do: + indices.create: # not using include_type_name: false on purpose + include_type_name: true + index: index + body: + mappings: + not_doc: + properties: + foo: + type: "keyword" + + - do: + index: + index: index + type: not_doc + id: 1 + body: { foo: bar } + + - do: + update: + index: index + id: 1 + body: + doc: + foo: baz + new_field: value + - do: + get: # using typeful API on purpose + index: index + type: not_doc + id: 1 + + - match: { _index: "index" } + - match: { _type: "not_doc" } + - match: { _id: "1" } + - match: { _version: 2} + - match: { _source.foo: baz } + - match: { _source.new_field: value } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/update/TODO.txt new file mode 100644 index 0000000000000..10d4cc8106ccf --- /dev/null +++ b/rest-api-spec/out/production/resources/rest-api-spec/test/update/TODO.txt @@ -0,0 +1,5 @@ +Tests missing for: + +# consistency +# retry_on_conflict +# timeout diff --git a/server/src/main/java/org/elasticsearch/rest/BaseRestHandler.java b/server/src/main/java/org/elasticsearch/rest/BaseRestHandler.java index 4e87f3acec2a5..101c3182fbb62 100644 --- a/server/src/main/java/org/elasticsearch/rest/BaseRestHandler.java +++ b/server/src/main/java/org/elasticsearch/rest/BaseRestHandler.java @@ -51,13 +51,6 @@ */ public abstract class BaseRestHandler implements RestHandler { - /** - * Parameter that controls whether certain REST apis should include type names in their requests or responses. - * Note: Support for this parameter will be removed after the transition period to typeless APIs. - */ - public static final String INCLUDE_TYPE_NAME_PARAMETER = "include_type_name"; - public static final boolean DEFAULT_INCLUDE_TYPE_NAME_POLICY = false; - public static final Setting MULTI_ALLOW_EXPLICIT_INDEX = Setting.boolSetting("rest.action.multi.allow_explicit_index", true, Property.NodeScope); diff --git a/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java b/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java index 0d6233e62f925..ce3229ee30547 100644 --- a/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java +++ b/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java @@ -19,11 +19,14 @@ package org.elasticsearch.rest; +import org.elasticsearch.Version; import org.elasticsearch.common.Nullable; +import org.elasticsearch.common.collect.Tuple; import java.util.HashMap; import java.util.Map; import java.util.Set; +import java.util.stream.Collectors; /** * Encapsulate multiple handlers for the same path, allowing different handlers for different HTTP verbs. @@ -31,13 +34,14 @@ final class MethodHandlers { private final String path; - private final Map methodHandlers; + //TODO maybe we should aim for having a type for version instead of string/byte + private final Map, RestHandler> methodHandlers; - MethodHandlers(String path, RestHandler handler, RestRequest.Method... methods) { + MethodHandlers(String path, RestHandler handler, String version, RestRequest.Method... methods) { this.path = path; this.methodHandlers = new HashMap<>(methods.length); for (RestRequest.Method method : methods) { - methodHandlers.put(method, handler); + methodHandlers.put(Tuple.tuple(method, version), handler); } } @@ -45,9 +49,9 @@ final class MethodHandlers { * Add a handler for an additional array of methods. Note that {@code MethodHandlers} * does not allow replacing the handler for an already existing method. */ - MethodHandlers addMethods(RestHandler handler, RestRequest.Method... methods) { + MethodHandlers addMethods(RestHandler handler, String version, RestRequest.Method... methods) { for (RestRequest.Method method : methods) { - RestHandler existing = methodHandlers.putIfAbsent(method, handler); + RestHandler existing = methodHandlers.putIfAbsent(Tuple.tuple(method, version), handler); if (existing != null) { throw new IllegalArgumentException("Cannot replace existing handler for [" + path + "] for method: " + method); } @@ -63,10 +67,17 @@ RestHandler getHandler(RestRequest.Method method) { return methodHandlers.get(method); } + @Nullable + RestHandler getHandler(RestRequest.Method method, String version) { + return methodHandlers.get(Tuple.tuple(method,version)); + } + /** * Return a set of all valid HTTP methods for the particular path */ Set getValidMethods() { - return methodHandlers.keySet(); + return methodHandlers.keySet().stream() + .map(Tuple::v1) + .collect(Collectors.toSet()); } } diff --git a/server/src/main/java/org/elasticsearch/rest/RestController.java b/server/src/main/java/org/elasticsearch/rest/RestController.java index 9d6773afddd59..ec33f73f4e7fe 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestController.java +++ b/server/src/main/java/org/elasticsearch/rest/RestController.java @@ -23,6 +23,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.Version; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Strings; @@ -149,9 +150,10 @@ protected void registerHandler(RestRequest.Method method, String path, RestHandl if (handler instanceof BaseRestHandler) { usageService.addRestHandler((BaseRestHandler) handler); } + final String version = handler.compatibleWithVersion(); final RestHandler maybeWrappedHandler = handlerWrapper.apply(handler); - handlers.insertOrUpdate(path, new MethodHandlers(path, maybeWrappedHandler, method), - (mHandlers, newMHandler) -> mHandlers.addMethods(maybeWrappedHandler, method)); + handlers.insertOrUpdate(path, new MethodHandlers(path, maybeWrappedHandler, version, method), + (mHandlers, newMHandler) -> mHandlers.addMethods(maybeWrappedHandler, version, method)); } /** @@ -303,6 +305,11 @@ private void tryAllHandlers(final RestRequest request, final RestChannel channel final String rawPath = request.rawPath(); final String uri = request.uri(); + //TODO the problem with string, byte, null .. this should be more consistent + String compatibleWithVersion = request.param(CompatibleConstants.COMPATIBLE_PARAMS_KEY); + if(compatibleWithVersion == null){ + compatibleWithVersion=""+Version.CURRENT.major; + } final RestRequest.Method requestMethod; try { // Resolves the HTTP method and fails if the method is invalid @@ -315,20 +322,14 @@ private void tryAllHandlers(final RestRequest request, final RestChannel channel if (handlers == null) { handler = null; } else { - handler = handlers.getHandler(requestMethod); + handler = handlers.getHandler(requestMethod, compatibleWithVersion); } if (handler == null) { if (handleNoHandlerFound(rawPath, requestMethod, uri, channel)) { return; } } else { - if(handler.compatibilityRequired() == false //regular (not removed) handlers are always dispatched - //handlers that were registered compatible, require request to be compatible - || request.isCompatible(CompatibleConstants.COMPATIBLE_VERSION)) { - dispatchRequest(request, channel, handler); - } else { - handleBadRequest(uri, requestMethod, channel); - } + dispatchRequest(request, channel, handler); return; } } diff --git a/server/src/main/java/org/elasticsearch/rest/RestHandler.java b/server/src/main/java/org/elasticsearch/rest/RestHandler.java index 58c452897308e..2bd2bdc4ead48 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestHandler.java +++ b/server/src/main/java/org/elasticsearch/rest/RestHandler.java @@ -19,6 +19,7 @@ package org.elasticsearch.rest; +import org.elasticsearch.Version; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.xcontent.XContent; import org.elasticsearch.rest.RestRequest.Method; @@ -89,8 +90,8 @@ default List replacedRoutes() { return Collections.emptyList(); } - default boolean compatibilityRequired(){ - return false; + default String compatibleWithVersion(){ + return ""+ Version.CURRENT.major; } class Route { diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java index d6af4fa872b83..3519fe48f6a8a 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java @@ -19,7 +19,6 @@ package org.elasticsearch.rest.action.admin.indices; -import org.elasticsearch.Version; import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.client.node.NodeClient; @@ -31,7 +30,6 @@ import org.elasticsearch.rest.action.RestToXContentListener; import java.io.IOException; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -59,13 +57,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC if (request.hasContent()) { Map sourceAsMap = XContentHelper.convertToMap(request.requiredContent(), false, request.getXContentType()).v2(); - if(isV7Compatible(request)){ - request.param(INCLUDE_TYPE_NAME_PARAMETER);//just consume, it is not replaced with _doc - sourceAsMap = prepareMappingsV7(sourceAsMap, request); - }else { - sourceAsMap = prepareMappings(sourceAsMap); - } - + sourceAsMap = prepareMappings(sourceAsMap); createIndexRequest.source(sourceAsMap, LoggingDeprecationHandler.INSTANCE); } @@ -75,9 +67,6 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC return channel -> client.admin().indices().create(createIndexRequest, new RestToXContentListener<>(channel)); } - private boolean isV7Compatible(RestRequest request) { - return request.isCompatible(""+ Version.V_7_0_0.major); - } static Map prepareMappings(Map source) { if (source.containsKey("mappings") == false @@ -96,26 +85,4 @@ static Map prepareMappings(Map source) { newSource.put("mappings", singletonMap(MapperService.SINGLE_MAPPING_NAME, mappings)); return newSource; } - - static Map prepareMappingsV7(Map source, RestRequest request) { - final boolean includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, - DEFAULT_INCLUDE_TYPE_NAME_POLICY); - - @SuppressWarnings("unchecked") - Map mappings = (Map) source.get("mappings"); - - if (includeTypeName && mappings.size() == 1) { - //no matter what the type was, replace it with _doc - Map newSource = new HashMap<>(); - - String typeName = mappings.keySet().iterator().next(); - @SuppressWarnings("unchecked") - Map typedMappings = (Map) mappings.get(typeName); - - newSource.put("mappings", Collections.singletonMap(MapperService.SINGLE_MAPPING_NAME, typedMappings)); - return newSource; - }else{ - return prepareMappings(source); - } - } } diff --git a/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java b/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java index 0d51a0fcdbaeb..fa59e8246537d 100644 --- a/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java +++ b/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java @@ -127,7 +127,7 @@ public MethodHandlers next() { assertEquals("true", threadContext.getHeader("header.1")); assertEquals("true", threadContext.getHeader("header.2")); assertNull(threadContext.getHeader("header.3")); - }, RestRequest.Method.GET); + },"" + Version.CURRENT.major, RestRequest.Method.GET); } }); AssertingChannel channel = new AssertingChannel(fakeRequest, false, RestStatus.BAD_REQUEST); @@ -649,8 +649,8 @@ public boolean supportsContentStream() { } @Override - public boolean compatibilityRequired() { - return true; + public String compatibleWithVersion() { + return "7"; } }); diff --git a/x-pack/plugin/core/out/production/resources/ilm-history-ilm-policy.json b/x-pack/plugin/core/out/production/resources/ilm-history-ilm-policy.json new file mode 100644 index 0000000000000..febae00bc3608 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/ilm-history-ilm-policy.json @@ -0,0 +1,18 @@ +{ + "phases": { + "hot": { + "actions": { + "rollover": { + "max_size": "50GB", + "max_age": "30d" + } + } + }, + "delete": { + "min_age": "90d", + "actions": { + "delete": {} + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/ilm-history.json b/x-pack/plugin/core/out/production/resources/ilm-history.json new file mode 100644 index 0000000000000..bb79af74f2034 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/ilm-history.json @@ -0,0 +1,85 @@ +{ + "index_patterns": [ + "ilm-history-${xpack.ilm_history.template.version}*" + ], + "order": 2147483647, + "settings": { + "index.number_of_shards": 1, + "index.number_of_replicas": 0, + "index.auto_expand_replicas": "0-1", + "index.lifecycle.name": "ilm-history-ilm-policy", + "index.lifecycle.rollover_alias": "ilm-history-${xpack.ilm_history.template.version}", + "index.hidden": true, + "index.format": 1 + }, + "mappings": { + "_doc": { + "dynamic": false, + "properties": { + "@timestamp": { + "type": "date", + "format": "epoch_millis" + }, + "policy": { + "type": "keyword" + }, + "index": { + "type": "keyword" + }, + "index_age":{ + "type": "long" + }, + "success": { + "type": "boolean" + }, + "state": { + "type": "object", + "dynamic": true, + "properties": { + "phase": { + "type": "keyword" + }, + "action": { + "type": "keyword" + }, + "step": { + "type": "keyword" + }, + "failed_step": { + "type": "keyword" + }, + "is_auto-retryable_error": { + "type": "keyword" + }, + "creation_date": { + "type": "date", + "format": "epoch_millis" + }, + "phase_time": { + "type": "date", + "format": "epoch_millis" + }, + "action_time": { + "type": "date", + "format": "epoch_millis" + }, + "step_time": { + "type": "date", + "format": "epoch_millis" + }, + "phase_definition": { + "type": "text" + }, + "step_info": { + "type": "text" + } + } + }, + "error_details": { + "type": "text" + } + } + } + }, + "version": ${xpack.ilm_history.template.version} +} diff --git a/x-pack/plugin/core/out/production/resources/logstash-management.json b/x-pack/plugin/core/out/production/resources/logstash-management.json new file mode 100644 index 0000000000000..d9528238dc0fb --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/logstash-management.json @@ -0,0 +1,50 @@ +{ + "index_patterns" : [ ".logstash" ], + "settings": { + "index": { + "number_of_shards": 1, + "auto_expand_replicas": "0-1", + "codec": "best_compression" + } + }, + "mappings" : { + "_doc" : { + "_meta": { + "logstash-version": "${logstash.template.version}" + }, + "dynamic": "strict", + "properties":{ + "description":{ + "type":"text" + }, + "last_modified":{ + "type":"date" + }, + "pipeline_metadata":{ + "properties":{ + "version":{ + "type":"short" + }, + "type":{ + "type":"keyword" + } + } + }, + "pipeline":{ + "type":"text" + }, + "pipeline_settings": { + "dynamic": false, + "type": "object" + }, + "username":{ + "type":"keyword" + }, + "metadata":{ + "type":"object", + "dynamic":false + } + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/monitoring-alerts-7.json b/x-pack/plugin/core/out/production/resources/monitoring-alerts-7.json new file mode 100644 index 0000000000000..f458ae6ad85ff --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/monitoring-alerts-7.json @@ -0,0 +1,60 @@ +{ + "index_patterns": [ ".monitoring-alerts-${monitoring.template.version}" ], + "version": 7000199, + "settings": { + "index": { + "number_of_shards": 1, + "number_of_replicas": 0, + "auto_expand_replicas": "0-1", + "format": 7, + "codec": "best_compression" + } + }, + "mappings": { + "_doc": { + "dynamic": false, + "properties": { + "timestamp": { + "type": "date" + }, + "update_timestamp": { + "type": "date" + }, + "resolved_timestamp": { + "type": "date" + }, + "prefix": { + "type": "text" + }, + "message": { + "type": "text" + }, + "suffix": { + "type": "text" + }, + "metadata": { + "properties": { + "cluster_uuid": { + "type": "keyword" + }, + "link": { + "type": "keyword" + }, + "severity": { + "type": "short" + }, + "type": { + "type": "keyword" + }, + "version": { + "type": "keyword" + }, + "watch": { + "type": "keyword" + } + } + } + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/monitoring-beats.json b/x-pack/plugin/core/out/production/resources/monitoring-beats.json new file mode 100644 index 0000000000000..2f9bc84238ee9 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/monitoring-beats.json @@ -0,0 +1,719 @@ +{ + "index_patterns": [ + ".monitoring-beats-${monitoring.template.version}-*" + ], + "settings": { + "index.auto_expand_replicas": "0-1", + "index.codec": "best_compression", + "index.format": 7, + "index.number_of_replicas": 0, + "index.number_of_shards": 1 + }, + "version": 7000199, + "mappings": { + "_doc": { + "dynamic": false, + "properties": { + "beats_state": { + "properties": { + "beat": { + "properties": { + "host": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "uuid": { + "type": "keyword" + }, + "version": { + "type": "keyword" + } + } + }, + "state": { + "properties": { + "beat": { + "properties": { + "name": { + "type": "keyword" + } + } + }, + "host": { + "properties": { + "architecture": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "hostname": { + "type": "keyword" + }, + "os": { + "properties": { + "build": { + "type": "keyword" + }, + "family": { + "type": "keyword" + }, + "platform": { + "type": "keyword" + }, + "version": { + "type": "keyword" + } + } + } + } + }, + "input": { + "properties": { + "count": { + "type": "long" + }, + "names": { + "type": "keyword" + } + } + }, + "module": { + "properties": { + "count": { + "type": "long" + }, + "names": { + "type": "keyword" + } + } + }, + "output": { + "properties": { + "name": { + "type": "keyword" + } + } + }, + "service": { + "properties": { + "id": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "version": { + "type": "keyword" + } + } + } + } + }, + "timestamp": { + "format": "date_time", + "type": "date" + } + } + }, + "beats_stats": { + "properties": { + "beat": { + "properties": { + "host": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "uuid": { + "type": "keyword" + }, + "version": { + "type": "keyword" + } + } + }, + "metrics": { + "properties": { + "beat": { + "properties": { + "cpu": { + "properties": { + "system": { + "properties": { + "ticks": { + "type": "long" + }, + "time": { + "properties": { + "ms": { + "type": "long" + } + } + } + } + }, + "total": { + "properties": { + "value": { + "type": "long" + }, + "ticks": { + "type": "long" + }, + "time": { + "properties": { + "ms": { + "type": "long" + } + } + } + } + }, + "user": { + "properties": { + "ticks": { + "type": "long" + }, + "time": { + "properties": { + "ms": { + "type": "long" + } + } + } + } + } + } + }, + "info": { + "properties": { + "ephemeral_id": { + "type": "keyword" + }, + "uptime": { + "properties": { + "ms": { + "type": "long" + } + } + } + } + }, + "memstats": { + "properties": { + "gc_next": { + "type": "long" + }, + "memory_alloc": { + "type": "long" + }, + "memory_total": { + "type": "long" + }, + "rss": { + "type": "long" + } + } + }, + "handles": { + "properties": { + "open": { + "type": "long" + }, + "limit": { + "properties": { + "hard": { + "type": "long" + }, + "soft": { + "type": "long" + } + } + } + } + } + } + }, + "apm-server": { + "properties": { + "server": { + "properties": { + "request": { + "properties": { + "count": { + "type": "long" + } + } + }, + "concurrent": { + "properties": { + "wait": { + "properties": { + "ms": { + "type": "long" + } + } + } + } + }, + "response": { + "properties": { + "count": { + "type": "long" + }, + "errors": { + "properties": { + "count": { + "type": "long" + }, + "toolarge": { + "type": "long" + }, + "validate": { + "type": "long" + }, + "ratelimit": { + "type": "long" + }, + "queue": { + "type": "long" + }, + "closed": { + "type": "long" + }, + "forbidden": { + "type": "long" + }, + "concurrency": { + "type": "long" + }, + "unauthorized": { + "type": "long" + }, + "internal": { + "type": "long" + }, + "decode": { + "type": "long" + }, + "method": { + "type": "long" + } + } + }, + "valid": { + "properties": { + "ok": { + "type": "long" + }, + "accepted": { + "type": "long" + }, + "count": { + "type": "long" + } + } + } + } + } + } + }, + "decoder": { + "properties": { + "deflate": { + "properties": { + "content-length": { + "type": "long" + }, + "count": { + "type": "long" + } + } + }, + "gzip": { + "properties": { + "content-length": { + "type": "long" + }, + "count": { + "type": "long" + } + } + }, + "uncompressed": { + "properties": { + "content-length": { + "type": "long" + }, + "count": { + "type": "long" + } + } + }, + "reader": { + "properties": { + "size": { + "type": "long" + }, + "count": { + "type": "long" + } + } + }, + "missing-content-length": { + "properties": { + "count": { + "type": "long" + } + } + } + } + + }, + "processor": { + "properties": { + "metric": { + "properties": { + "decoding": { + "properties": { + "errors": { + "type": "long" + }, + "count": { + "type": "long" + } + } + }, + "validation": { + "properties": { + "errors": { + "type": "long" + }, + "count": { + "type": "long" + } + } + }, + "transformations": { + "type": "long" + } + } + }, + "sourcemap": { + "properties": { + "counter": { + "type": "long" + }, + "decoding": { + "properties": { + "errors": { + "type": "long" + }, + "count": { + "type": "long" + } + } + }, + "validation": { + "properties": { + "errors": { + "type": "long" + }, + "count": { + "type": "long" + } + } + } + } + }, + "transaction": { + "properties": { + "decoding": { + "properties": { + "errors": { + "type": "long" + }, + "count": { + "type": "long" + } + } + }, + "validation": { + "properties": { + "errors": { + "type": "long" + }, + "count": { + "type": "long" + } + } + }, + "transformations": { + "type": "long" + }, + "transactions": { + "type": "long" + }, + "spans": { + "type": "long" + }, + "stacktraces": { + "type": "long" + }, + "frames": { + "type": "long" + } + } + }, + "error": { + "properties": { + "decoding": { + "properties": { + "errors": { + "type": "long" + }, + "count": { + "type": "long" + } + } + }, + "validation": { + "properties": { + "errors": { + "type": "long" + }, + "count": { + "type": "long" + } + } + }, + "transformations": { + "type": "long" + }, + "errors": { + "type": "long" + }, + "stacktraces": { + "type": "long" + }, + "frames": { + "type": "long" + } + } + }, + "span": { + "properties": { + "transformations": { + "type": "long" + } + } + } + } + } + } + }, + "libbeat": { + "properties": { + "config": { + "properties": { + "module": { + "properties": { + "running": { + "type": "long" + }, + "starts": { + "type": "long" + }, + "stops": { + "type": "long" + } + } + }, + "reloads": { + "type": "long" + } + } + }, + "output": { + "properties": { + "events": { + "properties": { + "acked": { + "type": "long" + }, + "active": { + "type": "long" + }, + "batches": { + "type": "long" + }, + "dropped": { + "type": "long" + }, + "duplicates": { + "type": "long" + }, + "failed": { + "type": "long" + }, + "total": { + "type": "long" + }, + "toomany": { + "type": "long" + } + } + }, + "read": { + "properties": { + "bytes": { + "type": "long" + }, + "errors": { + "type": "long" + } + } + }, + "type": { + "type": "keyword" + }, + "write": { + "properties": { + "bytes": { + "type": "long" + }, + "errors": { + "type": "long" + } + } + } + } + }, + "pipeline": { + "properties": { + "clients": { + "type": "long" + }, + "events": { + "properties": { + "active": { + "type": "long" + }, + "dropped": { + "type": "long" + }, + "failed": { + "type": "long" + }, + "filtered": { + "type": "long" + }, + "published": { + "type": "long" + }, + "retry": { + "type": "long" + }, + "total": { + "type": "long" + } + } + }, + "queue": { + "properties": { + "acked": { + "type": "long" + } + } + } + } + } + } + }, + "system": { + "properties": { + "load": { + "properties": { + "1": { + "type": "double" + }, + "15": { + "type": "double" + }, + "5": { + "type": "double" + }, + "norm": { + "properties": { + "1": { + "type": "double" + }, + "15": { + "type": "double" + }, + "5": { + "type": "double" + } + } + } + } + } + } + } + } + }, + "tags": { + "type": "keyword" + }, + "timestamp": { + "format": "date_time", + "type": "date" + } + } + }, + "cluster_uuid": { + "type": "keyword" + }, + "interval_ms": { + "type": "long" + }, + "source_node": { + "properties": { + "host": { + "type": "keyword" + }, + "ip": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "transport_address": { + "type": "keyword" + }, + "uuid": { + "type": "keyword" + } + } + }, + "timestamp": { + "format": "date_time", + "type": "date" + }, + "type": { + "type": "keyword" + } + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/monitoring-es.json b/x-pack/plugin/core/out/production/resources/monitoring-es.json new file mode 100644 index 0000000000000..fb7d2d7764a90 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/monitoring-es.json @@ -0,0 +1,1156 @@ +{ + "index_patterns": [ ".monitoring-es-${monitoring.template.version}-*" ], + "version": 7000199, + "settings": { + "index.number_of_shards": 1, + "index.number_of_replicas": 0, + "index.auto_expand_replicas": "0-1", + "index.format": 7, + "index.codec": "best_compression" + }, + "mappings": { + "_doc": { + "date_detection": false, + "dynamic": false, + "properties": { + "cluster_uuid": { + "type": "keyword" + }, + "state_uuid": { + "type": "keyword" + }, + "timestamp": { + "type": "date", + "format": "date_time" + }, + "interval_ms": { + "type": "long" + }, + "type": { + "type": "keyword" + }, + "source_node": { + "properties": { + "uuid": { + "type": "keyword" + }, + "host": { + "type": "keyword" + }, + "transport_address": { + "type": "keyword" + }, + "ip": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "timestamp": { + "type": "date", + "format": "date_time" + } + } + }, + "indices_stats": { + "properties": { + "_all": { + "properties": { + "primaries": { + "properties": { + "docs": { + "properties": { + "count": { + "type": "long" + } + } + }, + "indexing": { + "properties": { + "index_total": { + "type": "long" + }, + "index_time_in_millis": { + "type": "long" + } + } + }, + "search": { + "properties": { + "query_total": { + "type": "long" + }, + "query_time_in_millis": { + "type": "long" + } + } + } + } + }, + "total": { + "properties": { + "docs": { + "properties": { + "count": { + "type": "long" + } + } + }, + "indexing": { + "properties": { + "index_total": { + "type": "long" + }, + "index_time_in_millis": { + "type": "long" + } + } + }, + "search": { + "properties": { + "query_total": { + "type": "long" + }, + "query_time_in_millis": { + "type": "long" + } + } + } + } + } + } + } + } + }, + "index_stats": { + "properties": { + "index": { + "type": "keyword" + }, + "primaries": { + "properties": { + "docs": { + "properties": { + "count": { + "type": "long" + } + } + }, + "fielddata" : { + "properties": { + "memory_size_in_bytes": { + "type": "long" + }, + "evictions": { + "type": "long" + } + } + }, + "store": { + "properties": { + "size_in_bytes": { + "type": "long" + } + } + }, + "indexing": { + "properties": { + "index_total": { + "type": "long" + }, + "index_time_in_millis": { + "type": "long" + }, + "throttle_time_in_millis": { + "type": "long" + } + } + }, + "merges": { + "properties": { + "total_size_in_bytes": { + "type": "long" + } + } + }, + "query_cache": { + "properties": { + "memory_size_in_bytes": { + "type": "long" + }, + "evictions": { + "type": "long" + }, + "hit_count": { + "type": "long" + }, + "miss_count": { + "type": "long" + } + } + }, + "request_cache": { + "properties": { + "memory_size_in_bytes": { + "type": "long" + }, + "evictions": { + "type": "long" + }, + "hit_count": { + "type": "long" + }, + "miss_count": { + "type": "long" + } + } + }, + "search": { + "properties": { + "query_total": { + "type": "long" + }, + "query_time_in_millis": { + "type": "long" + } + } + }, + "segments": { + "properties": { + "count": { + "type": "integer" + }, + "memory_in_bytes": { + "type": "long" + }, + "terms_memory_in_bytes": { + "type": "long" + }, + "points_memory_in_bytes": { + "type": "long" + }, + "stored_fields_memory_in_bytes": { + "type": "long" + }, + "term_vectors_memory_in_bytes": { + "type": "long" + }, + "norms_memory_in_bytes": { + "type": "long" + }, + "doc_values_memory_in_bytes": { + "type": "long" + }, + "index_writer_memory_in_bytes": { + "type": "long" + }, + "version_map_memory_in_bytes": { + "type": "long" + }, + "fixed_bit_set_memory_in_bytes": { + "type": "long" + } + } + }, + "refresh": { + "properties": { + "total_time_in_millis": { + "type": "long" + } + } + } + } + }, + "total": { + "properties": { + "docs": { + "properties": { + "count": { + "type": "long" + } + } + }, + "fielddata" : { + "properties": { + "memory_size_in_bytes": { + "type": "long" + }, + "evictions": { + "type": "long" + } + } + }, + "store": { + "properties": { + "size_in_bytes": { + "type": "long" + } + } + }, + "indexing": { + "properties": { + "index_total": { + "type": "long" + }, + "index_time_in_millis": { + "type": "long" + }, + "throttle_time_in_millis": { + "type": "long" + } + } + }, + "merges": { + "properties": { + "total_size_in_bytes": { + "type": "long" + } + } + }, + "query_cache": { + "properties": { + "memory_size_in_bytes": { + "type": "long" + }, + "evictions": { + "type": "long" + }, + "hit_count": { + "type": "long" + }, + "miss_count": { + "type": "long" + } + } + }, + "request_cache": { + "properties": { + "memory_size_in_bytes": { + "type": "long" + }, + "evictions": { + "type": "long" + }, + "hit_count": { + "type": "long" + }, + "miss_count": { + "type": "long" + } + } + }, + "search": { + "properties": { + "query_total": { + "type": "long" + }, + "query_time_in_millis": { + "type": "long" + } + } + }, + "segments": { + "properties": { + "count": { + "type": "integer" + }, + "memory_in_bytes": { + "type": "long" + }, + "terms_memory_in_bytes": { + "type": "long" + }, + "points_memory_in_bytes": { + "type": "long" + }, + "stored_fields_memory_in_bytes": { + "type": "long" + }, + "term_vectors_memory_in_bytes": { + "type": "long" + }, + "norms_memory_in_bytes": { + "type": "long" + }, + "doc_values_memory_in_bytes": { + "type": "long" + }, + "index_writer_memory_in_bytes": { + "type": "long" + }, + "version_map_memory_in_bytes": { + "type": "long" + }, + "fixed_bit_set_memory_in_bytes": { + "type": "long" + } + } + }, + "refresh": { + "properties": { + "total_time_in_millis": { + "type": "long" + } + } + } + } + } + } + }, + "cluster_stats": { + "properties": { + "nodes": { + "type": "object" + }, + "indices": { + "type": "object" + } + } + }, + "cluster_state": { + "properties": { + "version": { + "type": "long" + }, + "nodes_hash": { + "type": "integer" + }, + "master_node": { + "type": "keyword" + }, + "state_uuid": { + "type": "keyword" + }, + "status": { + "type": "keyword" + }, + "nodes": { + "type": "object" + }, + "shards": { + "type": "object" + } + } + }, + "node_stats": { + "properties": { + "node_id": { + "type": "keyword" + }, + "node_master": { + "type": "boolean" + }, + "mlockall": { + "type": "boolean" + }, + "indices": { + "properties": { + "docs": { + "properties": { + "count": { + "type": "long" + } + } + }, + "fielddata" : { + "properties": { + "memory_size_in_bytes": { + "type": "long" + }, + "evictions": { + "type": "long" + } + } + }, + "indexing": { + "properties": { + "index_time_in_millis": { + "type": "long" + }, + "index_total": { + "type": "long" + }, + "throttle_time_in_millis": { + "type": "long" + } + } + }, + "query_cache": { + "properties": { + "memory_size_in_bytes": { + "type": "long" + }, + "evictions": { + "type": "long" + }, + "hit_count": { + "type": "long" + }, + "miss_count": { + "type": "long" + } + } + }, + "request_cache": { + "properties": { + "memory_size_in_bytes": { + "type": "long" + }, + "evictions": { + "type": "long" + }, + "hit_count": { + "type": "long" + }, + "miss_count": { + "type": "long" + } + } + }, + "search": { + "properties": { + "query_time_in_millis": { + "type": "long" + }, + "query_total": { + "type": "long" + } + } + }, + "segments": { + "properties": { + "count": { + "type": "integer" + }, + "memory_in_bytes": { + "type": "long" + }, + "terms_memory_in_bytes": { + "type": "long" + }, + "points_memory_in_bytes": { + "type": "long" + }, + "stored_fields_memory_in_bytes": { + "type": "long" + }, + "term_vectors_memory_in_bytes": { + "type": "long" + }, + "norms_memory_in_bytes": { + "type": "long" + }, + "doc_values_memory_in_bytes": { + "type": "long" + }, + "index_writer_memory_in_bytes": { + "type": "long" + }, + "version_map_memory_in_bytes": { + "type": "long" + }, + "fixed_bit_set_memory_in_bytes": { + "type": "long" + } + } + }, + "store": { + "properties": { + "size_in_bytes": { + "type": "long" + } + } + } + } + }, + "fs": { + "properties": { + "total": { + "properties": { + "total_in_bytes": { + "type": "long" + }, + "free_in_bytes": { + "type": "long" + }, + "available_in_bytes": { + "type": "long" + } + } + }, + "data": { + "properties": { + "spins": { + "type": "boolean" + } + } + }, + "io_stats": { + "properties": { + "total": { + "properties": { + "operations": { + "type": "long" + }, + "read_operations": { + "type": "long" + }, + "write_operations": { + "type": "long" + }, + "read_kilobytes": { + "type": "long" + }, + "write_kilobytes": { + "type": "long" + } + } + } + } + } + } + }, + "os": { + "properties": { + "cgroup": { + "properties": { + "cpuacct": { + "properties": { + "control_group": { + "type": "keyword" + }, + "usage_nanos": { + "type": "long" + } + } + }, + "cpu": { + "properties": { + "cfs_quota_micros": { + "type": "long" + }, + "control_group": { + "type": "keyword" + }, + "stat": { + "properties": { + "number_of_elapsed_periods": { + "type": "long" + }, + "number_of_times_throttled": { + "type": "long" + }, + "time_throttled_nanos": { + "type": "long" + } + } + } + } + }, + "memory": { + "properties": { + "control_group": { + "type": "keyword" + }, + "limit_in_bytes": { + "type": "keyword" + }, + "usage_in_bytes": { + "type": "keyword" + } + } + } + } + }, + "cpu": { + "properties": { + "load_average": { + "properties": { + "1m": { + "type": "half_float" + }, + "5m": { + "type": "half_float" + }, + "15m": { + "type": "half_float" + } + } + } + } + } + } + }, + "process": { + "properties": { + "open_file_descriptors": { + "type": "long" + }, + "max_file_descriptors": { + "type": "long" + }, + "cpu": { + "properties": { + "percent": { + "type": "half_float" + } + } + } + } + }, + "jvm": { + "properties": { + "mem": { + "properties": { + "heap_used_in_bytes": { + "type": "long" + }, + "heap_used_percent": { + "type": "half_float" + }, + "heap_max_in_bytes": { + "type": "long" + } + } + }, + "gc": { + "properties": { + "collectors": { + "properties": { + "young": { + "properties": { + "collection_count": { + "type": "long" + }, + "collection_time_in_millis": { + "type": "long" + } + } + }, + "old": { + "properties": { + "collection_count": { + "type": "long" + }, + "collection_time_in_millis": { + "type": "long" + } + } + } + } + } + } + } + } + }, + "thread_pool": { + "properties": { + "bulk": { + "properties": { + "threads": { + "type": "integer" + }, + "queue": { + "type": "integer" + }, + "rejected": { + "type": "long" + } + } + }, + "generic": { + "properties": { + "threads": { + "type": "integer" + }, + "queue": { + "type": "integer" + }, + "rejected": { + "type": "long" + } + } + }, + "get": { + "properties": { + "threads": { + "type": "integer" + }, + "queue": { + "type": "integer" + }, + "rejected": { + "type": "long" + } + } + }, + "index": { + "properties": { + "threads": { + "type": "integer" + }, + "queue": { + "type": "integer" + }, + "rejected": { + "type": "long" + } + } + }, + "management": { + "properties": { + "threads": { + "type": "integer" + }, + "queue": { + "type": "integer" + }, + "rejected": { + "type": "long" + } + } + }, + "search": { + "properties": { + "threads": { + "type": "integer" + }, + "queue": { + "type": "integer" + }, + "rejected": { + "type": "long" + } + } + }, + "watcher": { + "properties": { + "threads": { + "type": "integer" + }, + "queue": { + "type": "integer" + }, + "rejected": { + "type": "long" + } + } + }, + "write": { + "properties": { + "queue": { + "type": "integer" + }, + "rejected": { + "type": "long" + } + } + } + } + } + } + }, + "index_recovery": { + "type": "object" + }, + "shard": { + "properties": { + "state": { + "type": "keyword" + }, + "primary": { + "type": "boolean" + }, + "index": { + "type": "keyword" + }, + "relocating_node": { + "type": "keyword" + }, + "shard": { + "type": "long" + }, + "node": { + "type": "keyword" + } + } + }, + "job_stats": { + "properties": { + "job_id": { + "type": "keyword" + }, + "state": { + "type": "keyword" + }, + "data_counts": { + "properties": { + "input_bytes": { + "type": "long" + }, + "processed_record_count": { + "type": "long" + }, + "empty_bucket_count": { + "type": "long" + }, + "sparse_bucket_count": { + "type": "long" + }, + "bucket_count": { + "type": "long" + }, + "earliest_record_timestamp": { + "type": "date" + }, + "latest_record_timestamp": { + "type": "date" + } + } + }, + "model_size_stats": { + "properties": { + "model_bytes": { + "type": "long" + }, + "bucket_allocation_failures_count": { + "type": "long" + } + } + }, + "node": { + "properties": { + "id": { + "type": "keyword" + } + } + } + } + }, + "ccr_stats": { + "properties": { + "remote_cluster": { + "type": "keyword" + }, + "leader_index": { + "type": "keyword" + }, + "follower_index": { + "type": "keyword" + }, + "shard_id": { + "type": "integer" + }, + "leader_global_checkpoint": { + "type": "long" + }, + "leader_max_seq_no": { + "type": "long" + }, + "follower_global_checkpoint": { + "type": "long" + }, + "follower_max_seq_no": { + "type": "long" + }, + "last_requested_seq_no": { + "type": "long" + }, + "outstanding_read_requests": { + "type": "long" + }, + "outstanding_write_requests": { + "type": "long" + }, + "write_buffer_operation_count": { + "type": "long" + }, + "write_buffer_size_in_bytes": { + "type": "long" + }, + "follower_mapping_version": { + "type": "long" + }, + "follower_settings_version": { + "type": "long" + }, + "follower_aliases_version": { + "type": "long" + }, + "total_read_time_millis": { + "type": "long" + }, + "total_read_remote_exec_time_millis": { + "type": "long" + }, + "successful_read_requests": { + "type": "long" + }, + "failed_read_requests": { + "type": "long" + }, + "operations_read": { + "type": "long" + }, + "bytes_read": { + "type": "long" + }, + "total_write_time_millis": { + "type": "long" + }, + "successful_write_requests": { + "type": "long" + }, + "failed_write_requests": { + "type": "long" + }, + "operations_written": { + "type": "long" + }, + "read_exceptions": { + "type": "nested", + "properties": { + "from_seq_no": { + "type": "long" + }, + "retries": { + "type": "integer" + }, + "exception": { + "type": "object", + "properties": { + "type" : { + "type": "keyword" + }, + "reason": { + "type": "text" + } + } + } + } + }, + "time_since_last_read_millis": { + "type": "long" + }, + "fatal_exception": { + "type": "object", + "properties": { + "type" : { + "type": "keyword" + }, + "reason": { + "type": "text" + } + } + } + } + }, + "ccr_auto_follow_stats" : { + "properties": { + "number_of_failed_follow_indices": { + "type": "long" + }, + "number_of_failed_remote_cluster_state_requests": { + "type": "long" + }, + "number_of_successful_follow_indices": { + "type": "long" + }, + "recent_auto_follow_errors": { + "type": "nested", + "properties": { + "leader_index": { + "type": "keyword" + }, + "timestamp": { + "type": "long" + }, + "auto_follow_exception": { + "type": "object", + "properties": { + "type": { + "type": "keyword" + }, + "reason": { + "type": "text" + } + } + } + } + }, + "auto_followed_clusters": { + "type": "nested", + "properties": { + "cluster_name": { + "type": "keyword" + }, + "time_since_last_check_millis": { + "type": "long" + }, + "last_seen_metadata_version": { + "type": "long" + } + } + } + } + }, + "enrich_coordinator_stats" : { + "properties": { + "node_id": { + "type": "keyword" + }, + "queue_size": { + "type": "integer" + }, + "remote_requests_current" : { + "type": "long" + }, + "remote_requests_total" : { + "type": "long" + }, + "executed_searches_total" : { + "type": "long" + } + } + }, + "enrich_executing_policy_stats": { + "properties": { + "name": { + "type": "keyword" + }, + "task": { + "type": "object", + "properties": { + "node": { + "type": "keyword" + }, + "id": { + "type": "long" + }, + "type": { + "type": "keyword" + }, + "action": { + "type": "keyword" + }, + "description": { + "type": "keyword" + }, + "start_time_in_millis": { + "type": "date", + "format": "epoch_millis" + }, + "running_time_in_nanos": { + "type": "long" + }, + "cancellable": { + "type": "boolean" + } + } + } + } + } + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/monitoring-kibana.json b/x-pack/plugin/core/out/production/resources/monitoring-kibana.json new file mode 100644 index 0000000000000..6ae61f6d6c64b --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/monitoring-kibana.json @@ -0,0 +1,232 @@ +{ + "index_patterns": [ ".monitoring-kibana-${monitoring.template.version}-*" ], + "version": 7000199, + "settings": { + "index.number_of_shards": 1, + "index.number_of_replicas": 0, + "index.auto_expand_replicas": "0-1", + "index.format": 7, + "index.codec": "best_compression" + }, + "mappings": { + "_doc": { + "dynamic": false, + "properties": { + "cluster_uuid": { + "type": "keyword" + }, + "timestamp": { + "type": "date", + "format": "date_time" + }, + "interval_ms": { + "type": "long" + }, + "type": { + "type": "keyword" + }, + "source_node": { + "properties": { + "uuid": { + "type": "keyword" + }, + "host": { + "type": "keyword" + }, + "transport_address": { + "type": "keyword" + }, + "ip": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "timestamp": { + "type": "date", + "format": "date_time" + } + } + }, + "kibana_stats": { + "properties": { + "usage": { + "properties": { + "index": { + "type": "keyword" + } + } + }, + "kibana": { + "properties": { + "uuid": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "host": { + "type": "keyword" + }, + "transport_address": { + "type": "keyword" + }, + "version": { + "type": "keyword" + }, + "snapshot": { + "type": "boolean" + }, + "status": { + "type": "keyword" + }, + "statuses": { + "properties": { + "name": { + "type": "keyword" + }, + "state": { + "type": "keyword" + } + } + } + } + }, + "cloud": { + "properties": { + "name": { + "type": "keyword" + }, + "id": { + "type": "keyword" + }, + "vm_type": { + "type": "keyword" + }, + "region": { + "type": "keyword" + }, + "zone": { + "type": "keyword" + }, + "metadata": { + "type": "object" + } + } + }, + "os": { + "properties": { + "load": { + "properties": { + "1m": { + "type": "half_float" + }, + "5m": { + "type": "half_float" + }, + "15m": { + "type": "half_float" + } + } + }, + "memory": { + "properties": { + "total_in_bytes": { + "type": "float" + }, + "free_in_bytes": { + "type": "float" + }, + "used_in_bytes": { + "type": "float" + } + } + }, + "uptime_in_millis": { + "type": "long" + } + } + }, + "process": { + "properties": { + "memory": { + "properties": { + "heap": { + "properties": { + "total_in_bytes": { + "type": "float" + }, + "used_in_bytes": { + "type": "float" + }, + "size_limit": { + "type": "float" + } + } + }, + "resident_set_size_in_bytes": { + "type": "float" + } + } + }, + "event_loop_delay": { + "type": "float" + }, + "uptime_in_millis": { + "type": "long" + } + } + }, + "sockets": { + "properties": { + "http": { + "properties": { + "total": { + "type": "long" + } + } + }, + "https": { + "properties": { + "total": { + "type": "long" + } + } + } + } + }, + "timestamp": { + "type": "date" + }, + "requests": { + "properties": { + "disconnects": { + "type": "long" + }, + "total": { + "type": "long" + }, + "status_codes": { + "type": "object" + } + } + }, + "response_times": { + "properties": { + "average": { + "type": "float" + }, + "max": { + "type": "float" + } + } + }, + "concurrent_connections": { + "type": "long" + } + } + } + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/monitoring-logstash.json b/x-pack/plugin/core/out/production/resources/monitoring-logstash.json new file mode 100644 index 0000000000000..40f5b2ca217b6 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/monitoring-logstash.json @@ -0,0 +1,412 @@ +{ + "index_patterns": [ ".monitoring-logstash-${monitoring.template.version}-*" ], + "version": 7000199, + "settings": { + "index.number_of_shards": 1, + "index.number_of_replicas": 0, + "index.auto_expand_replicas": "0-1", + "index.format": 7, + "index.codec": "best_compression" + }, + "mappings": { + "_doc": { + "dynamic": false, + "properties": { + "cluster_uuid": { + "type": "keyword" + }, + "timestamp": { + "type": "date", + "format": "date_time" + }, + "interval_ms": { + "type": "long" + }, + "type": { + "type": "keyword" + }, + "source_node": { + "properties": { + "uuid": { + "type": "keyword" + }, + "host": { + "type": "keyword" + }, + "transport_address": { + "type": "keyword" + }, + "ip": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "timestamp": { + "type": "date", + "format": "date_time" + } + } + }, + "logstash_stats": { + "type": "object", + "properties": { + "logstash": { + "properties": { + "uuid": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "ephemeral_id": { + "type": "keyword" + }, + "host": { + "type": "keyword" + }, + "http_address": { + "type": "keyword" + }, + "version": { + "type": "keyword" + }, + "snapshot": { + "type": "boolean" + }, + "status": { + "type": "keyword" + }, + "pipeline": { + "properties": { + "workers": { + "type": "short" + }, + "batch_size": { + "type": "long" + } + } + } + } + }, + "events": { + "properties": { + "filtered": { + "type": "long" + }, + "in": { + "type": "long" + }, + "out": { + "type": "long" + }, + "duration_in_millis": { + "type": "long" + } + } + }, + "timestamp": { + "type": "date" + }, + "jvm": { + "properties": { + "uptime_in_millis": { + "type": "long" + }, + "gc": { + "properties": { + "collectors": { + "properties": { + "old": { + "properties": { + "collection_count": { + "type": "long" + }, + "collection_time_in_millis": { + "type": "long" + } + } + }, + "young": { + "properties": { + "collection_count": { + "type": "long" + }, + "collection_time_in_millis": { + "type": "long" + } + } + } + } + } + } + }, + "mem": { + "properties": { + "heap_max_in_bytes": { + "type": "long" + }, + "heap_used_in_bytes": { + "type": "long" + }, + "heap_used_percent": { + "type": "long" + } + } + } + } + }, + "os": { + "properties": { + "cpu": { + "properties": { + "load_average": { + "properties": { + "1m": { + "type": "half_float" + }, + "5m": { + "type": "half_float" + }, + "15m": { + "type": "half_float" + } + } + } + } + }, + "cgroup": { + "properties": { + "cpuacct": { + "properties": { + "control_group": { + "type": "keyword" + }, + "usage_nanos": { + "type": "long" + } + } + }, + "cpu": { + "properties": { + "control_group": { + "type": "keyword" + }, + "stat": { + "properties": { + "number_of_elapsed_periods": { + "type": "long" + }, + "number_of_times_throttled": { + "type": "long" + }, + "time_throttled_nanos": { + "type": "long" + } + } + } + } + } + } + } + } + }, + "process": { + "properties": { + "cpu": { + "properties": { + "percent": { + "type": "long" + } + } + }, + "max_file_descriptors": { + "type": "long" + }, + "open_file_descriptors": { + "type": "long" + } + } + }, + "reloads": { + "properties": { + "failures": { + "type": "long" + }, + "successes": { + "type": "long" + } + } + }, + "queue": { + "properties": { + "events_count": { + "type": "long" + }, + "type": { + "type": "keyword" + } + } + }, + "pipelines": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "hash": { + "type": "keyword" + }, + "ephemeral_id": { + "type": "keyword" + }, + "events": { + "properties": { + "in": { + "type": "long" + }, + "filtered": { + "type": "long" + }, + "out": { + "type": "long" + }, + "duration_in_millis":{ + "type": "long" + }, + "queue_push_duration_in_millis": { + "type": "long" + } + } + }, + "queue": { + "properties": { + "events_count": { + "type": "long" + }, + "type": { + "type": "keyword" + }, + "max_queue_size_in_bytes": { + "type": "long" + }, + "queue_size_in_bytes": { + "type": "long" + } + } + }, + "vertices": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "pipeline_ephemeral_id": { "type": "keyword" }, + "events_in": { "type": "long" }, + "events_out": { "type": "long" }, + "duration_in_millis": { "type": "long" }, + "queue_push_duration_in_millis": { "type": "long" }, + "long_counters": { + "type": "nested", + "properties": { + "name": { + "type": "keyword" + }, + "value": { + "type": "long" + } + } + }, + "double_gauges": { + "type": "nested", + "properties": { + "name": { + "type": "keyword" + }, + "value": { + "type": "double" + } + } + } + } + }, + "reloads": { + "properties": { + "failures": { + "type": "long" + }, + "successes": { + "type": "long" + } + } + } + } + }, + "workers": { + "type": "short" + }, + "batch_size": { + "type": "integer" + } + } + }, + "logstash_state": { + "properties": { + "uuid": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "host": { + "type": "keyword" + }, + "http_address": { + "type": "keyword" + }, + "ephemeral_id": { + "type": "keyword" + }, + "version": { + "type": "keyword" + }, + "snapshot": { + "type": "boolean" + }, + "status": { + "type": "keyword" + }, + "pipeline": { + "properties": { + "id": { + "type": "keyword" + }, + "hash": { + "type": "keyword" + }, + "ephemeral_id": { + "type": "keyword" + }, + "workers": { + "type": "short" + }, + "batch_size": { + "type": "integer" + }, + "format": { + "type": "keyword" + }, + "version": { + "type": "keyword" + }, + "representation": { + "enabled": false + } + } + } + } + } + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/annotations_index_mappings.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/annotations_index_mappings.json new file mode 100644 index 0000000000000..41c26b0f83d4f --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/annotations_index_mappings.json @@ -0,0 +1,36 @@ +{ + "_doc": { + "_meta" : { + "version" : "${xpack.ml.version}" + }, + "properties" : { + "annotation" : { + "type" : "text" + }, + "create_time" : { + "type" : "date" + }, + "create_username" : { + "type" : "keyword" + }, + "end_timestamp" : { + "type" : "date" + }, + "job_id" : { + "type" : "keyword" + }, + "modified_time" : { + "type" : "date" + }, + "modified_username" : { + "type" : "keyword" + }, + "timestamp" : { + "type" : "date" + }, + "type" : { + "type" : "keyword" + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_mappings.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_mappings.json new file mode 100644 index 0000000000000..8ff990d2e5020 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_mappings.json @@ -0,0 +1,478 @@ +{ + "${xpack.ml.mapping_type}" : { + "_meta" : { + "version" : "${xpack.ml.version}" + }, + "dynamic_templates" : [ + { + "strings_as_keywords" : { + "match" : "*", + "mapping" : { + "type" : "keyword" + } + } + } + ], + "properties" : { + "actual" : { + "type" : "double" + }, + "all_field_values" : { + "type" : "text", + "analyzer" : "whitespace" + }, + "anomaly_score" : { + "type" : "double" + }, + "average_bucket_processing_time_ms" : { + "type" : "double" + }, + "bucket_allocation_failures_count" : { + "type" : "long" + }, + "bucket_count" : { + "type" : "long" + }, + "bucket_influencers" : { + "type" : "nested", + "properties" : { + "anomaly_score" : { + "type" : "double" + }, + "bucket_span" : { + "type" : "long" + }, + "influencer_field_name" : { + "type" : "keyword" + }, + "initial_anomaly_score" : { + "type" : "double" + }, + "is_interim" : { + "type" : "boolean" + }, + "job_id" : { + "type" : "keyword" + }, + "probability" : { + "type" : "double" + }, + "raw_anomaly_score" : { + "type" : "double" + }, + "result_type" : { + "type" : "keyword" + }, + "timestamp" : { + "type" : "date" + } + } + }, + "bucket_span" : { + "type" : "long" + }, + "by_field_name" : { + "type" : "keyword" + }, + "by_field_value" : { + "type" : "keyword", + "copy_to" : [ + "all_field_values" + ] + }, + "category_id" : { + "type" : "long" + }, + "causes" : { + "type" : "nested", + "properties" : { + "actual" : { + "type" : "double" + }, + "by_field_name" : { + "type" : "keyword" + }, + "by_field_value" : { + "type" : "keyword", + "copy_to" : [ + "all_field_values" + ] + }, + "correlated_by_field_value" : { + "type" : "keyword", + "copy_to" : [ + "all_field_values" + ] + }, + "field_name" : { + "type" : "keyword" + }, + "function" : { + "type" : "keyword" + }, + "function_description" : { + "type" : "keyword" + }, + "geo_results" : { + "properties" : { + "actual_point" : { + "type" : "geo_point" + }, + "typical_point" : { + "type" : "geo_point" + } + } + }, + "over_field_name" : { + "type" : "keyword" + }, + "over_field_value" : { + "type" : "keyword", + "copy_to" : [ + "all_field_values" + ] + }, + "partition_field_name" : { + "type" : "keyword" + }, + "partition_field_value" : { + "type" : "keyword", + "copy_to" : [ + "all_field_values" + ] + }, + "probability" : { + "type" : "double" + }, + "typical" : { + "type" : "double" + } + } + }, + "description" : { + "type" : "text" + }, + "detector_index" : { + "type" : "integer" + }, + "earliest_record_timestamp" : { + "type" : "date" + }, + "empty_bucket_count" : { + "type" : "long" + }, + "event_count" : { + "type" : "long" + }, + "examples" : { + "type" : "text" + }, + "exponential_average_bucket_processing_time_ms" : { + "type" : "double" + }, + "exponential_average_calculation_context" : { + "properties" : { + "incremental_metric_value_ms" : { + "type" : "double" + }, + "latest_timestamp" : { + "type" : "date" + }, + "previous_exponential_average_ms" : { + "type" : "double" + } + } + }, + "field_name" : { + "type" : "keyword" + }, + "forecast_create_timestamp" : { + "type" : "date" + }, + "forecast_end_timestamp" : { + "type" : "date" + }, + "forecast_expiry_timestamp" : { + "type" : "date" + }, + "forecast_id" : { + "type" : "keyword" + }, + "forecast_lower" : { + "type" : "double" + }, + "forecast_memory_bytes" : { + "type" : "long" + }, + "forecast_messages" : { + "type" : "keyword" + }, + "forecast_prediction" : { + "type" : "double" + }, + "forecast_progress" : { + "type" : "double" + }, + "forecast_start_timestamp" : { + "type" : "date" + }, + "forecast_status" : { + "type" : "keyword" + }, + "forecast_upper" : { + "type" : "double" + }, + "function" : { + "type" : "keyword" + }, + "function_description" : { + "type" : "keyword" + }, + "geo_results" : { + "properties" : { + "actual_point" : { + "type" : "geo_point" + }, + "typical_point" : { + "type" : "geo_point" + } + } + }, + "influencer_field_name" : { + "type" : "keyword" + }, + "influencer_field_value" : { + "type" : "keyword", + "copy_to" : [ + "all_field_values" + ] + }, + "influencer_score" : { + "type" : "double" + }, + "influencers" : { + "type" : "nested", + "properties" : { + "influencer_field_name" : { + "type" : "keyword" + }, + "influencer_field_values" : { + "type" : "keyword", + "copy_to" : [ + "all_field_values" + ] + } + } + }, + "initial_anomaly_score" : { + "type" : "double" + }, + "initial_influencer_score" : { + "type" : "double" + }, + "initial_record_score" : { + "type" : "double" + }, + "input_bytes" : { + "type" : "long" + }, + "input_field_count" : { + "type" : "long" + }, + "input_record_count" : { + "type" : "long" + }, + "invalid_date_count" : { + "type" : "long" + }, + "is_interim" : { + "type" : "boolean" + }, + "job_id" : { + "type" : "keyword", + "copy_to" : [ + "all_field_values" + ] + }, + "last_data_time" : { + "type" : "date" + }, + "latest_empty_bucket_timestamp" : { + "type" : "date" + }, + "latest_record_time_stamp" : { + "type" : "date" + }, + "latest_record_timestamp" : { + "type" : "date" + }, + "latest_result_time_stamp" : { + "type" : "date" + }, + "latest_sparse_bucket_timestamp" : { + "type" : "date" + }, + "log_time" : { + "type" : "date" + }, + "max_matching_length" : { + "type" : "long" + }, + "maximum_bucket_processing_time_ms" : { + "type" : "double" + }, + "memory_status" : { + "type" : "keyword" + }, + "min_version" : { + "type" : "keyword" + }, + "minimum_bucket_processing_time_ms" : { + "type" : "double" + }, + "missing_field_count" : { + "type" : "long" + }, + "model_bytes" : { + "type" : "long" + }, + "model_feature" : { + "type" : "keyword" + }, + "model_lower" : { + "type" : "double" + }, + "model_median" : { + "type" : "double" + }, + "model_size_stats" : { + "properties" : { + "bucket_allocation_failures_count" : { + "type" : "long" + }, + "job_id" : { + "type" : "keyword" + }, + "log_time" : { + "type" : "date" + }, + "memory_status" : { + "type" : "keyword" + }, + "model_bytes" : { + "type" : "long" + }, + "result_type" : { + "type" : "keyword" + }, + "timestamp" : { + "type" : "date" + }, + "total_by_field_count" : { + "type" : "long" + }, + "total_over_field_count" : { + "type" : "long" + }, + "total_partition_field_count" : { + "type" : "long" + } + } + }, + "model_upper" : { + "type" : "double" + }, + "multi_bucket_impact" : { + "type" : "double" + }, + "out_of_order_timestamp_count" : { + "type" : "long" + }, + "over_field_name" : { + "type" : "keyword" + }, + "over_field_value" : { + "type" : "keyword", + "copy_to" : [ + "all_field_values" + ] + }, + "partition_field_name" : { + "type" : "keyword" + }, + "partition_field_value" : { + "type" : "keyword", + "copy_to" : [ + "all_field_values" + ] + }, + "probability" : { + "type" : "double" + }, + "processed_field_count" : { + "type" : "long" + }, + "processed_record_count" : { + "type" : "long" + }, + "processing_time_ms" : { + "type" : "long" + }, + "quantiles" : { + "type" : "object", + "enabled" : false + }, + "raw_anomaly_score" : { + "type" : "double" + }, + "record_score" : { + "type" : "double" + }, + "regex" : { + "type" : "keyword" + }, + "result_type" : { + "type" : "keyword" + }, + "retain" : { + "type" : "boolean" + }, + "scheduled_events" : { + "type" : "keyword" + }, + "search_count" : { + "type" : "long" + }, + "snapshot_doc_count" : { + "type" : "integer" + }, + "snapshot_id" : { + "type" : "keyword" + }, + "sparse_bucket_count" : { + "type" : "long" + }, + "terms" : { + "type" : "text" + }, + "timestamp" : { + "type" : "date" + }, + "total_by_field_count" : { + "type" : "long" + }, + "total_over_field_count" : { + "type" : "long" + }, + "total_partition_field_count" : { + "type" : "long" + }, + "total_search_time_ms" : { + "type" : "double" + }, + "typical" : { + "type" : "double" + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_template.json new file mode 100644 index 0000000000000..bccad3e753678 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_template.json @@ -0,0 +1,20 @@ +{ + "order" : 0, + "version" : ${xpack.ml.version.id}, + "index_patterns" : [ + ".ml-anomalies-*" + ], + "settings" : { + "index" : { + "translog" : { + "durability" : "async" + }, + "auto_expand_replicas" : "0-1", + "query" : { + "default_field" : "all_field_values" + }, + "hidden": true + } + }, + "mappings": ${xpack.ml.anomalydetection.results.mappings} +} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/state_index_template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/state_index_template.json new file mode 100644 index 0000000000000..e3cd7f51dc43a --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/state_index_template.json @@ -0,0 +1,23 @@ +{ + "order" : 0, + "version" : ${xpack.ml.version.id}, + "index_patterns" : [ + ".ml-state*" + ], + "settings" : { + "index" : { + "auto_expand_replicas" : "0-1", + "hidden": true + } + ${xpack.ml.index.lifecycle.settings} + }, + "mappings" : { + "_doc": { + "_meta": { + "version": "${xpack.ml.version}" + }, + "enabled": false + } + }, + "aliases" : {} +} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_mappings.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_mappings.json new file mode 100644 index 0000000000000..0d4444209fe2b --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_mappings.json @@ -0,0 +1,371 @@ +{ + "${xpack.ml.mapping_type}" : { + "_meta" : { + "version" : "${xpack.ml.version}" + }, + "dynamic_templates" : [ + { + "strings_as_keywords" : { + "match" : "*", + "mapping" : { + "type" : "keyword" + } + } + } + ], + "properties" : { + "aggregations" : { + "type" : "object", + "enabled" : false + }, + "allow_lazy_open" : { + "type" : "keyword" + }, + "analysis" : { + "properties" : { + "classification" : { + "properties" : { + "dependent_variable" : { + "type" : "keyword" + }, + "eta" : { + "type" : "double" + }, + "feature_bag_fraction" : { + "type" : "double" + }, + "gamma" : { + "type" : "double" + }, + "lambda" : { + "type" : "double" + }, + "max_trees" : { + "type" : "integer" + }, + "class_assignment_objective" : { + "type" : "keyword" + }, + "num_top_classes" : { + "type" : "integer" + }, + "num_top_feature_importance_values" : { + "type" : "integer" + }, + "prediction_field_name" : { + "type" : "keyword" + }, + "training_percent" : { + "type" : "double" + } + } + }, + "outlier_detection" : { + "properties" : { + "feature_influence_threshold" : { + "type" : "double" + }, + "method" : { + "type" : "keyword" + }, + "n_neighbors" : { + "type" : "integer" + } + } + }, + "regression" : { + "properties" : { + "dependent_variable" : { + "type" : "keyword" + }, + "eta" : { + "type" : "double" + }, + "feature_bag_fraction" : { + "type" : "double" + }, + "gamma" : { + "type" : "double" + }, + "lambda" : { + "type" : "double" + }, + "max_trees" : { + "type" : "integer" + }, + "num_top_feature_importance_values" : { + "type" : "integer" + }, + "prediction_field_name" : { + "type" : "keyword" + }, + "training_percent" : { + "type" : "double" + } + } + } + } + }, + "analysis_config" : { + "properties" : { + "bucket_span" : { + "type" : "keyword" + }, + "categorization_analyzer" : { + "type" : "object", + "enabled" : false + }, + "categorization_field_name" : { + "type" : "keyword" + }, + "categorization_filters" : { + "type" : "keyword" + }, + "detectors" : { + "properties" : { + "by_field_name" : { + "type" : "keyword" + }, + "custom_rules" : { + "type" : "nested", + "properties" : { + "actions" : { + "type" : "keyword" + }, + "conditions" : { + "type" : "nested", + "properties" : { + "applies_to" : { + "type" : "keyword" + }, + "operator" : { + "type" : "keyword" + }, + "value" : { + "type" : "double" + } + } + }, + "scope" : { + "type" : "object", + "enabled" : false + } + } + }, + "detector_description" : { + "type" : "text" + }, + "detector_index" : { + "type" : "integer" + }, + "exclude_frequent" : { + "type" : "keyword" + }, + "field_name" : { + "type" : "keyword" + }, + "function" : { + "type" : "keyword" + }, + "over_field_name" : { + "type" : "keyword" + }, + "partition_field_name" : { + "type" : "keyword" + }, + "use_null" : { + "type" : "boolean" + } + } + }, + "influencers" : { + "type" : "keyword" + }, + "latency" : { + "type" : "keyword" + }, + "multivariate_by_fields" : { + "type" : "boolean" + }, + "summary_count_field_name" : { + "type" : "keyword" + } + } + }, + "analysis_limits" : { + "properties" : { + "categorization_examples_limit" : { + "type" : "long" + }, + "model_memory_limit" : { + "type" : "keyword" + } + } + }, + "analyzed_fields" : { + "type" : "object", + "enabled" : false + }, + "background_persist_interval" : { + "type" : "keyword" + }, + "chunking_config" : { + "properties" : { + "mode" : { + "type" : "keyword" + }, + "time_span" : { + "type" : "keyword" + } + } + }, + "config_type" : { + "type" : "keyword" + }, + "create_time" : { + "type" : "date" + }, + "custom_settings" : { + "type" : "object", + "enabled" : false + }, + "data_description" : { + "properties" : { + "field_delimiter" : { + "type" : "keyword" + }, + "format" : { + "type" : "keyword" + }, + "quote_character" : { + "type" : "keyword" + }, + "time_field" : { + "type" : "keyword" + }, + "time_format" : { + "type" : "keyword" + } + } + }, + "datafeed_id" : { + "type" : "keyword" + }, + "delayed_data_check_config" : { + "properties" : { + "check_window" : { + "type" : "keyword" + }, + "enabled" : { + "type" : "boolean" + } + } + }, + "description" : { + "type" : "text" + }, + "dest" : { + "properties" : { + "index" : { + "type" : "keyword" + }, + "results_field" : { + "type" : "keyword" + } + } + }, + "finished_time" : { + "type" : "date" + }, + "frequency" : { + "type" : "keyword" + }, + "groups" : { + "type" : "keyword" + }, + "headers" : { + "type" : "object", + "enabled" : false + }, + "id" : { + "type" : "keyword" + }, + "indices" : { + "type" : "keyword" + }, + "indices_options": { + "type" : "object", + "enabled" : false + }, + "job_id" : { + "type" : "keyword" + }, + "job_type" : { + "type" : "keyword" + }, + "job_version" : { + "type" : "keyword" + }, + "model_plot_config" : { + "properties" : { + "enabled" : { + "type" : "boolean" + }, + "terms" : { + "type" : "keyword" + } + } + }, + "model_snapshot_id" : { + "type" : "keyword" + }, + "model_snapshot_min_version" : { + "type" : "keyword" + }, + "model_snapshot_retention_days" : { + "type" : "long" + }, + "query" : { + "type" : "object", + "enabled" : false + }, + "query_delay" : { + "type" : "keyword" + }, + "renormalization_window_days" : { + "type" : "long" + }, + "results_index_name" : { + "type" : "keyword" + }, + "results_retention_days" : { + "type" : "long" + }, + "script_fields" : { + "type" : "object", + "enabled" : false + }, + "scroll_size" : { + "type" : "long" + }, + "source" : { + "properties" : { + "_source" : { + "type" : "object", + "enabled" : false + }, + "index" : { + "type" : "keyword" + }, + "query" : { + "type" : "object", + "enabled" : false + } + } + }, + "version" : { + "type" : "keyword" + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_template.json new file mode 100644 index 0000000000000..8c6c352ab245a --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_template.json @@ -0,0 +1,15 @@ +{ + "order" : 0, + "version" : ${xpack.ml.version.id}, + "index_patterns" : [ + ".ml-config" + ], + "settings" : { + "index" : { + "max_result_window" : "${xpack.ml.config.max_result_window}", + "number_of_shards" : "1", + "auto_expand_replicas" : "0-1" + } + }, + "mappings": ${xpack.ml.config.mappings} +} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/inference_index_template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/inference_index_template.json new file mode 100644 index 0000000000000..2a1131ca557a9 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/inference_index_template.json @@ -0,0 +1,75 @@ +{ + "order" : 0, + "version" : ${xpack.ml.version.id}, + "index_patterns" : [ + ".ml-inference-000001" + ], + "settings" : { + "index" : { + "number_of_shards" : "1", + "auto_expand_replicas" : "0-1" + } + }, + "mappings" : { + "_doc": { + "_meta": { + "version": "${xpack.ml.version}" + }, + "dynamic": "false", + "properties": { + "doc_type": { + "type": "keyword" + }, + "model_id": { + "type": "keyword" + }, + "created_by": { + "type": "keyword" + }, + "input": { + "enabled": false + }, + "version": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "create_time": { + "type": "date" + }, + "tags": { + "type": "keyword" + }, + "metadata": { + "enabled": false + }, + "estimated_operations": { + "type": "long" + }, + "estimated_heap_memory_usage_bytes": { + "type": "long" + }, + "doc_num": { + "type": "long" + }, + "definition": { + "enabled": false + }, + "compression_version": { + "type": "long" + }, + "definition_length": { + "type": "long" + }, + "total_definition_length": { + "type": "long" + }, + "default_field_map": { + "enabled": false + } + } + } + }, + "aliases" : { } +} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/meta_index_template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/meta_index_template.json new file mode 100644 index 0000000000000..19df45c52509c --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/meta_index_template.json @@ -0,0 +1,47 @@ +{ + "order" : 0, + "version" : ${xpack.ml.version.id}, + "index_patterns" : [ + ".ml-meta" + ], + "settings" : { + "index" : { + "number_of_shards" : "1", + "auto_expand_replicas" : "0-1" + } + }, + "mappings" : { + "_doc": { + "_meta": { + "version": "${xpack.ml.version}" + }, + "dynamic_templates": [ + { + "strings_as_keywords": { + "match": "*", + "mapping": { + "type": "keyword" + } + } + } + ], + "properties": { + "calendar_id": { + "type": "keyword" + }, + "job_ids": { + "type": "keyword" + }, + "description": { + "type": "keyword" + }, + "start_time": { + "type": "date" + }, + "end_time": { + "type": "date" + } + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/notifications_index_template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/notifications_index_template.json new file mode 100644 index 0000000000000..e8ac3f1fcce6f --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/notifications_index_template.json @@ -0,0 +1,47 @@ +{ + "order" : 0, + "version" : ${xpack.ml.version.id}, + "index_patterns" : [ + ".ml-notifications-000001" + ], + "settings" : { + "index" : { + "number_of_shards" : "1", + "auto_expand_replicas" : "0-1", + "hidden": true + } + }, + "mappings" : { + "_doc": { + "_meta" : { + "version" : "${xpack.ml.version}" + }, + "dynamic" : "false", + "properties" : { + "job_id": { + "type": "keyword" + }, + "level": { + "type": "keyword" + }, + "message": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "timestamp": { + "type": "date" + }, + "node_name": { + "type": "keyword" + }, + "job_type": { + "type": "keyword" + } + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/size_based_ilm_policy.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/size_based_ilm_policy.json new file mode 100644 index 0000000000000..09a8db4e1ee9d --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/size_based_ilm_policy.json @@ -0,0 +1,11 @@ +{ + "phases": { + "hot": { + "actions": { + "rollover": { + "max_size": "50GB" + } + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_mappings.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_mappings.json new file mode 100644 index 0000000000000..d30586bebb1f7 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_mappings.json @@ -0,0 +1,132 @@ +{ + "${xpack.ml.mapping_type}": { + "_meta": { + "version" : "${xpack.ml.version}" + }, + "dynamic": false, + "properties" : { + "iteration": { + "type": "integer" + }, + "hyperparameters": { + "properties": { + "class_assignment_objective": { + "type": "keyword" + }, + "downsample_factor": { + "type": "double" + }, + "eta": { + "type": "double" + }, + "eta_growth_rate_per_tree": { + "type": "double" + }, + "feature_bag_fraction": { + "type": "double" + }, + "max_attempts_to_add_tree": { + "type": "integer" + }, + "max_optimization_rounds_per_hyperparameter": { + "type": "integer" + }, + "max_trees": { + "type": "integer" + }, + "num_folds": { + "type": "integer" + }, + "num_splits_per_feature": { + "type": "integer" + }, + "regularization_depth_penalty_multiplier": { + "type": "double" + }, + "regularization_leaf_weight_penalty_multiplier": { + "type": "double" + }, + "regularization_soft_tree_depth_limit": { + "type": "double" + }, + "regularization_soft_tree_depth_tolerance": { + "type": "double" + }, + "regularization_tree_size_penalty_multiplier": { + "type": "double" + } + } + }, + "job_id" : { + "type" : "keyword" + }, + "parameters": { + "properties": { + "compute_feature_influence": { + "type": "boolean" + }, + "feature_influence_threshold": { + "type": "double" + }, + "method": { + "type": "keyword" + }, + "n_neighbors": { + "type": "integer" + }, + "outlier_fraction": { + "type": "double" + }, + "standardization_enabled": { + "type": "boolean" + } + } + }, + "peak_usage_bytes" : { + "type" : "long" + }, + "skipped_docs_count": { + "type": "long" + }, + "timestamp" : { + "type" : "date" + }, + "timing_stats": { + "properties": { + "elapsed_time": { + "type": "long" + }, + "iteration_time": { + "type": "long" + } + } + }, + "test_docs_count": { + "type": "long" + }, + "training_docs_count": { + "type": "long" + }, + "type" : { + "type" : "keyword" + }, + "validation_loss": { + "properties": { + "fold_values": { + "properties": { + "fold": { + "type": "integer" + }, + "values": { + "type": "double" + } + } + }, + "loss_type": { + "type": "keyword" + } + } + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_template.json new file mode 100644 index 0000000000000..223d1a79bad75 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_template.json @@ -0,0 +1,17 @@ +{ + "order" : 0, + "version" : ${xpack.ml.version.id}, + "index_patterns" : [ + ".ml-stats-*" + ], + "settings": { + "index" : { + "number_of_shards" : "1", + "auto_expand_replicas" : "0-1", + "hidden": true + } + ${xpack.ml.index.lifecycle.settings} + }, + "mappings" : ${xpack.ml.stats.mappings}, + "aliases" : {} +} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/idp/saml-service-provider-template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/idp/saml-service-provider-template.json new file mode 100644 index 0000000000000..8dfbcd246615b --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/idp/saml-service-provider-template.json @@ -0,0 +1,99 @@ +{ + "index_patterns": [ + "saml-service-provider-*" + ], + "aliases": { + "saml-service-provider": {} + }, + "order": 100, + "settings": { + "number_of_shards": 1, + "number_of_replicas": 0, + "auto_expand_replicas": "0-1", + "index.priority": 10, + "index.refresh_interval": "1s", + "index.format": 1 + }, + "mappings": { + "_doc": { + "_meta": { + "idp-version": "${idp.template.version}" + }, + "dynamic": "strict", + "properties": { + "name": { + "type": "text" + }, + "entity_id": { + "type": "keyword" + }, + "acs": { + "type": "keyword" + }, + "enabled": { + "type": "boolean" + }, + "created": { + "type": "date", + "format": "epoch_millis" + }, + "last_modified": { + "type": "date", + "format": "epoch_millis" + }, + "name_id_format": { + "type": "keyword" + }, + "sign_messages": { + "type": "keyword" + }, + "authn_expiry_ms": { + "type": "long" + }, + "privileges": { + "type": "object", + "properties": { + "resource": { + "type": "keyword" + }, + "roles": { + "type": "object", + "dynamic": false + } + } + }, + "attributes": { + "type": "object", + "properties": { + "principal": { + "type": "keyword" + }, + "email": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "roles": { + "type": "keyword" + } + } + }, + "certificates": { + "type": "object", + "properties": { + "sp_signing": { + "type": "text" + }, + "idp_signing": { + "type": "text" + }, + "idp_metadata": { + "type": "text" + } + } + } + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/security-index-template-7.json b/x-pack/plugin/core/out/production/resources/security-index-template-7.json new file mode 100644 index 0000000000000..fa3618616c093 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/security-index-template-7.json @@ -0,0 +1,289 @@ +{ + "index_patterns" : [ ".security-7" ], + "order" : 1000, + "settings" : { + "number_of_shards" : 1, + "number_of_replicas" : 0, + "auto_expand_replicas" : "0-1", + "index.priority": 1000, + "index.refresh_interval": "1s", + "index.format": 6, + "analysis" : { + "filter" : { + "email" : { + "type" : "pattern_capture", + "preserve_original" : true, + "patterns" : [ + "([^@]+)", + "(\\p{L}+)", + "(\\d+)", + "@(.+)" + ] + } + }, + "analyzer" : { + "email" : { + "tokenizer" : "uax_url_email", + "filter" : [ + "email", + "lowercase", + "unique" + ] + } + } + } + }, + "mappings" : { + "_doc" : { + "_meta": { + "security-version": "${security.template.version}" + }, + "dynamic" : "strict", + "properties" : { + "username" : { + "type" : "keyword" + }, + "roles" : { + "type" : "keyword" + }, + "role_templates" : { + "properties": { + "template" : { + "type": "text" + }, + "format" : { + "type": "keyword" + } + } + }, + "password" : { + "type" : "keyword", + "index" : false, + "doc_values": false + }, + "full_name" : { + "type" : "text" + }, + "email" : { + "type" : "text", + "analyzer" : "email" + }, + "metadata" : { + "type" : "object", + "dynamic" : false + }, + "enabled": { + "type": "boolean" + }, + "cluster" : { + "type" : "keyword" + }, + "indices" : { + "type" : "object", + "properties" : { + "field_security" : { + "properties" : { + "grant": { + "type": "keyword" + }, + "except": { + "type": "keyword" + } + } + }, + "names" : { + "type" : "keyword" + }, + "privileges" : { + "type" : "keyword" + }, + "query" : { + "type" : "keyword" + }, + "allow_restricted_indices" : { + "type" : "boolean" + } + } + }, + "applications": { + "type": "object", + "properties": { + "application": { + "type": "keyword" + }, + "privileges": { + "type": "keyword" + }, + "resources": { + "type": "keyword" + } + } + }, + "application" : { + "type" : "keyword" + }, + "global": { + "type": "object", + "properties": { + "application": { + "type": "object", + "properties": { + "manage": { + "type": "object", + "properties": { + "applications": { + "type": "keyword" + } + } + } + } + } + } + }, + "name" : { + "type" : "keyword" + }, + "run_as" : { + "type" : "keyword" + }, + "doc_type" : { + "type" : "keyword" + }, + "type" : { + "type" : "keyword" + }, + "actions" : { + "type" : "keyword" + }, + "expiration_time" : { + "type" : "date", + "format" : "epoch_millis" + }, + "creation_time" : { + "type" : "date", + "format" : "epoch_millis" + }, + "api_key_hash" : { + "type" : "keyword", + "index": false, + "doc_values": false + }, + "api_key_invalidated" : { + "type" : "boolean" + }, + "role_descriptors" : { + "type" : "object", + "enabled": false + }, + "limited_by_role_descriptors" : { + "type" : "object", + "enabled": false + }, + "version" : { + "type" : "integer" + }, + "creator" : { + "type" : "object", + "properties" : { + "principal" : { + "type": "keyword" + }, + "metadata" : { + "type" : "object", + "dynamic" : false + }, + "realm" : { + "type" : "keyword" + }, + "realm_type" : { + "type" : "keyword" + } + } + }, + "rules" : { + "type" : "object", + "dynamic" : false + }, + "refresh_token" : { + "type" : "object", + "properties" : { + "token" : { + "type" : "keyword" + }, + "refreshed" : { + "type" : "boolean" + }, + "refresh_time": { + "type": "date", + "format": "epoch_millis" + }, + "superseding": { + "type": "object", + "properties": { + "encrypted_tokens": { + "type": "binary" + }, + "encryption_iv": { + "type": "binary" + }, + "encryption_salt": { + "type": "binary" + } + } + }, + "invalidated" : { + "type" : "boolean" + }, + "client" : { + "type" : "object", + "properties" : { + "type" : { + "type" : "keyword" + }, + "user" : { + "type" : "keyword" + }, + "realm" : { + "type" : "keyword" + } + } + } + } + }, + "access_token" : { + "type" : "object", + "properties" : { + "user_token" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "keyword" + }, + "expiration_time" : { + "type" : "date", + "format" : "epoch_millis" + }, + "version" : { + "type" : "integer" + }, + "metadata" : { + "type" : "object", + "dynamic" : false + }, + "authentication" : { + "type" : "binary" + } + } + }, + "invalidated" : { + "type" : "boolean" + }, + "realm" : { + "type" : "keyword" + } + } + } + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/security-tokens-index-template-7.json b/x-pack/plugin/core/out/production/resources/security-tokens-index-template-7.json new file mode 100644 index 0000000000000..502daae3f79bd --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/security-tokens-index-template-7.json @@ -0,0 +1,108 @@ +{ + "index_patterns" : [ ".security-tokens-7" ], + "order" : 1000, + "settings" : { + "number_of_shards" : 1, + "number_of_replicas" : 0, + "auto_expand_replicas" : "0-1", + "index.priority": 1000, + "index.refresh_interval": "1s", + "index.format": 7 + }, + "mappings" : { + "_doc" : { + "_meta": { + "security-version": "${security.template.version}" + }, + "dynamic" : "strict", + "properties" : { + "doc_type" : { + "type" : "keyword" + }, + "creation_time" : { + "type" : "date", + "format" : "epoch_millis" + }, + "refresh_token" : { + "type" : "object", + "properties" : { + "token" : { + "type" : "keyword" + }, + "refreshed" : { + "type" : "boolean" + }, + "refresh_time": { + "type": "date", + "format": "epoch_millis" + }, + "superseding": { + "type": "object", + "properties": { + "encrypted_tokens": { + "type": "binary" + }, + "encryption_iv": { + "type": "binary" + }, + "encryption_salt": { + "type": "binary" + } + } + }, + "invalidated" : { + "type" : "boolean" + }, + "client" : { + "type" : "object", + "properties" : { + "type" : { + "type" : "keyword" + }, + "user" : { + "type" : "keyword" + }, + "realm" : { + "type" : "keyword" + } + } + } + } + }, + "access_token" : { + "type" : "object", + "properties" : { + "user_token" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "keyword" + }, + "expiration_time" : { + "type" : "date", + "format" : "epoch_millis" + }, + "version" : { + "type" : "integer" + }, + "metadata" : { + "type" : "object", + "dynamic" : false + }, + "authentication" : { + "type" : "binary" + } + } + }, + "invalidated" : { + "type" : "boolean" + }, + "realm" : { + "type" : "keyword" + } + } + } + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/slm-history-ilm-policy.json b/x-pack/plugin/core/out/production/resources/slm-history-ilm-policy.json new file mode 100644 index 0000000000000..febae00bc3608 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/slm-history-ilm-policy.json @@ -0,0 +1,18 @@ +{ + "phases": { + "hot": { + "actions": { + "rollover": { + "max_size": "50GB", + "max_age": "30d" + } + } + }, + "delete": { + "min_age": "90d", + "actions": { + "delete": {} + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/slm-history.json b/x-pack/plugin/core/out/production/resources/slm-history.json new file mode 100644 index 0000000000000..7ddd995fb21eb --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/slm-history.json @@ -0,0 +1,61 @@ +{ + "index_patterns": [ + ".slm-history-${xpack.slm.template.version}*" + ], + "order": 2147483647, + "settings": { + "index.number_of_shards": 1, + "index.number_of_replicas": 0, + "index.auto_expand_replicas": "0-1", + "index.lifecycle.name": "slm-history-ilm-policy", + "index.lifecycle.rollover_alias": ".slm-history-${xpack.slm.template.version}", + "index.hidden": true, + "index.format": 1 + }, + "mappings": { + "_doc": { + "dynamic": false, + "properties": { + "@timestamp": { + "type": "date", + "format": "epoch_millis" + }, + "policy": { + "type": "keyword" + }, + "repository": { + "type": "keyword" + }, + "snapshot_name":{ + "type": "keyword" + }, + "operation": { + "type": "keyword" + }, + "success": { + "type": "boolean" + }, + "configuration": { + "type": "object", + "dynamic": false, + "properties": { + "indices": { + "type": "keyword" + }, + "partial": { + "type": "boolean" + }, + "include_global_state": { + "type": "boolean" + } + } + }, + "error_details": { + "type": "text", + "index": false + } + } + } + }, + "version": ${xpack.slm.template.version} +} diff --git a/x-pack/plugin/core/out/production/resources/triggered-watches.json b/x-pack/plugin/core/out/production/resources/triggered-watches.json new file mode 100644 index 0000000000000..28f3b0fea6537 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/triggered-watches.json @@ -0,0 +1,41 @@ +{ + "index_patterns": [ ".triggered_watches*" ], + "order": 2147483647, + "settings": { + "index.number_of_shards": 1, + "index.auto_expand_replicas": "0-1", + "index.refresh_interval" : "-1", + "index.format": 6, + "index.priority": 900 + }, + "mappings": { + "_doc": { + "dynamic" : "strict", + "properties": { + "trigger_event": { + "type": "object", + "dynamic": true, + "enabled" : false, + "properties": { + "schedule": { + "type": "object", + "dynamic": true, + "properties": { + "triggered_time": { + "type": "date" + }, + "scheduled_time": { + "type": "date" + } + } + } + } + }, + "state": { + "type": "keyword" + } + } + } + }, + "version": ${xpack.watcher.template.version} +} diff --git a/x-pack/plugin/core/out/production/resources/watch-history-10.json b/x-pack/plugin/core/out/production/resources/watch-history-10.json new file mode 100644 index 0000000000000..78c989c056955 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/watch-history-10.json @@ -0,0 +1,567 @@ +{ + "index_patterns": [ ".watcher-history-10*" ], + "order": 2147483647, + "settings": { + "index.number_of_shards": 1, + "index.number_of_replicas": 0, + "index.auto_expand_replicas": "0-1", + "index.lifecycle.name": "watch-history-ilm-policy", + "index.format": 6 + }, + "mappings": { + "_doc": { + "_meta": { + "watcher-history-version": "10" + }, + "dynamic_templates": [ + { + "disabled_payload_fields": { + "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.payload", + "match_pattern": "regex", + "mapping": { + "type": "object", + "enabled": false + } + } + }, + { + "disabled_search_request_body_fields": { + "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.search\\.request\\.(body|template)", + "match_pattern": "regex", + "mapping": { + "type": "object", + "enabled": false + } + } + }, + { + "disabled_exception_fields": { + "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*)|actions)\\.error", + "match_pattern": "regex", + "mapping": { + "type": "object", + "enabled": false + } + } + }, + { + "disabled_jira_custom_fields": { + "path_match": "result.actions.jira.fields.customfield_*", + "mapping": { + "type": "object", + "enabled": false + } + } + } + ], + "dynamic": false, + "properties": { + "watch_id": { + "type": "keyword" + }, + "node": { + "type": "keyword" + }, + "trigger_event": { + "type": "object", + "dynamic": true, + "properties": { + "type" : { + "type" : "keyword" + }, + "triggered_time": { + "type": "date" + }, + "manual": { + "type": "object", + "dynamic": true, + "properties": { + "schedule": { + "type": "object", + "dynamic": true, + "properties": { + "scheduled_time": { + "type": "date" + } + } + } + } + }, + "schedule": { + "type": "object", + "dynamic": true, + "properties": { + "scheduled_time": { + "type": "date" + } + } + } + } + }, + "vars" : { + "type" : "object", + "enabled" : false + }, + "input": { + "type": "object", + "enabled": false + }, + "condition": { + "type": "object", + "enabled": false + }, + "state": { + "type": "keyword" + }, + "status": { + "type": "object", + "enabled" : false, + "dynamic" : true + }, + "messages": { + "type": "text" + }, + "user": { + "type": "text" + }, + "exception" : { + "type" : "object", + "enabled" : false + }, + "result": { + "type": "object", + "dynamic": true, + "properties": { + "execution_time": { + "type": "date" + }, + "execution_duration": { + "type": "long" + }, + "input": { + "type": "object", + "dynamic": true, + "properties": { + "type" : { + "type" : "keyword" + }, + "status" : { + "type" : "keyword" + }, + "payload" : { + "type" : "object", + "enabled" : false + }, + "search": { + "type": "object", + "dynamic": true, + "properties": { + "request": { + "type": "object", + "dynamic": true, + "properties": { + "search_type": { + "type": "keyword" + }, + "indices": { + "type": "keyword" + }, + "types": { + "type": "keyword" + } + } + } + } + }, + "http": { + "type": "object", + "dynamic": true, + "properties": { + "request": { + "type": "object", + "dynamic": true, + "properties": { + "path": { + "type": "keyword" + }, + "host": { + "type": "keyword" + } + } + } + } + } + } + }, + "condition" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "status" : { + "type" : "keyword" + }, + "met" : { + "type" : "boolean" + }, + "compare" : { + "type" : "object", + "enabled" : false + }, + "array_compare" : { + "type" : "object", + "enabled" : false + }, + "script" : { + "type" : "object", + "enabled" : false + } + } + }, + "transform" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "search" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "request" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "indices" : { + "type" : "keyword" + }, + "types" : { + "type" : "keyword" + } + } + } + } + } + } + }, + "actions": { + "type": "nested", + "include_in_parent": true, + "dynamic": true, + "properties": { + "id" : { + "type" : "keyword" + }, + "type" : { + "type" : "keyword" + }, + "status" : { + "type" : "keyword" + }, + "reason" : { + "type" : "keyword" + }, + "number_of_actions_executed": { + "type": "integer" + }, + "foreach" : { + "type": "object", + "enabled" : false + }, + "email": { + "type": "object", + "dynamic": true, + "properties": { + "message": { + "type": "object", + "dynamic": true, + "properties": { + "id": { + "type": "keyword" + }, + "from": { + "type": "keyword" + }, + "reply_to": { + "type": "keyword" + }, + "to": { + "type": "keyword" + }, + "cc": { + "type": "keyword" + }, + "bcc": { + "type": "keyword" + } + } + } + } + }, + "webhook": { + "type": "object", + "dynamic": true, + "properties": { + "request": { + "type": "object", + "dynamic": true, + "properties": { + "path": { + "type": "keyword" + }, + "host": { + "type": "keyword" + } + } + } + } + }, + "index": { + "type": "object", + "dynamic": true, + "properties": { + "response": { + "type": "object", + "dynamic": true, + "properties": { + "index": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "id": { + "type": "keyword" + } + } + } + } + }, + "jira" : { + "type": "object", + "dynamic": true, + "properties": { + "account": { + "type": "keyword" + }, + "reason": { + "type": "text" + }, + "request" : { + "type" : "object", + "enabled" : false + }, + "response" : { + "type" : "object", + "enabled" : false + }, + "fields": { + "type": "object", + "dynamic": true, + "properties": { + "summary": { + "type": "text" + }, + "description": { + "type": "text" + }, + "labels" : { + "type": "text" + }, + "project" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "key" : { + "type" : "keyword" + }, + "id" : { + "type" : "keyword" + } + } + }, + "issuetype" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "name" : { + "type": "keyword" + }, + "id" : { + "type" : "keyword" + } + } + } + } + }, + "result": { + "type": "object", + "dynamic": true, + "properties" : { + "id" : { + "type" : "keyword" + }, + "key" : { + "type" : "keyword" + }, + "self" : { + "type" : "keyword" + } + } + } + } + }, + "slack" : { + "type": "object", + "dynamic": true, + "properties": { + "account": { + "type": "keyword" + }, + "sent_messages": { + "type": "nested", + "include_in_parent": true, + "dynamic": true, + "properties": { + "status": { + "type": "keyword" + }, + "reason": { + "type": "text" + }, + "request" : { + "type" : "object", + "enabled" : false + }, + "response" : { + "type" : "object", + "enabled" : false + }, + "to" : { + "type": "keyword" + }, + "message" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "from" : { + "type" : "text" + }, + "icon" : { + "type" : "keyword" + }, + "text" : { + "type" : "text" + }, + "attachments" : { + "type" : "nested", + "include_in_parent": true, + "dynamic" : true, + "properties" : { + "color" : { + "type" : "keyword" + }, + "fields" : { + "properties" : { + "value" : { + "type" : "text" + } + } + } + } + } + } + } + } + } + } + }, + "pagerduty" : { + "type": "object", + "dynamic": true, + "properties": { + "account": { + "type": "keyword" + }, + "sent_event": { + "type": "nested", + "include_in_parent": true, + "dynamic": true, + "properties": { + "reason": { + "type": "text" + }, + "request" : { + "type" : "object", + "enabled" : false + }, + "response" : { + "type" : "object", + "enabled" : false + }, + "event" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "client" : { + "type" : "text" + }, + "client_url" : { + "type" : "keyword" + }, + "account" : { + "type" : "keyword" + }, + "attach_payload" : { + "type" : "boolean" + }, + "incident_key" : { + "type" : "keyword" + }, + "description" : { + "type" : "text" + }, + "context" : { + "type" : "nested", + "include_in_parent": true, + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "href" : { + "type" : "keyword" + }, + "src" : { + "type" : "keyword" + }, + "alt" : { + "type" : "text" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "metadata": { + "type": "object", + "dynamic": true + } + } + } + }, + "version": 10 +} diff --git a/x-pack/plugin/core/out/production/resources/watch-history-ilm-policy.json b/x-pack/plugin/core/out/production/resources/watch-history-ilm-policy.json new file mode 100644 index 0000000000000..e45e6b25e8f7b --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/watch-history-ilm-policy.json @@ -0,0 +1,10 @@ +{ + "phases": { + "delete": { + "min_age": "7d", + "actions": { + "delete": {} + } + } + } +} diff --git a/x-pack/plugin/core/out/production/resources/watch-history-no-ilm-10.json b/x-pack/plugin/core/out/production/resources/watch-history-no-ilm-10.json new file mode 100644 index 0000000000000..c763f992468b2 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/watch-history-no-ilm-10.json @@ -0,0 +1,616 @@ +{ + "index_patterns": [ ".watcher-history-10*" ], + "order": 2147483646, + "settings": { + "index.number_of_shards": 1, + "index.number_of_replicas": 0, + "index.auto_expand_replicas": "0-1", + "index.format": 6 + }, + "mappings": { + "doc": { + "_meta": { + "watcher-history-version": "10" + }, + "dynamic_templates": [ + { + "disabled_payload_fields": { + "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.payload", + "match_pattern": "regex", + "mapping": { + "type": "object", + "enabled": false + } + } + }, + { + "disabled_search_request_body_fields": { + "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.search\\.request\\.(body|template)", + "match_pattern": "regex", + "mapping": { + "type": "object", + "enabled": false + } + } + }, + { + "disabled_exception_fields": { + "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*)|actions)\\.error", + "match_pattern": "regex", + "mapping": { + "type": "object", + "enabled": false + } + } + }, + { + "disabled_jira_custom_fields": { + "path_match": "result.actions.jira.fields.customfield_*", + "mapping": { + "type": "object", + "enabled": false + } + } + } + ], + "dynamic": false, + "properties": { + "watch_id": { + "type": "keyword" + }, + "node": { + "type": "keyword" + }, + "trigger_event": { + "type": "object", + "dynamic": true, + "properties": { + "type" : { + "type" : "keyword" + }, + "triggered_time": { + "type": "date" + }, + "manual": { + "type": "object", + "dynamic": true, + "properties": { + "schedule": { + "type": "object", + "dynamic": true, + "properties": { + "scheduled_time": { + "type": "date" + } + } + } + } + }, + "schedule": { + "type": "object", + "dynamic": true, + "properties": { + "scheduled_time": { + "type": "date" + } + } + } + } + }, + "vars" : { + "type" : "object", + "enabled" : false + }, + "input": { + "type": "object", + "enabled": false + }, + "condition": { + "type": "object", + "enabled": false + }, + "state": { + "type": "keyword" + }, + "status": { + "type": "object", + "enabled" : false, + "dynamic" : true + }, + "messages": { + "type": "text" + }, + "user": { + "type": "text" + }, + "exception" : { + "type" : "object", + "enabled" : false + }, + "result": { + "type": "object", + "dynamic": true, + "properties": { + "execution_time": { + "type": "date" + }, + "execution_duration": { + "type": "long" + }, + "input": { + "type": "object", + "dynamic": true, + "properties": { + "type" : { + "type" : "keyword" + }, + "status" : { + "type" : "keyword" + }, + "payload" : { + "type" : "object", + "enabled" : false + }, + "search": { + "type": "object", + "dynamic": true, + "properties": { + "request": { + "type": "object", + "dynamic": true, + "properties": { + "search_type": { + "type": "keyword" + }, + "indices": { + "type": "keyword" + }, + "types": { + "type": "keyword" + } + } + } + } + }, + "http": { + "type": "object", + "dynamic": true, + "properties": { + "request": { + "type": "object", + "dynamic": true, + "properties": { + "path": { + "type": "keyword" + }, + "host": { + "type": "keyword" + } + } + } + } + } + } + }, + "condition" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "status" : { + "type" : "keyword" + }, + "met" : { + "type" : "boolean" + }, + "compare" : { + "type" : "object", + "enabled" : false + }, + "array_compare" : { + "type" : "object", + "enabled" : false + }, + "script" : { + "type" : "object", + "enabled" : false + } + } + }, + "transform" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "search" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "request" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "indices" : { + "type" : "keyword" + }, + "types" : { + "type" : "keyword" + } + } + } + } + } + } + }, + "actions": { + "type": "nested", + "include_in_parent": true, + "dynamic": true, + "properties": { + "id" : { + "type" : "keyword" + }, + "type" : { + "type" : "keyword" + }, + "status" : { + "type" : "keyword" + }, + "reason" : { + "type" : "keyword" + }, + "email": { + "type": "object", + "dynamic": true, + "properties": { + "message": { + "type": "object", + "dynamic": true, + "properties": { + "id": { + "type": "keyword" + }, + "from": { + "type": "keyword" + }, + "reply_to": { + "type": "keyword" + }, + "to": { + "type": "keyword" + }, + "cc": { + "type": "keyword" + }, + "bcc": { + "type": "keyword" + } + } + } + } + }, + "webhook": { + "type": "object", + "dynamic": true, + "properties": { + "request": { + "type": "object", + "dynamic": true, + "properties": { + "path": { + "type": "keyword" + }, + "host": { + "type": "keyword" + } + } + } + } + }, + "index": { + "type": "object", + "dynamic": true, + "properties": { + "response": { + "type": "object", + "dynamic": true, + "properties": { + "index": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "id": { + "type": "keyword" + } + } + } + } + }, + "hipchat" : { + "type": "object", + "dynamic": true, + "properties": { + "account": { + "type": "keyword" + }, + "sent_messages": { + "type": "nested", + "include_in_parent": true, + "dynamic": true, + "properties": { + "status": { + "type": "keyword" + }, + "reason": { + "type": "text" + }, + "request" : { + "type" : "object", + "enabled" : false + }, + "response" : { + "type" : "object", + "enabled" : false + }, + "room" : { + "type": "keyword" + }, + "user" : { + "type": "keyword" + }, + "message" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "message_format" : { + "type" : "keyword" + }, + "color" : { + "type" : "keyword" + }, + "notify" : { + "type" : "boolean" + }, + "message" : { + "type" : "text" + }, + "from" : { + "type" : "text" + } + } + } + } + } + } + }, + "jira" : { + "type": "object", + "dynamic": true, + "properties": { + "account": { + "type": "keyword" + }, + "reason": { + "type": "text" + }, + "request" : { + "type" : "object", + "enabled" : false + }, + "response" : { + "type" : "object", + "enabled" : false + }, + "fields": { + "type": "object", + "dynamic": true, + "properties": { + "summary": { + "type": "text" + }, + "description": { + "type": "text" + }, + "labels" : { + "type": "text" + }, + "project" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "key" : { + "type" : "keyword" + }, + "id" : { + "type" : "keyword" + } + } + }, + "issuetype" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "name" : { + "type": "keyword" + }, + "id" : { + "type" : "keyword" + } + } + } + } + }, + "result": { + "type": "object", + "dynamic": true, + "properties" : { + "id" : { + "type" : "keyword" + }, + "key" : { + "type" : "keyword" + }, + "self" : { + "type" : "keyword" + } + } + } + } + }, + "slack" : { + "type": "object", + "dynamic": true, + "properties": { + "account": { + "type": "keyword" + }, + "sent_messages": { + "type": "nested", + "include_in_parent": true, + "dynamic": true, + "properties": { + "status": { + "type": "keyword" + }, + "reason": { + "type": "text" + }, + "request" : { + "type" : "object", + "enabled" : false + }, + "response" : { + "type" : "object", + "enabled" : false + }, + "to" : { + "type": "keyword" + }, + "message" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "from" : { + "type" : "text" + }, + "icon" : { + "type" : "keyword" + }, + "text" : { + "type" : "text" + }, + "attachments" : { + "type" : "nested", + "include_in_parent": true, + "dynamic" : true, + "properties" : { + "color" : { + "type" : "keyword" + }, + "fields" : { + "properties" : { + "value" : { + "type" : "text" + } + } + } + } + } + } + } + } + } + } + }, + "pagerduty" : { + "type": "object", + "dynamic": true, + "properties": { + "account": { + "type": "keyword" + }, + "sent_event": { + "type": "nested", + "include_in_parent": true, + "dynamic": true, + "properties": { + "reason": { + "type": "text" + }, + "request" : { + "type" : "object", + "enabled" : false + }, + "response" : { + "type" : "object", + "enabled" : false + }, + "event" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "client" : { + "type" : "text" + }, + "client_url" : { + "type" : "keyword" + }, + "account" : { + "type" : "keyword" + }, + "attach_payload" : { + "type" : "boolean" + }, + "incident_key" : { + "type" : "keyword" + }, + "description" : { + "type" : "text" + }, + "context" : { + "type" : "nested", + "include_in_parent": true, + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "href" : { + "type" : "keyword" + }, + "src" : { + "type" : "keyword" + }, + "alt" : { + "type" : "text" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "metadata": { + "type": "object", + "dynamic": true + } + } + } + }, + "version": 10 +} diff --git a/x-pack/plugin/core/out/production/resources/watch-history-no-ilm.json b/x-pack/plugin/core/out/production/resources/watch-history-no-ilm.json new file mode 100644 index 0000000000000..7b5910508392d --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/watch-history-no-ilm.json @@ -0,0 +1,617 @@ +{ + "index_patterns": [ ".watcher-history-${xpack.watcher.template.version}*" ], + "order": 2147483646, + "settings": { + "index.number_of_shards": 1, + "index.number_of_replicas": 0, + "index.auto_expand_replicas": "0-1", + "index.hidden": true, + "index.format": 6 + }, + "mappings": { + "doc": { + "_meta": { + "watcher-history-version": "${xpack.watcher.template.version}" + }, + "dynamic_templates": [ + { + "disabled_payload_fields": { + "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.payload", + "match_pattern": "regex", + "mapping": { + "type": "object", + "enabled": false + } + } + }, + { + "disabled_search_request_body_fields": { + "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.search\\.request\\.(body|template)", + "match_pattern": "regex", + "mapping": { + "type": "object", + "enabled": false + } + } + }, + { + "disabled_exception_fields": { + "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*)|actions)\\.error", + "match_pattern": "regex", + "mapping": { + "type": "object", + "enabled": false + } + } + }, + { + "disabled_jira_custom_fields": { + "path_match": "result.actions.jira.fields.customfield_*", + "mapping": { + "type": "object", + "enabled": false + } + } + } + ], + "dynamic": false, + "properties": { + "watch_id": { + "type": "keyword" + }, + "node": { + "type": "keyword" + }, + "trigger_event": { + "type": "object", + "dynamic": true, + "properties": { + "type" : { + "type" : "keyword" + }, + "triggered_time": { + "type": "date" + }, + "manual": { + "type": "object", + "dynamic": true, + "properties": { + "schedule": { + "type": "object", + "dynamic": true, + "properties": { + "scheduled_time": { + "type": "date" + } + } + } + } + }, + "schedule": { + "type": "object", + "dynamic": true, + "properties": { + "scheduled_time": { + "type": "date" + } + } + } + } + }, + "vars" : { + "type" : "object", + "enabled" : false + }, + "input": { + "type": "object", + "enabled": false + }, + "condition": { + "type": "object", + "enabled": false + }, + "state": { + "type": "keyword" + }, + "status": { + "type": "object", + "enabled" : false, + "dynamic" : true + }, + "messages": { + "type": "text" + }, + "user": { + "type": "text" + }, + "exception" : { + "type" : "object", + "enabled" : false + }, + "result": { + "type": "object", + "dynamic": true, + "properties": { + "execution_time": { + "type": "date" + }, + "execution_duration": { + "type": "long" + }, + "input": { + "type": "object", + "dynamic": true, + "properties": { + "type" : { + "type" : "keyword" + }, + "status" : { + "type" : "keyword" + }, + "payload" : { + "type" : "object", + "enabled" : false + }, + "search": { + "type": "object", + "dynamic": true, + "properties": { + "request": { + "type": "object", + "dynamic": true, + "properties": { + "search_type": { + "type": "keyword" + }, + "indices": { + "type": "keyword" + }, + "types": { + "type": "keyword" + } + } + } + } + }, + "http": { + "type": "object", + "dynamic": true, + "properties": { + "request": { + "type": "object", + "dynamic": true, + "properties": { + "path": { + "type": "keyword" + }, + "host": { + "type": "keyword" + } + } + } + } + } + } + }, + "condition" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "status" : { + "type" : "keyword" + }, + "met" : { + "type" : "boolean" + }, + "compare" : { + "type" : "object", + "enabled" : false + }, + "array_compare" : { + "type" : "object", + "enabled" : false + }, + "script" : { + "type" : "object", + "enabled" : false + } + } + }, + "transform" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "search" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "request" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "indices" : { + "type" : "keyword" + }, + "types" : { + "type" : "keyword" + } + } + } + } + } + } + }, + "actions": { + "type": "nested", + "include_in_parent": true, + "dynamic": true, + "properties": { + "id" : { + "type" : "keyword" + }, + "type" : { + "type" : "keyword" + }, + "status" : { + "type" : "keyword" + }, + "reason" : { + "type" : "keyword" + }, + "email": { + "type": "object", + "dynamic": true, + "properties": { + "message": { + "type": "object", + "dynamic": true, + "properties": { + "id": { + "type": "keyword" + }, + "from": { + "type": "keyword" + }, + "reply_to": { + "type": "keyword" + }, + "to": { + "type": "keyword" + }, + "cc": { + "type": "keyword" + }, + "bcc": { + "type": "keyword" + } + } + } + } + }, + "webhook": { + "type": "object", + "dynamic": true, + "properties": { + "request": { + "type": "object", + "dynamic": true, + "properties": { + "path": { + "type": "keyword" + }, + "host": { + "type": "keyword" + } + } + } + } + }, + "index": { + "type": "object", + "dynamic": true, + "properties": { + "response": { + "type": "object", + "dynamic": true, + "properties": { + "index": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "id": { + "type": "keyword" + } + } + } + } + }, + "hipchat" : { + "type": "object", + "dynamic": true, + "properties": { + "account": { + "type": "keyword" + }, + "sent_messages": { + "type": "nested", + "include_in_parent": true, + "dynamic": true, + "properties": { + "status": { + "type": "keyword" + }, + "reason": { + "type": "text" + }, + "request" : { + "type" : "object", + "enabled" : false + }, + "response" : { + "type" : "object", + "enabled" : false + }, + "room" : { + "type": "keyword" + }, + "user" : { + "type": "keyword" + }, + "message" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "message_format" : { + "type" : "keyword" + }, + "color" : { + "type" : "keyword" + }, + "notify" : { + "type" : "boolean" + }, + "message" : { + "type" : "text" + }, + "from" : { + "type" : "text" + } + } + } + } + } + } + }, + "jira" : { + "type": "object", + "dynamic": true, + "properties": { + "account": { + "type": "keyword" + }, + "reason": { + "type": "text" + }, + "request" : { + "type" : "object", + "enabled" : false + }, + "response" : { + "type" : "object", + "enabled" : false + }, + "fields": { + "type": "object", + "dynamic": true, + "properties": { + "summary": { + "type": "text" + }, + "description": { + "type": "text" + }, + "labels" : { + "type": "text" + }, + "project" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "key" : { + "type" : "keyword" + }, + "id" : { + "type" : "keyword" + } + } + }, + "issuetype" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "name" : { + "type": "keyword" + }, + "id" : { + "type" : "keyword" + } + } + } + } + }, + "result": { + "type": "object", + "dynamic": true, + "properties" : { + "id" : { + "type" : "keyword" + }, + "key" : { + "type" : "keyword" + }, + "self" : { + "type" : "keyword" + } + } + } + } + }, + "slack" : { + "type": "object", + "dynamic": true, + "properties": { + "account": { + "type": "keyword" + }, + "sent_messages": { + "type": "nested", + "include_in_parent": true, + "dynamic": true, + "properties": { + "status": { + "type": "keyword" + }, + "reason": { + "type": "text" + }, + "request" : { + "type" : "object", + "enabled" : false + }, + "response" : { + "type" : "object", + "enabled" : false + }, + "to" : { + "type": "keyword" + }, + "message" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "from" : { + "type" : "text" + }, + "icon" : { + "type" : "keyword" + }, + "text" : { + "type" : "text" + }, + "attachments" : { + "type" : "nested", + "include_in_parent": true, + "dynamic" : true, + "properties" : { + "color" : { + "type" : "keyword" + }, + "fields" : { + "properties" : { + "value" : { + "type" : "text" + } + } + } + } + } + } + } + } + } + } + }, + "pagerduty" : { + "type": "object", + "dynamic": true, + "properties": { + "account": { + "type": "keyword" + }, + "sent_event": { + "type": "nested", + "include_in_parent": true, + "dynamic": true, + "properties": { + "reason": { + "type": "text" + }, + "request" : { + "type" : "object", + "enabled" : false + }, + "response" : { + "type" : "object", + "enabled" : false + }, + "event" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "client" : { + "type" : "text" + }, + "client_url" : { + "type" : "keyword" + }, + "account" : { + "type" : "keyword" + }, + "attach_payload" : { + "type" : "boolean" + }, + "incident_key" : { + "type" : "keyword" + }, + "description" : { + "type" : "text" + }, + "context" : { + "type" : "nested", + "include_in_parent": true, + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "href" : { + "type" : "keyword" + }, + "src" : { + "type" : "keyword" + }, + "alt" : { + "type" : "text" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "metadata": { + "type": "object", + "dynamic": true + } + } + } + }, + "version": ${xpack.watcher.template.version} +} diff --git a/x-pack/plugin/core/out/production/resources/watch-history.json b/x-pack/plugin/core/out/production/resources/watch-history.json new file mode 100644 index 0000000000000..109ca95d75190 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/watch-history.json @@ -0,0 +1,568 @@ +{ + "index_patterns": [ ".watcher-history-${xpack.watcher.template.version}*" ], + "order": 2147483647, + "settings": { + "index.number_of_shards": 1, + "index.number_of_replicas": 0, + "index.auto_expand_replicas": "0-1", + "index.lifecycle.name": "watch-history-ilm-policy", + "index.hidden": true, + "index.format": 6 + }, + "mappings": { + "_doc": { + "_meta": { + "watcher-history-version": "${xpack.watcher.template.version}" + }, + "dynamic_templates": [ + { + "disabled_payload_fields": { + "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.payload", + "match_pattern": "regex", + "mapping": { + "type": "object", + "enabled": false + } + } + }, + { + "disabled_search_request_body_fields": { + "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.search\\.request\\.(body|template)", + "match_pattern": "regex", + "mapping": { + "type": "object", + "enabled": false + } + } + }, + { + "disabled_exception_fields": { + "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*)|actions)\\.error", + "match_pattern": "regex", + "mapping": { + "type": "object", + "enabled": false + } + } + }, + { + "disabled_jira_custom_fields": { + "path_match": "result.actions.jira.fields.customfield_*", + "mapping": { + "type": "object", + "enabled": false + } + } + } + ], + "dynamic": false, + "properties": { + "watch_id": { + "type": "keyword" + }, + "node": { + "type": "keyword" + }, + "trigger_event": { + "type": "object", + "dynamic": true, + "properties": { + "type" : { + "type" : "keyword" + }, + "triggered_time": { + "type": "date" + }, + "manual": { + "type": "object", + "dynamic": true, + "properties": { + "schedule": { + "type": "object", + "dynamic": true, + "properties": { + "scheduled_time": { + "type": "date" + } + } + } + } + }, + "schedule": { + "type": "object", + "dynamic": true, + "properties": { + "scheduled_time": { + "type": "date" + } + } + } + } + }, + "vars" : { + "type" : "object", + "enabled" : false + }, + "input": { + "type": "object", + "enabled": false + }, + "condition": { + "type": "object", + "enabled": false + }, + "state": { + "type": "keyword" + }, + "status": { + "type": "object", + "enabled" : false, + "dynamic" : true + }, + "messages": { + "type": "text" + }, + "user": { + "type": "text" + }, + "exception" : { + "type" : "object", + "enabled" : false + }, + "result": { + "type": "object", + "dynamic": true, + "properties": { + "execution_time": { + "type": "date" + }, + "execution_duration": { + "type": "long" + }, + "input": { + "type": "object", + "dynamic": true, + "properties": { + "type" : { + "type" : "keyword" + }, + "status" : { + "type" : "keyword" + }, + "payload" : { + "type" : "object", + "enabled" : false + }, + "search": { + "type": "object", + "dynamic": true, + "properties": { + "request": { + "type": "object", + "dynamic": true, + "properties": { + "search_type": { + "type": "keyword" + }, + "indices": { + "type": "keyword" + }, + "types": { + "type": "keyword" + } + } + } + } + }, + "http": { + "type": "object", + "dynamic": true, + "properties": { + "request": { + "type": "object", + "dynamic": true, + "properties": { + "path": { + "type": "keyword" + }, + "host": { + "type": "keyword" + } + } + } + } + } + } + }, + "condition" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "status" : { + "type" : "keyword" + }, + "met" : { + "type" : "boolean" + }, + "compare" : { + "type" : "object", + "enabled" : false + }, + "array_compare" : { + "type" : "object", + "enabled" : false + }, + "script" : { + "type" : "object", + "enabled" : false + } + } + }, + "transform" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "search" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "request" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "indices" : { + "type" : "keyword" + }, + "types" : { + "type" : "keyword" + } + } + } + } + } + } + }, + "actions": { + "type": "nested", + "include_in_parent": true, + "dynamic": true, + "properties": { + "id" : { + "type" : "keyword" + }, + "type" : { + "type" : "keyword" + }, + "status" : { + "type" : "keyword" + }, + "reason" : { + "type" : "keyword" + }, + "number_of_actions_executed": { + "type": "integer" + }, + "foreach" : { + "type": "object", + "enabled" : false + }, + "email": { + "type": "object", + "dynamic": true, + "properties": { + "message": { + "type": "object", + "dynamic": true, + "properties": { + "id": { + "type": "keyword" + }, + "from": { + "type": "keyword" + }, + "reply_to": { + "type": "keyword" + }, + "to": { + "type": "keyword" + }, + "cc": { + "type": "keyword" + }, + "bcc": { + "type": "keyword" + } + } + } + } + }, + "webhook": { + "type": "object", + "dynamic": true, + "properties": { + "request": { + "type": "object", + "dynamic": true, + "properties": { + "path": { + "type": "keyword" + }, + "host": { + "type": "keyword" + } + } + } + } + }, + "index": { + "type": "object", + "dynamic": true, + "properties": { + "response": { + "type": "object", + "dynamic": true, + "properties": { + "index": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "id": { + "type": "keyword" + } + } + } + } + }, + "jira" : { + "type": "object", + "dynamic": true, + "properties": { + "account": { + "type": "keyword" + }, + "reason": { + "type": "text" + }, + "request" : { + "type" : "object", + "enabled" : false + }, + "response" : { + "type" : "object", + "enabled" : false + }, + "fields": { + "type": "object", + "dynamic": true, + "properties": { + "summary": { + "type": "text" + }, + "description": { + "type": "text" + }, + "labels" : { + "type": "text" + }, + "project" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "key" : { + "type" : "keyword" + }, + "id" : { + "type" : "keyword" + } + } + }, + "issuetype" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "name" : { + "type": "keyword" + }, + "id" : { + "type" : "keyword" + } + } + } + } + }, + "result": { + "type": "object", + "dynamic": true, + "properties" : { + "id" : { + "type" : "keyword" + }, + "key" : { + "type" : "keyword" + }, + "self" : { + "type" : "keyword" + } + } + } + } + }, + "slack" : { + "type": "object", + "dynamic": true, + "properties": { + "account": { + "type": "keyword" + }, + "sent_messages": { + "type": "nested", + "include_in_parent": true, + "dynamic": true, + "properties": { + "status": { + "type": "keyword" + }, + "reason": { + "type": "text" + }, + "request" : { + "type" : "object", + "enabled" : false + }, + "response" : { + "type" : "object", + "enabled" : false + }, + "to" : { + "type": "keyword" + }, + "message" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "from" : { + "type" : "text" + }, + "icon" : { + "type" : "keyword" + }, + "text" : { + "type" : "text" + }, + "attachments" : { + "type" : "nested", + "include_in_parent": true, + "dynamic" : true, + "properties" : { + "color" : { + "type" : "keyword" + }, + "fields" : { + "properties" : { + "value" : { + "type" : "text" + } + } + } + } + } + } + } + } + } + } + }, + "pagerduty" : { + "type": "object", + "dynamic": true, + "properties": { + "account": { + "type": "keyword" + }, + "sent_event": { + "type": "nested", + "include_in_parent": true, + "dynamic": true, + "properties": { + "reason": { + "type": "text" + }, + "request" : { + "type" : "object", + "enabled" : false + }, + "response" : { + "type" : "object", + "enabled" : false + }, + "event" : { + "type" : "object", + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "client" : { + "type" : "text" + }, + "client_url" : { + "type" : "keyword" + }, + "account" : { + "type" : "keyword" + }, + "attach_payload" : { + "type" : "boolean" + }, + "incident_key" : { + "type" : "keyword" + }, + "description" : { + "type" : "text" + }, + "context" : { + "type" : "nested", + "include_in_parent": true, + "dynamic" : true, + "properties" : { + "type" : { + "type" : "keyword" + }, + "href" : { + "type" : "keyword" + }, + "src" : { + "type" : "keyword" + }, + "alt" : { + "type" : "text" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "metadata": { + "type": "object", + "dynamic": true + } + } + } + }, + "version": ${xpack.watcher.template.version} +} diff --git a/x-pack/plugin/core/out/production/resources/watches.json b/x-pack/plugin/core/out/production/resources/watches.json new file mode 100644 index 0000000000000..5181dfdc864f8 --- /dev/null +++ b/x-pack/plugin/core/out/production/resources/watches.json @@ -0,0 +1,63 @@ +{ + "index_patterns": [ ".watches*" ], + "order": 2147483647, + "settings": { + "index.number_of_shards": 1, + "index.number_of_replicas": 0, + "index.auto_expand_replicas": "0-1", + "index.format": 6, + "index.priority": 800 + }, + "mappings": { + "_doc": { + "dynamic" : "strict", + "properties": { + "status": { + "type": "object", + "enabled" : false, + "dynamic" : true + }, + "trigger" : { + "type": "object", + "enabled" : false, + "dynamic" : true + }, + "input": { + "type": "object", + "enabled" : false, + "dynamic" : true + }, + "condition": { + "type": "object", + "enabled" : false, + "dynamic" : true + }, + "throttle_period": { + "type" : "keyword", + "index" : false, + "doc_values" : false + }, + "throttle_period_in_millis": { + "type" : "long", + "index" : false, + "doc_values" : false + }, + "transform": { + "type" : "object", + "enabled" : false, + "dynamic" : true + }, + "actions": { + "type" : "object", + "enabled" : false, + "dynamic" : true + }, + "metadata" : { + "type" : "object", + "dynamic": true + } + } + } + }, + "version": ${xpack.watcher.template.version} +} diff --git a/x-pack/plugin/eql/out/production/resources/META-INF/services/org.elasticsearch.painless.spi.PainlessExtension b/x-pack/plugin/eql/out/production/resources/META-INF/services/org.elasticsearch.painless.spi.PainlessExtension new file mode 100644 index 0000000000000..70e279c04909a --- /dev/null +++ b/x-pack/plugin/eql/out/production/resources/META-INF/services/org.elasticsearch.painless.spi.PainlessExtension @@ -0,0 +1 @@ +org.elasticsearch.xpack.eql.plugin.EqlPainlessExtension \ No newline at end of file diff --git a/x-pack/plugin/eql/out/production/resources/org/elasticsearch/xpack/eql/plugin/eql_whitelist.txt b/x-pack/plugin/eql/out/production/resources/org/elasticsearch/xpack/eql/plugin/eql_whitelist.txt new file mode 100644 index 0000000000000..6839583d14c1e --- /dev/null +++ b/x-pack/plugin/eql/out/production/resources/org/elasticsearch/xpack/eql/plugin/eql_whitelist.txt @@ -0,0 +1,59 @@ +# +# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +# or more contributor license agreements. Licensed under the Elastic License; +# you may not use this file except in compliance with the Elastic License. +# + +# This file contains a whitelist for EQL specific utilities and classes available inside EQL scripting + +#### Classes + +class org.elasticsearch.xpack.ql.expression.function.scalar.whitelist.InternalQlScriptUtils { + +# +# Utilities +# + def docValue(java.util.Map, String) + boolean nullSafeFilter(Boolean) + double nullSafeSortNumeric(Number) + String nullSafeSortString(Object) + +# +# Comparison +# + Boolean eq(Object, Object) + Boolean nulleq(Object, Object) + Boolean neq(Object, Object) + Boolean lt(Object, Object) + Boolean lte(Object, Object) + Boolean gt(Object, Object) + Boolean gte(Object, Object) + Boolean in(Object, java.util.List) + +# +# Logical +# + Boolean and(Boolean, Boolean) + Boolean or(Boolean, Boolean) + Boolean not(Boolean) + Boolean isNull(Object) + Boolean isNotNull(Object) + +# +# Regex +# + Boolean regex(String, String) + +# +# Math +# + Number neg(Number) +} + +class org.elasticsearch.xpack.eql.expression.function.scalar.whitelist.InternalEqlScriptUtils { + +# +# ASCII Functions +# + String substring(String, Number, Number) +} diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/SecurityRestFilter.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/SecurityRestFilter.java index 6a9a38d1f7565..ef13c53b47a68 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/SecurityRestFilter.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/SecurityRestFilter.java @@ -129,7 +129,7 @@ private RestRequest maybeWrapRestRequest(RestRequest restRequest) throws IOExcep } @Override - public boolean compatibilityRequired() { - return restHandler.compatibilityRequired(); + public String compatibleWithVersion() { + return restHandler.compatibleWithVersion(); } } From e7eda970edfec379bba6e91b8ba66495ebdedd67 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Fri, 27 Mar 2020 15:07:44 +0100 Subject: [PATCH 03/38] revert out dirs --- ...icsearch.plugins.spi.NamedXContentProvider | 6 - .../forbidden/rest-high-level-signatures.txt | 36 - .../security/delegate_pki/README.asciidoc | 35 - .../security/delegate_pki/openssl_config.cnf | 185 --- .../security/delegate_pki/testClient.crt | 21 - .../security/delegate_pki/testClient.key | 27 - .../delegate_pki/testIntermediateCA.crt | 24 - .../delegate_pki/testIntermediateCA.key | 27 - .../security/delegate_pki/testRootCA.crt | 24 - .../security/delegate_pki/testRootCA.key | 27 - ...icsearch.plugins.spi.NamedXContentProvider | 1 - ...icsearch.plugins.spi.NamedXContentProvider | 1 - ...icsearch.plugins.spi.NamedXContentProvider | 1 - .../resources/rest-api-spec/api/_common.json | 31 - .../resources/rest-api-spec/api/bulk.json | 98 -- .../rest-api-spec/api/cat.aliases.json | 71 - .../rest-api-spec/api/cat.allocation.json | 80 - .../rest-api-spec/api/cat.count.json | 55 - .../rest-api-spec/api/cat.fielddata.json | 76 - .../rest-api-spec/api/cat.health.json | 61 - .../resources/rest-api-spec/api/cat.help.json | 30 - .../rest-api-spec/api/cat.indices.json | 125 -- .../rest-api-spec/api/cat.master.json | 51 - .../rest-api-spec/api/cat.nodeattrs.json | 51 - .../rest-api-spec/api/cat.nodes.json | 89 -- .../rest-api-spec/api/cat.pending_tasks.json | 64 - .../rest-api-spec/api/cat.plugins.json | 51 - .../rest-api-spec/api/cat.recovery.json | 99 -- .../rest-api-spec/api/cat.repositories.json | 52 - .../rest-api-spec/api/cat.segments.json | 72 - .../rest-api-spec/api/cat.shards.json | 93 -- .../rest-api-spec/api/cat.snapshots.json | 77 - .../rest-api-spec/api/cat.tasks.json | 72 - .../rest-api-spec/api/cat.templates.json | 63 - .../rest-api-spec/api/cat.thread_pool.json | 75 - .../rest-api-spec/api/clear_scroll.json | 40 - .../api/cluster.allocation_explain.json | 33 - .../cluster.delete_component_template.json | 35 - .../api/cluster.get_component_template.json | 41 - .../api/cluster.get_settings.json | 38 - .../rest-api-spec/api/cluster.health.json | 105 -- .../api/cluster.pending_tasks.json | 29 - .../api/cluster.put_component_template.json | 45 - .../api/cluster.put_settings.json | 37 - .../api/cluster.remote_info.json | 20 - .../rest-api-spec/api/cluster.reroute.json | 57 - .../rest-api-spec/api/cluster.state.json | 109 -- .../rest-api-spec/api/cluster.stats.json | 41 - .../resources/rest-api-spec/api/count.json | 129 -- .../resources/rest-api-spec/api/create.json | 100 -- .../resources/rest-api-spec/api/delete.json | 99 -- .../rest-api-spec/api/delete_by_query.json | 201 --- .../api/delete_by_query_rethrottle.json | 32 - .../rest-api-spec/api/delete_script.json | 35 - .../resources/rest-api-spec/api/exists.json | 102 -- .../rest-api-spec/api/exists_source.json | 98 -- .../resources/rest-api-spec/api/explain.json | 114 -- .../rest-api-spec/api/field_caps.json | 64 - .../resources/rest-api-spec/api/get.json | 102 -- .../rest-api-spec/api/get_script.json | 31 - .../rest-api-spec/api/get_script_context.json | 19 - .../api/get_script_languages.json | 19 - .../rest-api-spec/api/get_source.json | 98 -- .../resources/rest-api-spec/api/index.json | 149 -- .../rest-api-spec/api/indices.analyze.json | 42 - .../api/indices.clear_cache.json | 73 - .../rest-api-spec/api/indices.clone.json | 47 - .../rest-api-spec/api/indices.close.json | 59 - .../rest-api-spec/api/indices.create.json | 46 - .../api/indices.create_data_stream.json | 31 - .../rest-api-spec/api/indices.delete.json | 55 - .../api/indices.delete_alias.json | 55 - .../api/indices.delete_data_stream.json | 26 - .../api/indices.delete_template.json | 35 - .../rest-api-spec/api/indices.exists.json | 60 - .../api/indices.exists_alias.json | 67 - .../api/indices.exists_template.json | 39 - .../api/indices.exists_type.json | 55 - .../rest-api-spec/api/indices.flush.json | 63 - .../api/indices.flush_synced.json | 54 - .../rest-api-spec/api/indices.forcemerge.json | 65 - .../rest-api-spec/api/indices.get.json | 68 - .../rest-api-spec/api/indices.get_alias.json | 85 -- .../api/indices.get_data_streams.json | 33 - .../api/indices.get_field_mapping.json | 121 -- .../api/indices.get_mapping.json | 103 -- .../api/indices.get_settings.json | 101 -- .../api/indices.get_template.json | 49 - .../api/indices.get_upgrade.json | 53 - .../rest-api-spec/api/indices.open.json | 59 - .../rest-api-spec/api/indices.put_alias.json | 61 - .../api/indices.put_mapping.json | 205 --- .../api/indices.put_settings.json | 73 - .../api/indices.put_template.json | 49 - .../rest-api-spec/api/indices.recovery.json | 43 - .../rest-api-spec/api/indices.refresh.json | 55 - .../rest-api-spec/api/indices.rollover.json | 66 - .../rest-api-spec/api/indices.segments.json | 58 - .../api/indices.shard_stores.json | 63 - .../rest-api-spec/api/indices.shrink.json | 51 - .../rest-api-spec/api/indices.split.json | 51 - .../rest-api-spec/api/indices.stats.json | 154 -- .../api/indices.update_aliases.json | 33 - .../rest-api-spec/api/indices.upgrade.json | 61 - .../api/indices.validate_query.json | 121 -- .../resources/rest-api-spec/api/info.json | 20 - .../api/ingest.delete_pipeline.json | 35 - .../api/ingest.get_pipeline.json | 37 - .../api/ingest.processor_grok.json | 20 - .../api/ingest.put_pipeline.json | 39 - .../rest-api-spec/api/ingest.simulate.json | 44 - .../resources/rest-api-spec/api/mget.json | 93 -- .../resources/rest-api-spec/api/msearch.json | 95 -- .../rest-api-spec/api/msearch_template.json | 86 -- .../rest-api-spec/api/mtermvectors.json | 117 -- .../rest-api-spec/api/nodes.hot_threads.json | 143 -- .../rest-api-spec/api/nodes.info.json | 91 -- .../api/nodes.reload_secure_settings.json | 37 - .../rest-api-spec/api/nodes.stats.json | 224 --- .../rest-api-spec/api/nodes.usage.json | 73 - .../resources/rest-api-spec/api/ping.json | 20 - .../rest-api-spec/api/put_script.json | 61 - .../rest-api-spec/api/rank_eval.json | 67 - .../resources/rest-api-spec/api/reindex.json | 62 - .../rest-api-spec/api/reindex_rethrottle.json | 32 - .../api/render_search_template.json | 36 - .../api/scripts_painless_execute.json | 24 - .../resources/rest-api-spec/api/scroll.json | 56 - .../resources/rest-api-spec/api/search.json | 252 ---- .../rest-api-spec/api/search_shards.json | 67 - .../rest-api-spec/api/search_template.json | 125 -- .../api/snapshot.cleanup_repository.json | 36 - .../rest-api-spec/api/snapshot.create.json | 45 - .../api/snapshot.create_repository.json | 44 - .../rest-api-spec/api/snapshot.delete.json | 35 - .../api/snapshot.delete_repository.json | 35 - .../rest-api-spec/api/snapshot.get.json | 43 - .../api/snapshot.get_repository.json | 41 - .../rest-api-spec/api/snapshot.restore.json | 44 - .../rest-api-spec/api/snapshot.status.json | 57 - .../api/snapshot.verify_repository.json | 35 - .../rest-api-spec/api/tasks.cancel.json | 45 - .../rest-api-spec/api/tasks.get.json | 35 - .../rest-api-spec/api/tasks.list.json | 55 - .../rest-api-spec/api/termvectors.json | 148 -- .../resources/rest-api-spec/api/update.json | 109 -- .../rest-api-spec/api/update_by_query.json | 217 --- .../api/update_by_query_rethrottle.json | 32 - .../rest-api-spec/test/README.asciidoc | 387 ----- .../rest-api-spec/test/bulk/10_basic.yml | 124 -- .../test/bulk/11_basic_with_types.yml | 120 -- .../test/bulk/20_list_of_strings.yml | 21 - .../bulk/21_list_of_strings_with_types.yml | 17 - .../rest-api-spec/test/bulk/30_big_string.yml | 21 - .../test/bulk/31_big_string_with_types.yml | 17 - .../rest-api-spec/test/bulk/40_source.yml | 75 - .../test/bulk/41_source_with_types.yml | 76 - .../rest-api-spec/test/bulk/50_refresh.yml | 60 - .../test/bulk/51_refresh_with_types.yml | 48 - .../rest-api-spec/test/bulk/60_deprecated.yml | 26 - .../test/bulk/70_mix_typeless_typeful.yml | 35 - .../rest-api-spec/test/bulk/80_cas.yml | 42 - .../test/bulk/81_cas_with_types.yml | 45 - .../test/cat.aliases/10_basic.yml | 489 ------ .../test/cat.aliases/20_headers.yml | 24 - .../test/cat.aliases/30_json.yml | 21 - .../test/cat.aliases/40_hidden.yml | 147 -- .../test/cat.allocation/10_basic.yml | 230 --- .../rest-api-spec/test/cat.count/10_basic.yml | 73 - .../test/cat.fielddata/10_basic.yml | 78 - .../test/cat.health/10_basic.yml | 79 - .../test/cat.indices/10_basic.yml | 275 ---- .../test/cat.indices/20_hidden.yml | 240 --- .../test/cat.nodeattrs/10_basic.yml | 70 - .../rest-api-spec/test/cat.nodes/10_basic.yml | 108 -- .../test/cat.plugins/10_basic.yml | 14 - .../test/cat.recovery/10_basic.yml | 134 -- .../test/cat.repositories/10_basic.yml | 83 - .../test/cat.segments/10_basic.yml | 167 --- .../test/cat.shards/10_basic.yml | 209 --- .../test/cat.snapshots/10_basic.yml | 79 - .../rest-api-spec/test/cat.tasks/10_basic.yml | 19 - .../test/cat.templates/10_basic.yml | 257 ---- .../test/cat.thread_pool/10_basic.yml | 80 - .../cluster.allocation_explain/10_basic.yml | 91 -- .../cluster.component_template/10_basic.yml | 47 - .../test/cluster.health/10_basic.yml | 281 ---- .../cluster.health/20_request_timeout.yml | 37 - .../cluster.health/30_indices_options.yml | 79 - .../test/cluster.pending_tasks/10_basic.yml | 14 - .../test/cluster.put_settings/10_basic.yml | 71 - .../test/cluster.remote_info/10_info.yml | 6 - .../test/cluster.reroute/10_basic.yml | 4 - .../test/cluster.reroute/11_explain.yml | 57 - .../cluster.reroute/20_response_filtering.yml | 14 - .../test/cluster.state/10_basic.yml | 19 - .../test/cluster.state/20_filtering.yml | 182 --- .../cluster.state/30_expand_wildcards.yml | 92 -- .../test/cluster.stats/10_basic.yml | 145 -- .../rest-api-spec/test/count/10_basic.yml | 61 - .../test/count/11_basic_with_types.yml | 66 - .../test/count/20_query_string.yml | 58 - .../rest-api-spec/test/create/10_with_id.yml | 31 - .../test/create/11_with_id_with_types.yml | 33 - .../test/create/15_without_id.yml | 10 - .../test/create/15_without_id_with_types.yml | 8 - .../test/create/35_external_version.yml | 30 - .../create/36_external_version_with_types.yml | 30 - .../rest-api-spec/test/create/40_routing.yml | 42 - .../test/create/41_routing_with_types.yml | 43 - .../rest-api-spec/test/create/60_refresh.yml | 86 -- .../test/create/61_refresh_with_types.yml | 82 - .../rest-api-spec/test/create/70_nested.yml | 41 - .../test/create/71_nested_with_types.yml | 42 - .../rest-api-spec/test/create/TODO.txt | 3 - .../rest-api-spec/test/delete/10_basic.yml | 21 - .../test/delete/11_shard_header.yml | 38 - .../rest-api-spec/test/delete/12_result.yml | 27 - .../test/delete/13_basic_with_types.yml | 19 - .../delete/14_shard_header_with_types.yml | 36 - .../test/delete/15_result_with_types.yml | 26 - .../rest-api-spec/test/delete/20_cas.yml | 31 - .../test/delete/21_cas_with_types.yml | 30 - .../test/delete/25_external_version.yml | 33 - .../test/delete/26_external_gte_version.yml | 52 - .../delete/27_external_version_with_types.yml | 32 - .../28_external_gte_version_with_types.yml | 53 - .../rest-api-spec/test/delete/30_routing.yml | 33 - .../test/delete/31_routing_with_types.yml | 32 - .../rest-api-spec/test/delete/50_refresh.yml | 154 -- .../test/delete/51_refresh_with_types.yml | 148 -- .../rest-api-spec/test/delete/60_missing.yml | 25 - .../test/delete/61_missing_with_types.yml | 19 - .../test/delete/70_mix_typeless_typeful.yml | 43 - .../rest-api-spec/test/delete/TODO.txt | 5 - .../rest-api-spec/test/exists/10_basic.yml | 35 - .../test/exists/11_basic_with_types.yml | 36 - .../rest-api-spec/test/exists/40_routing.yml | 41 - .../test/exists/41_routing_with_types.yml | 41 - .../test/exists/60_realtime_refresh.yml | 49 - .../exists/61_realtime_refresh_with_types.yml | 50 - .../rest-api-spec/test/exists/70_defaults.yml | 18 - .../test/exists/71_defaults_with_types.yml | 17 - .../rest-api-spec/test/exists/TODO.txt | 3 - .../rest-api-spec/test/explain/10_basic.yml | 65 - .../test/explain/11_basic_with_types.yml | 66 - .../test/explain/20_source_filtering.yml | 47 - .../21_source_filtering_with_types.yml | 44 - .../test/explain/30_query_string.yml | 67 - .../explain/31_query_string_with_types.yml | 71 - .../test/explain/40_mix_typeless_typeful.yml | 57 - .../rest-api-spec/test/explain/TODO.txt | 6 - .../test/field_caps/10_basic.yml | 325 ---- .../rest-api-spec/test/field_caps/20_meta.yml | 65 - .../test/get/100_mix_typeless_typeful.yml | 47 - .../rest-api-spec/test/get/10_basic.yml | 22 - .../test/get/11_basic_with_types.yml | 31 - .../test/get/15_default_values.yml | 22 - .../test/get/16_default_values_with_types.yml | 21 - .../test/get/20_stored_fields.yml | 57 - .../test/get/21_stored_fields_with_types.yml | 60 - .../rest-api-spec/test/get/40_routing.yml | 44 - .../test/get/41_routing_with_types.yml | 43 - .../test/get/50_with_headers.yml | 25 - .../test/get/51_with_headers_with_types.yml | 26 - .../test/get/60_realtime_refresh.yml | 49 - .../get/61_realtime_refresh_with_types.yml | 49 - .../test/get/70_source_filtering.yml | 68 - .../get/71_source_filtering_with_types.yml | 69 - .../rest-api-spec/test/get/80_missing.yml | 23 - .../test/get/81_missing_with_types.yml | 19 - .../rest-api-spec/test/get/90_versions.yml | 83 - .../test/get/91_versions_with_types.yml | 89 -- .../resources/rest-api-spec/test/get/TODO.txt | 3 - .../test/get_source/10_basic.yml | 26 - .../test/get_source/11_basic_with_types.yml | 17 - .../test/get_source/15_default_values.yml | 20 - .../16_default_values_with_types.yml | 16 - .../test/get_source/40_routing.yml | 42 - .../test/get_source/41_routing_with_types.yml | 42 - .../test/get_source/60_realtime_refresh.yml | 48 - .../61_realtime_refresh_with_types.yml | 49 - .../test/get_source/70_source_filtering.yml | 30 - .../71_source_filtering_with_types.yml | 27 - .../test/get_source/80_missing.yml | 27 - .../test/get_source/81_missing_with_types.yml | 19 - .../test/get_source/85_source_missing.yml | 38 - .../86_source_missing_with_types.yml | 39 - .../rest-api-spec/test/get_source/TODO.txt | 3 - .../rest-api-spec/test/index/10_with_id.yml | 35 - .../test/index/11_with_id_with_types.yml | 34 - .../rest-api-spec/test/index/12_result.yml | 22 - .../test/index/13_result_with_types.yml | 21 - .../test/index/15_without_id.yml | 28 - .../test/index/16_without_id_with_types.yml | 26 - .../rest-api-spec/test/index/20_optype.yml | 30 - .../test/index/21_optype_with_types.yml | 29 - .../rest-api-spec/test/index/30_cas.yml | 50 - .../test/index/35_external_version.yml | 54 - .../test/index/36_external_gte_version.yml | 55 - .../index/37_external_version_with_types.yml | 55 - .../38_external_gte_version_with_types.yml | 56 - .../rest-api-spec/test/index/40_routing.yml | 43 - .../test/index/41_routing_with_types.yml | 43 - .../rest-api-spec/test/index/60_refresh.yml | 93 -- .../test/index/61_refresh_with_types.yml | 83 - .../test/index/70_mix_typeless_typeful.yml | 102 -- .../rest-api-spec/test/index/TODO.txt | 3 - .../test/indices.analyze/10_analyze.yml | 75 - .../test/indices.analyze/20_analyze_limit.yml | 52 - .../test/indices.clear_cache/10_basic.yml | 20 - .../test/indices.clone/10_basic.yml | 111 -- .../test/indices.clone/20_source_mapping.yml | 65 - .../test/indices.clone/30_copy_settings.yml | 61 - .../test/indices.create/10_basic.yml | 173 --- .../indices.create/11_basic_with_types.yml | 143 -- .../20_mix_typeless_typeful.yml | 140 -- .../test/indices.data_stream/10_basic.yml | 33 - .../test/indices.delete/10_basic.yml | 100 -- .../test/indices.delete_alias/10_basic.yml | 33 - .../indices.delete_alias/all_path_options.yml | 224 --- .../test/indices.exists/10_basic.yml | 25 - .../indices.exists/20_read_only_index.yml | 30 - .../test/indices.exists_alias/10_basic.yml | 45 - .../test/indices.exists_template/10_basic.yml | 40 - .../test/indices.flush/10_basic.yml | 89 -- .../test/indices.forcemerge/10_basic.yml | 31 - .../test/indices.get/10_basic.yml | 167 --- .../test/indices.get/11_basic_with_types.yml | 78 - .../test/indices.get_alias/10_basic.yml | 324 ---- .../test/indices.get_alias/20_empty.yml | 19 - .../test/indices.get_alias/30_wildcards.yml | 140 -- .../indices.get_field_mapping/10_basic.yml | 54 - .../11_basic_with_types.yml | 83 - .../20_missing_field.yml | 21 - .../21_missing_field_with_types.yml | 23 - .../30_missing_type.yml | 22 - .../40_missing_index.yml | 10 - .../50_field_wildcards.yml | 133 -- .../51_field_wildcards_with_types.yml | 144 -- .../60_mix_typeless_typeful.yml | 21 - .../test/indices.get_mapping/10_basic.yml | 88 -- .../11_basic_with_types.yml | 158 -- .../indices.get_mapping/20_missing_type.yml | 106 -- .../indices.get_mapping/30_missing_index.yml | 35 - .../test/indices.get_mapping/40_aliases.yml | 25 - .../50_wildcard_expansion.yml | 135 -- .../test/indices.get_mapping/60_empty.yml | 18 - .../61_empty_with_types.yml | 20 - .../70_mix_typeless_typeful.yml | 23 - .../test/indices.get_settings/10_basic.yml | 173 --- .../test/indices.get_settings/20_aliases.yml | 26 - .../test/indices.get_settings/30_defaults.yml | 28 - .../test/indices.get_template/10_basic.yml | 85 -- .../11_basic_with_types.yml | 48 - .../indices.get_template/20_get_missing.yml | 13 - .../test/indices.open/10_basic.yml | 121 -- .../test/indices.open/20_multiple_indices.yml | 104 -- .../test/indices.put_alias/10_basic.yml | 82 - .../indices.put_alias/all_path_options.yml | 116 -- .../test/indices.put_mapping/10_basic.yml | 129 -- .../11_basic_with_types.yml | 74 - .../20_mix_typeless_typeful.yml | 83 - .../indices.put_mapping/all_path_options.yml | 165 -- .../all_path_options_with_types.yml | 227 --- .../test/indices.put_settings/10_basic.yml | 123 -- .../test/indices.put_settings/11_reset.yml | 25 - .../indices.put_settings/all_path_options.yml | 113 -- .../test/indices.put_template/10_basic.yml | 261 ---- .../11_basic_with_types.yml | 74 - .../test/indices.recovery/10_basic.yml | 157 -- .../test/indices.refresh/10_basic.yml | 58 - .../test/indices.rollover/10_basic.yml | 155 -- .../indices.rollover/20_max_doc_condition.yml | 57 - .../30_max_size_condition.yml | 60 - .../test/indices.rollover/40_mapping.yml | 72 - .../41_mapping_with_types.yml | 47 - .../test/indices.segments/10_basic.yml | 74 - .../test/indices.shard_stores/10_basic.yml | 82 - .../test/indices.shrink/10_basic.yml | 83 - .../test/indices.shrink/20_source_mapping.yml | 74 - .../test/indices.shrink/30_copy_settings.yml | 105 -- .../test/indices.sort/10_basic.yml | 158 -- .../test/indices.split/10_basic.yml | 223 --- .../test/indices.split/20_source_mapping.yml | 68 - .../test/indices.split/30_copy_settings.yml | 108 -- .../test/indices.stats/10_index.yml | 116 -- .../test/indices.stats/11_metric.yml | 164 -- .../test/indices.stats/12_level.yml | 68 - .../test/indices.stats/13_fields.yml | 328 ---- .../test/indices.stats/14_groups.yml | 78 - .../test/indices.stats/15_types.yml | 81 - .../test/indices.stats/20_translog.yml | 280 ---- .../test/indices.stats/30_segments.yml | 63 - .../indices.stats/40_updates_on_refresh.yml | 67 - .../test/indices.update_aliases/10_basic.yml | 168 --- .../indices.update_aliases/20_routing.yml | 135 -- ...30_remove_index_and_replace_with_alias.yml | 35 - .../test/indices.upgrade/10_basic.yml | 72 - .../test/indices.validate_query/10_basic.yml | 88 -- .../20_query_string.yml | 50 - .../rest-api-spec/test/info/10_info.yml | 9 - .../test/info/20_lucene_version.yml | 7 - .../rest-api-spec/test/ingest/10_basic.yml | 154 -- .../rest-api-spec/test/mget/10_basic.yml | 42 - .../test/mget/11_default_index_type.yml | 44 - .../test/mget/12_non_existent_index.yml | 33 - .../test/mget/13_missing_metadata.yml | 49 - .../mget/14_alias_to_multiple_indices.yml | 45 - .../rest-api-spec/test/mget/15_ids.yml | 73 - .../test/mget/16_basic_with_types.yml | 45 - .../test/mget/17_default_index.yml | 40 - .../mget/18_non_existent_index_with_types.yml | 30 - .../mget/19_missing_metadata_with_types.yml | 47 - .../test/mget/20_stored_fields.yml | 115 -- ...1_alias_to_multiple_indices_with_types.yml | 42 - .../test/mget/22_ids_with_types.yml | 72 - .../test/mget/23_stored_fields_with_types.yml | 120 -- .../rest-api-spec/test/mget/40_routing.yml | 45 - .../test/mget/41_routing_with_types.yml | 44 - .../test/mget/60_realtime_refresh.yml | 52 - .../mget/61_realtime_refresh_with_types.yml | 53 - .../test/mget/70_source_filtering.yml | 121 -- .../mget/71_source_filtering_with_types.yml | 119 -- .../rest-api-spec/test/mget/80_deprecated.yml | 35 - .../test/mget/80_deprecated_with_types.yml | 38 - .../rest-api-spec/test/mget/TODO.txt | 3 - .../rest-api-spec/test/mlt/10_basic.yml | 42 - .../rest-api-spec/test/mlt/20_docs.yml | 57 - .../rest-api-spec/test/mlt/30_unlike.yml | 53 - .../rest-api-spec/test/msearch/10_basic.yml | 152 -- .../rest-api-spec/test/msearch/11_status.yml | 20 - .../test/msearch/12_basic_with_types.yml | 97 -- .../test/msearch/20_typed_keys.yml | 112 -- .../test/mtermvectors/10_basic.yml | 57 - .../test/mtermvectors/11_basic_with_types.yml | 86 -- .../test/mtermvectors/20_deprecated.yml | 53 - .../mtermvectors/21_deprecated_with_types.yml | 53 - .../mtermvectors/30_mix_typeless_typeful.yml | 33 - .../test/nodes.info/10_basic.yml | 13 - .../test/nodes.info/20_transport.yml | 16 - .../test/nodes.info/30_settings.yml | 22 - .../nodes.reload_secure_settings/10_basic.yml | 8 - .../test/nodes.stats/10_basic.yml | 36 - .../test/nodes.stats/11_indices_metrics.yml | 227 --- .../nodes.stats/20_response_filtering.yml | 202 --- .../test/nodes.stats/30_discovery.yml | 42 - .../rest-api-spec/test/ping/10_ping.yml | 5 - .../rest-api-spec/test/range/10_basic.yml | 449 ------ .../test/scripts/20_get_script_context.yml | 10 - .../test/scripts/25_get_script_languages.yml | 9 - .../rest-api-spec/test/scroll/10_basic.yml | 345 ----- .../rest-api-spec/test/scroll/11_clear.yml | 121 -- .../rest-api-spec/test/scroll/12_slices.yml | 147 -- .../test/scroll/20_keep_alive.yml | 71 - .../search.aggregation/100_avg_metric.yml | 177 --- .../test/search.aggregation/10_histogram.yml | 492 ------ .../search.aggregation/110_max_metric.yml | 177 --- .../search.aggregation/120_min_metric.yml | 177 --- .../search.aggregation/130_sum_metric.yml | 177 --- .../140_value_count_metric.yml | 176 --- .../search.aggregation/150_stats_metric.yml | 195 --- .../160_extended_stats_metric.yml | 295 ---- .../170_cardinality_metric.yml | 214 --- .../180_percentiles_tdigest_metric.yml | 371 ----- .../190_percentiles_hdr_metric.yml | 450 ------ .../200_top_hits_metric.yml | 111 -- .../test/search.aggregation/20_terms.yml | 771 ---------- .../search.aggregation/220_filters_bucket.yml | 274 ---- .../test/search.aggregation/230_composite.yml | 1032 ------------- .../search.aggregation/240_max_buckets.yml | 121 -- .../test/search.aggregation/250_moving_fn.yml | 82 - .../search.aggregation/260_weighted_avg.yml | 69 - .../270_median_absolute_deviation_metric.yml | 145 -- .../search.aggregation/280_geohash_grid.yml | 62 - .../search.aggregation/280_rare_terms.yml | 362 ----- .../search.aggregation/290_geotile_grid.yml | 65 - .../test/search.aggregation/300_pipeline.yml | 100 -- .../test/search.aggregation/30_sig_terms.yml | 154 -- .../310_date_agg_per_day_of_week.yml | 44 - .../test/search.aggregation/40_range.yml | 337 ----- .../test/search.aggregation/50_filter.yml | 156 -- .../51_filter_with_types.yml | 60 - .../70_adjacency_matrix.yml | 58 - .../test/search.aggregation/80_typed_keys.yml | 237 --- .../test/search.aggregation/90_sig_text.yml | 151 -- .../test/search.highlight/10_unified.yml | 35 - .../test/search.highlight/20_fvh.yml | 45 - .../30_max_analyzed_offset.yml | 81 - .../search.highlight/40_keyword_ignore.yml | 64 - .../test/search.inner_hits/10_basic.yml | 94 -- .../test/search/100_stored_fields.yml | 44 - .../test/search/10_source_filtering.yml | 201 --- .../test/search/110_field_collapsing.yml | 469 ------ .../search/115_multiple_field_collapsing.yml | 144 -- .../test/search/120_batch_reduce_size.yml | 60 - .../search/140_pre_filter_search_shards.yml | 157 -- .../search/150_rewrite_on_coordinator.yml | 78 - .../test/search/160_exists_query.yml | 1336 ----------------- .../test/search/170_terms_query.yml | 58 - .../search/171_terms_query_with_types.yml | 63 - .../search/180_locale_dependent_mapping.yml | 41 - .../test/search/190_index_prefix_search.yml | 104 -- .../test/search/200_ignore_malformed.yml | 93 -- .../test/search/200_index_phrase_search.yml | 67 - .../test/search/20_default_values.yml | 89 -- .../test/search/210_rescore_explain.yml | 41 - .../test/search/220_total_hits_object.yml | 176 --- .../test/search/230_interval_query.yml | 450 ------ .../test/search/240_date_nanos.yml | 164 -- .../test/search/250_distance_feature.yml | 87 -- .../test/search/300_sequence_numbers.yml | 64 - .../rest-api-spec/test/search/30_limits.yml | 150 -- .../test/search/310_match_bool_prefix.yml | 363 ----- .../test/search/320_disallow_queries.yml | 147 -- .../test/search/330_distributed_sort.yml | 130 -- .../test/search/40_indices_boost.yml | 187 --- .../test/search/60_query_string.yml | 63 - .../test/search/70_response_filtering.yml | 153 -- .../test/search/80_indices_options.yml | 71 - .../test/search/90_search_after.yml | 99 -- .../rest-api-spec/test/search/issue4895.yml | 33 - .../rest-api-spec/test/search/issue9606.yml | 43 - .../test/search_shards/10_basic.yml | 101 -- .../test/snapshot.create/10_basic.yml | 119 -- .../test/snapshot.get/10_basic.yml | 193 --- .../test/snapshot.get_repository/10_basic.yml | 65 - .../test/snapshot.restore/10_basic.yml | 59 - .../test/snapshot.status/10_basic.yml | 62 - .../rest-api-spec/test/suggest/10_basic.yml | 25 - .../test/suggest/20_completion.yml | 329 ---- .../rest-api-spec/test/suggest/30_context.yml | 403 ----- .../test/suggest/40_typed_keys.yml | 57 - .../50_completion_with_multi_fields.yml | 290 ---- .../test/tasks.cancel/10_basic.yml | 7 - .../rest-api-spec/test/tasks.get/10_basic.yml | 8 - .../test/tasks.list/10_basic.yml | 38 - .../test/termvectors/10_basic.yml | 36 - .../test/termvectors/11_basic_with_types.yml | 36 - .../test/termvectors/20_issue7121.yml | 44 - .../termvectors/21_issue7121_with_types.yml | 42 - .../test/termvectors/30_realtime.yml | 42 - .../termvectors/31_realtime_with_types.yml | 40 - .../termvectors/50_mix_typeless_typeful.yml | 46 - .../rest-api-spec/test/update/10_doc.yml | 40 - .../test/update/11_shard_header.yml | 41 - .../rest-api-spec/test/update/12_result.yml | 51 - .../test/update/13_legacy_doc.yml | 36 - .../update/14_shard_header_with_types.yml | 39 - .../test/update/15_result_with_types.yml | 52 - .../rest-api-spec/test/update/16_noop.yml | 43 - .../test/update/20_doc_upsert.yml | 40 - .../test/update/21_doc_upsert_with_types.yml | 41 - .../test/update/22_doc_as_upsert.yml | 40 - .../update/24_doc_as_upsert_with_types.yml | 41 - .../test/update/35_if_seq_no.yml | 64 - .../rest-api-spec/test/update/40_routing.yml | 58 - .../test/update/41_routing_with_types.yml | 58 - .../rest-api-spec/test/update/60_refresh.yml | 123 -- .../test/update/61_refresh_with_types.yml | 115 -- .../test/update/80_source_filtering.yml | 21 - .../update/81_source_filtering_with_types.yml | 19 - .../test/update/85_fields_meta.yml | 31 - .../test/update/86_fields_meta_with_types.yml | 33 - .../rest-api-spec/test/update/90_error.yml | 13 - .../test/update/90_mix_typeless_typeful.yml | 86 -- .../rest-api-spec/test/update/TODO.txt | 5 - .../resources/ilm-history-ilm-policy.json | 18 - .../out/production/resources/ilm-history.json | 85 -- .../resources/logstash-management.json | 50 - .../resources/monitoring-alerts-7.json | 60 - .../resources/monitoring-beats.json | 719 --------- .../production/resources/monitoring-es.json | 1156 -------------- .../resources/monitoring-kibana.json | 232 --- .../resources/monitoring-logstash.json | 412 ----- .../core/ml/annotations_index_mappings.json | 36 - .../results_index_mappings.json | 478 ------ .../results_index_template.json | 20 - .../state_index_template.json | 23 - .../xpack/core/ml/config_index_mappings.json | 371 ----- .../xpack/core/ml/config_index_template.json | 15 - .../core/ml/inference_index_template.json | 75 - .../xpack/core/ml/meta_index_template.json | 47 - .../core/ml/notifications_index_template.json | 47 - .../xpack/core/ml/size_based_ilm_policy.json | 11 - .../xpack/core/ml/stats_index_mappings.json | 132 -- .../xpack/core/ml/stats_index_template.json | 17 - .../idp/saml-service-provider-template.json | 99 -- .../resources/security-index-template-7.json | 289 ---- .../security-tokens-index-template-7.json | 108 -- .../resources/slm-history-ilm-policy.json | 18 - .../out/production/resources/slm-history.json | 61 - .../resources/triggered-watches.json | 41 - .../resources/watch-history-10.json | 567 ------- .../resources/watch-history-ilm-policy.json | 10 - .../resources/watch-history-no-ilm-10.json | 616 -------- .../resources/watch-history-no-ilm.json | 617 -------- .../production/resources/watch-history.json | 568 ------- .../out/production/resources/watches.json | 63 - ...asticsearch.painless.spi.PainlessExtension | 1 - .../xpack/eql/plugin/eql_whitelist.txt | 59 - 601 files changed, 55668 deletions(-) delete mode 100644 client/rest-high-level/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider delete mode 100644 client/rest-high-level/out/production/resources/forbidden/rest-high-level-signatures.txt delete mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/README.asciidoc delete mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/openssl_config.cnf delete mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.crt delete mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.key delete mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.crt delete mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.key delete mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.crt delete mode 100644 client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.key delete mode 100644 modules/aggs-matrix-stats/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider delete mode 100644 modules/parent-join/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider delete mode 100644 modules/rank-eval/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/_common.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/bulk.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.aliases.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.allocation.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.count.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.fielddata.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.health.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.help.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.indices.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.master.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodeattrs.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodes.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.pending_tasks.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.plugins.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.recovery.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.repositories.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.segments.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.shards.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.snapshots.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.tasks.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.templates.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cat.thread_pool.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/clear_scroll.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.allocation_explain.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.delete_component_template.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_component_template.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_settings.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.health.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.pending_tasks.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_component_template.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_settings.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.remote_info.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.reroute.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.state.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/cluster.stats.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/count.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/create.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/delete.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query_rethrottle.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/delete_script.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/exists.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/exists_source.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/explain.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/field_caps.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/get.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/get_script.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/get_script_context.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/get_script_languages.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/get_source.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/index.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.analyze.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.clear_cache.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.clone.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.close.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.create.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.create_data_stream.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_alias.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_data_stream.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_template.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_alias.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_template.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_type.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush_synced.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.forcemerge.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_alias.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_data_streams.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_field_mapping.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_mapping.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_settings.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_template.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_upgrade.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.open.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_alias.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_mapping.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_settings.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_template.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.recovery.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.refresh.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.rollover.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.segments.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.shard_stores.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.shrink.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.split.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.stats.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.update_aliases.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.upgrade.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/indices.validate_query.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/info.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/ingest.delete_pipeline.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/ingest.get_pipeline.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/ingest.processor_grok.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/ingest.put_pipeline.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/ingest.simulate.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/mget.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/msearch.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/msearch_template.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/mtermvectors.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/nodes.hot_threads.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/nodes.info.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/nodes.reload_secure_settings.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/nodes.stats.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/nodes.usage.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/ping.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/put_script.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/rank_eval.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/reindex.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/reindex_rethrottle.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/render_search_template.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/scripts_painless_execute.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/scroll.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/search.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/search_shards.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/search_template.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.cleanup_repository.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create_repository.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete_repository.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get_repository.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.restore.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.status.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.verify_repository.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/tasks.cancel.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/tasks.get.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/tasks.list.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/termvectors.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/update.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query_rethrottle.json delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/README.asciidoc delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/11_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/20_list_of_strings.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/21_list_of_strings_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/30_big_string.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/31_big_string_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/40_source.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/41_source_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/50_refresh.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/51_refresh_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/60_deprecated.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/70_mix_typeless_typeful.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/80_cas.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/bulk/81_cas_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/20_headers.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/30_json.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/40_hidden.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.allocation/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.count/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.fielddata/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.health/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/20_hidden.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodeattrs/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodes/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.plugins/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.recovery/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.repositories/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.segments/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.shards/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.snapshots/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.tasks/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.templates/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cat.thread_pool/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.allocation_explain/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.component_template/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/20_request_timeout.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/30_indices_options.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.pending_tasks/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.put_settings/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.remote_info/10_info.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/11_explain.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/20_response_filtering.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/20_filtering.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/30_expand_wildcards.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/cluster.stats/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/count/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/count/11_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/count/20_query_string.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/10_with_id.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/11_with_id_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/35_external_version.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/36_external_version_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/40_routing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/41_routing_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/60_refresh.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/61_refresh_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/70_nested.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/71_nested_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/create/TODO.txt delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/11_shard_header.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/12_result.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/13_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/14_shard_header_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/15_result_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/20_cas.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/21_cas_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/25_external_version.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/26_external_gte_version.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/27_external_version_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/28_external_gte_version_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/30_routing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/31_routing_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/50_refresh.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/51_refresh_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/60_missing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/61_missing_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/70_mix_typeless_typeful.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/delete/TODO.txt delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/11_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/40_routing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/41_routing_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/60_realtime_refresh.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/61_realtime_refresh_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/70_defaults.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/71_defaults_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/exists/TODO.txt delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/11_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/20_source_filtering.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/21_source_filtering_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/30_query_string.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/31_query_string_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/40_mix_typeless_typeful.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/explain/TODO.txt delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/20_meta.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/100_mix_typeless_typeful.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/11_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/15_default_values.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/16_default_values_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/20_stored_fields.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/21_stored_fields_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/40_routing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/41_routing_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/50_with_headers.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/51_with_headers_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/60_realtime_refresh.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/61_realtime_refresh_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/70_source_filtering.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/71_source_filtering_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/80_missing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/81_missing_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/90_versions.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/91_versions_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get/TODO.txt delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/11_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/15_default_values.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/16_default_values_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/40_routing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/41_routing_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/60_realtime_refresh.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/61_realtime_refresh_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/70_source_filtering.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/71_source_filtering_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/80_missing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/81_missing_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/85_source_missing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/86_source_missing_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/get_source/TODO.txt delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/10_with_id.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/11_with_id_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/12_result.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/13_result_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/15_without_id.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/16_without_id_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/20_optype.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/21_optype_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/30_cas.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/35_external_version.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/36_external_gte_version.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/37_external_version_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/38_external_gte_version_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/40_routing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/41_routing_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/60_refresh.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/61_refresh_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/70_mix_typeless_typeful.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/index/TODO.txt delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/10_analyze.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/20_analyze_limit.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.clear_cache/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/11_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/20_mix_typeless_typeful.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.data_stream/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/20_read_only_index.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_alias/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_template/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.flush/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.forcemerge/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/11_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/20_empty.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/30_wildcards.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/11_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/20_missing_field.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/21_missing_field_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/30_missing_type.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/40_missing_index.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/50_field_wildcards.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/51_field_wildcards_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/60_mix_typeless_typeful.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/11_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/20_missing_type.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/30_missing_index.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/40_aliases.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/50_wildcard_expansion.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/60_empty.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/61_empty_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/70_mix_typeless_typeful.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/20_aliases.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/11_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/20_get_missing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/20_multiple_indices.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/11_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/20_mix_typeless_typeful.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/11_reset.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/all_path_options.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/11_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.recovery/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.refresh/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/30_max_size_condition.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/40_mapping.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/41_mapping_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.segments/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.shard_stores/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.sort/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/20_source_mapping.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/30_copy_settings.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/10_index.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/11_metric.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/12_level.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/13_fields.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/14_groups.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/15_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/20_translog.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/30_segments.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/40_updates_on_refresh.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/20_routing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/30_remove_index_and_replace_with_alias.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.upgrade/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/20_query_string.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/info/10_info.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/info/20_lucene_version.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/ingest/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/11_default_index_type.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/12_non_existent_index.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/13_missing_metadata.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/14_alias_to_multiple_indices.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/15_ids.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/16_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/17_default_index.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/18_non_existent_index_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/19_missing_metadata_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/20_stored_fields.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/21_alias_to_multiple_indices_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/22_ids_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/23_stored_fields_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/40_routing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/41_routing_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/60_realtime_refresh.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/61_realtime_refresh_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/70_source_filtering.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/71_source_filtering_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mget/TODO.txt delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mlt/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mlt/20_docs.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mlt/30_unlike.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/msearch/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/msearch/11_status.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/msearch/12_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/msearch/20_typed_keys.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/11_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/20_deprecated.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/21_deprecated_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/30_mix_typeless_typeful.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/20_transport.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/30_settings.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.reload_secure_settings/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/20_response_filtering.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/30_discovery.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/ping/10_ping.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/range/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/scripts/20_get_script_context.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/scripts/25_get_script_languages.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/scroll/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/scroll/11_clear.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/scroll/12_slices.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/scroll/20_keep_alive.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/100_avg_metric.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/10_histogram.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/110_max_metric.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/120_min_metric.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/130_sum_metric.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/140_value_count_metric.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/150_stats_metric.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/160_extended_stats_metric.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/170_cardinality_metric.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/180_percentiles_tdigest_metric.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/190_percentiles_hdr_metric.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/200_top_hits_metric.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/20_terms.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/220_filters_bucket.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/230_composite.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/250_moving_fn.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/260_weighted_avg.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/270_median_absolute_deviation_metric.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_geohash_grid.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_rare_terms.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/290_geotile_grid.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/300_pipeline.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/30_sig_terms.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/310_date_agg_per_day_of_week.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/40_range.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/50_filter.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/51_filter_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/70_adjacency_matrix.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/80_typed_keys.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/90_sig_text.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/10_unified.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/20_fvh.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/30_max_analyzed_offset.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/40_keyword_ignore.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search.inner_hits/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/100_stored_fields.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/10_source_filtering.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/110_field_collapsing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/115_multiple_field_collapsing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/120_batch_reduce_size.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/140_pre_filter_search_shards.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/150_rewrite_on_coordinator.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/160_exists_query.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/170_terms_query.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/171_terms_query_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/190_index_prefix_search.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/200_ignore_malformed.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/200_index_phrase_search.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/20_default_values.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/210_rescore_explain.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/220_total_hits_object.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/230_interval_query.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/240_date_nanos.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/250_distance_feature.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/300_sequence_numbers.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/30_limits.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/310_match_bool_prefix.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/320_disallow_queries.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/330_distributed_sort.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/40_indices_boost.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/60_query_string.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/70_response_filtering.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/80_indices_options.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/90_search_after.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/issue4895.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search/issue9606.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/search_shards/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.create/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get_repository/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.restore/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.status/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/suggest/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/suggest/20_completion.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/suggest/30_context.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/suggest/40_typed_keys.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/suggest/50_completion_with_multi_fields.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/tasks.cancel/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/tasks.get/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/tasks.list/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/10_basic.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/11_basic_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/20_issue7121.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/21_issue7121_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/30_realtime.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/31_realtime_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/50_mix_typeless_typeful.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/10_doc.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/11_shard_header.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/12_result.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/13_legacy_doc.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/14_shard_header_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/15_result_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/16_noop.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/20_doc_upsert.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/21_doc_upsert_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/22_doc_as_upsert.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/24_doc_as_upsert_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/35_if_seq_no.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/40_routing.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/41_routing_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/60_refresh.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/61_refresh_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/80_source_filtering.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/81_source_filtering_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/85_fields_meta.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/86_fields_meta_with_types.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/90_error.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/90_mix_typeless_typeful.yml delete mode 100644 rest-api-spec/out/production/resources/rest-api-spec/test/update/TODO.txt delete mode 100644 x-pack/plugin/core/out/production/resources/ilm-history-ilm-policy.json delete mode 100644 x-pack/plugin/core/out/production/resources/ilm-history.json delete mode 100644 x-pack/plugin/core/out/production/resources/logstash-management.json delete mode 100644 x-pack/plugin/core/out/production/resources/monitoring-alerts-7.json delete mode 100644 x-pack/plugin/core/out/production/resources/monitoring-beats.json delete mode 100644 x-pack/plugin/core/out/production/resources/monitoring-es.json delete mode 100644 x-pack/plugin/core/out/production/resources/monitoring-kibana.json delete mode 100644 x-pack/plugin/core/out/production/resources/monitoring-logstash.json delete mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/annotations_index_mappings.json delete mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_mappings.json delete mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_template.json delete mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/state_index_template.json delete mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_mappings.json delete mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_template.json delete mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/inference_index_template.json delete mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/meta_index_template.json delete mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/notifications_index_template.json delete mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/size_based_ilm_policy.json delete mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_mappings.json delete mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_template.json delete mode 100644 x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/idp/saml-service-provider-template.json delete mode 100644 x-pack/plugin/core/out/production/resources/security-index-template-7.json delete mode 100644 x-pack/plugin/core/out/production/resources/security-tokens-index-template-7.json delete mode 100644 x-pack/plugin/core/out/production/resources/slm-history-ilm-policy.json delete mode 100644 x-pack/plugin/core/out/production/resources/slm-history.json delete mode 100644 x-pack/plugin/core/out/production/resources/triggered-watches.json delete mode 100644 x-pack/plugin/core/out/production/resources/watch-history-10.json delete mode 100644 x-pack/plugin/core/out/production/resources/watch-history-ilm-policy.json delete mode 100644 x-pack/plugin/core/out/production/resources/watch-history-no-ilm-10.json delete mode 100644 x-pack/plugin/core/out/production/resources/watch-history-no-ilm.json delete mode 100644 x-pack/plugin/core/out/production/resources/watch-history.json delete mode 100644 x-pack/plugin/core/out/production/resources/watches.json delete mode 100644 x-pack/plugin/eql/out/production/resources/META-INF/services/org.elasticsearch.painless.spi.PainlessExtension delete mode 100644 x-pack/plugin/eql/out/production/resources/org/elasticsearch/xpack/eql/plugin/eql_whitelist.txt diff --git a/client/rest-high-level/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider b/client/rest-high-level/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider deleted file mode 100644 index 45d9e3da90817..0000000000000 --- a/client/rest-high-level/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider +++ /dev/null @@ -1,6 +0,0 @@ -org.elasticsearch.client.indexlifecycle.IndexLifecycleNamedXContentProvider -org.elasticsearch.client.ml.dataframe.MlDataFrameAnalysisNamedXContentProvider -org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider -org.elasticsearch.client.ml.dataframe.stats.AnalysisStatsNamedXContentProvider -org.elasticsearch.client.ml.inference.MlInferenceNamedXContentProvider -org.elasticsearch.client.transform.TransformNamedXContentProvider diff --git a/client/rest-high-level/out/production/resources/forbidden/rest-high-level-signatures.txt b/client/rest-high-level/out/production/resources/forbidden/rest-high-level-signatures.txt deleted file mode 100644 index b9224ffe64971..0000000000000 --- a/client/rest-high-level/out/production/resources/forbidden/rest-high-level-signatures.txt +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to Elasticsearch under one or more contributor -# license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright -# ownership. Elasticsearch licenses this file to you under -# the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on -# an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the License for the specific -# language governing permissions and limitations under the License. - -@defaultMessage Use Request#createContentType(XContentType) to be sure to pass the right MIME type -org.apache.http.entity.ContentType#create(java.lang.String) -org.apache.http.entity.ContentType#create(java.lang.String,java.lang.String) -org.apache.http.entity.ContentType#create(java.lang.String,java.nio.charset.Charset) -org.apache.http.entity.ContentType#create(java.lang.String,org.apache.http.NameValuePair[]) - -@defaultMessage ES's logging infrastructure uses log4j2 which we don't want to force on high level rest client users -org.elasticsearch.common.logging.DeprecationLogger -org.elasticsearch.common.logging.LogConfigurator -org.elasticsearch.common.logging.LoggerMessageFormat -org.elasticsearch.common.logging.Loggers -org.elasticsearch.common.logging.NodeNamePatternConverter -org.elasticsearch.common.logging.PrefixLogger - -@defaultMessage We can't rely on log4j2 being on the classpath so don't log deprecations! -org.elasticsearch.common.xcontent.LoggingDeprecationHandler - -@defaultMessage Use Nonblocking org.apache.http.nio.entity.NByteArrayEntity -org.apache.http.entity.ByteArrayEntity -org.apache.http.entity.StringEntity diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/README.asciidoc b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/README.asciidoc deleted file mode 100644 index 3230bdde7e2ce..0000000000000 --- a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/README.asciidoc +++ /dev/null @@ -1,35 +0,0 @@ -= Certificate Chain details -This document details the steps used to create the certificate chain in this directory. -The chain has a length of 3: the Root CA, the Intermediate CA and the Client Certificate. -All openssl commands use the same configuration file, albeit different sections of it. -The OpenSSL Configuration file is located in this directory as `openssl_config.cnf`. - -== Instructions on generating self-signed Root CA -The self-signed Root CA, 'testRootCA.crt', and its associated private key in this directory -have been generated using the following openssl commands. - -[source,shell] ------------------------------------------------------------------------------------------------------------ -openssl genrsa -out testRootCA.key 2048 -openssl req -x509 -new -key testRootCA.key -days 1460 -subj "/CN=Elasticsearch Test Root CA/OU=elasticsearch/O=org" -out testRootCA.crt -config ./openssl_config.cnf ------------------------------------------------------------------------------------------------------------ - -== Instructions on generating the Intermediate CA -The `testIntermediateCA.crt` CA certificate is "issued" by the `testRootCA.crt`. - -[source,shell] ------------------------------------------------------------------------------------------------------------ -openssl genrsa -out testIntermediateCA.key 2048 -openssl req -new -key testIntermediateCA.key -subj "/CN=Elasticsearch Test Intermediate CA/OU=Elasticsearch/O=org" -out testIntermediateCA.csr -config ./openssl_config.cnf -openssl x509 -req -in testIntermediateCA.csr -CA testRootCA.crt -CAkey testRootCA.key -CAcreateserial -out testIntermediateCA.crt -days 1460 -sha256 -extensions v3_ca -extfile ./openssl_config.cnf ------------------------------------------------------------------------------------------------------------ - -== Instructions on generating the Client Certificate -The `testClient.crt` end entity certificate is "issued" by the `testIntermediateCA.crt`. - -[source,shell] ------------------------------------------------------------------------------------------------------------ -openssl genrsa -out testClient.key 2048 -openssl req -new -key testClient.key -subj "/CN=Elasticsearch Test Client/OU=Elasticsearch/O=org" -out testClient.csr -config ./openssl_config.cnf -openssl x509 -req -in testClient.csr -CA testIntermediateCA.crt -CAkey testIntermediateCA.key -CAcreateserial -out testClient.crt -days 1460 -sha256 -extensions usr_cert -extfile ./openssl_config.cnf ------------------------------------------------------------------------------------------------------------ diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/openssl_config.cnf b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/openssl_config.cnf deleted file mode 100644 index 64ff556f35219..0000000000000 --- a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/openssl_config.cnf +++ /dev/null @@ -1,185 +0,0 @@ -#################################################################### -# CA Definition -[ ca ] -default_ca = CA_default # The default ca section - -#################################################################### -# Per the above, this is where we define CA values -[ CA_default ] - -# By default we use "user certificate" extensions when signing -x509_extensions = usr_cert # The extentions to add to the cert - -# Honor extensions requested of us -copy_extensions = copy - -# Comment out the following two lines for the "traditional" -# (and highly broken) format. -name_opt = ca_default # Subject Name options -cert_opt = ca_default # Certificate field options - -# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs -# so this is commented out by default to leave a V1 CRL. -# crlnumber must also be commented out to leave a V1 CRL. -#crl_extensions = crl_ext -default_days = 1460 # how long to certify for -default_md = sha256 # which md to use. -preserve = no # keep passed DN ordering - -# A few difference way of specifying how similar the request should look -# For type CA, the listed attributes must be the same, and the optional -# and supplied fields are just that :-) -policy = policy_anything - -#################################################################### -# The default policy for the CA when signing requests, requires some -# resemblence to the CA cert -# -[ policy_match ] -countryName = match # Must be the same as the CA -stateOrProvinceName = match # Must be the same as the CA -organizationName = match # Must be the same as the CA -organizationalUnitName = optional # not required -commonName = supplied # must be there, whatever it is -emailAddress = optional # not required - -#################################################################### -# An alternative policy not referred to anywhere in this file. Can -# be used by specifying '-policy policy_anything' to ca(8). -# -[ policy_anything ] -countryName = optional -stateOrProvinceName = optional -localityName = optional -organizationName = optional -organizationalUnitName = optional -commonName = supplied -emailAddress = optional - -#################################################################### -# This is where we define how to generate CSRs -[ req ] -default_bits = 2048 -default_keyfile = privkey.pem -distinguished_name = req_distinguished_name # where to get DN for reqs -attributes = req_attributes # req attributes -x509_extensions = v3_ca # The extentions to add to self signed certs -req_extensions = v3_req # The extensions to add to req's - -# This sets a mask for permitted string types. There are several options. -# default: PrintableString, T61String, BMPString. -# pkix : PrintableString, BMPString. -# utf8only: only UTF8Strings. -# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). -# MASK:XXXX a literal mask value. -# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings -# so use this option with caution! -string_mask = nombstr - - -#################################################################### -# Per "req" section, this is where we define DN info -[ req_distinguished_name ] - -0.organizationName = Organization Name (company) -0.organizationName_default = org - -organizationalUnitName = Organizational Unit Name (eg, section) -organizationalUnitName_default = elasticsearch - -commonName = Common Name (hostname, IP, or your name) -commonName_default = Elasticsearch Test Certificate -commonName_max = 64 - -#################################################################### -# We don't want these, but the section must exist -[ req_attributes ] -#challengePassword = A challenge password -#challengePassword_min = 4 -#challengePassword_max = 20 -#unstructuredName = An optional company name - - -#################################################################### -# Extensions for when we sign normal certs (specified as default) -[ usr_cert ] - -# User certs aren't CAs, by definition -basicConstraints=CA:false - -# Here are some examples of the usage of nsCertType. If it is omitted -# the certificate can be used for anything *except* object signing. -# This is OK for an SSL server. -#nsCertType = server -# For an object signing certificate this would be used. -#nsCertType = objsign -# For normal client use this is typical -#nsCertType = client, email -# and for everything including object signing: -#nsCertType = client, email, objsign -# This is typical in keyUsage for a client certificate. -#keyUsage = nonRepudiation, digitalSignature, keyEncipherment - -# PKIX recommendations harmless if included in all certificates. -subjectKeyIdentifier=hash -authorityKeyIdentifier=keyid,issuer - -# This stuff is for subjectAltName and issuerAltname. -# Import the email address. -#subjectAltName=email:copy -# An alternative to produce certificates that aren't -# deprecated according to PKIX. -#subjectAltName=email:move - - -#################################################################### -# Extension for requests -[ v3_req ] -basicConstraints = CA:FALSE - -# PKIX recommendation. -subjectKeyIdentifier = hash - -subjectAltName = @alt_names - -#################################################################### -# An alternative section of extensions, not referred to anywhere -# else in the config. We'll use this via '-extensions v3_ca' when -# using ca(8) to sign another CA. -# -[ v3_ca ] - -# PKIX recommendation. -subjectKeyIdentifier=hash -authorityKeyIdentifier = keyid,issuer - -# This is what PKIX recommends but some broken software chokes on critical -# extensions. -#basicConstraints = critical,CA:true -# So we do this instead. -basicConstraints = CA:true - -# Key usage: this is typical for a CA certificate. However since it will -# prevent it being used as an test self-signed certificate it is best -# left out by default. -# keyUsage = cRLSign, keyCertSign - -# Some might want this also -# nsCertType = sslCA, emailCA - -# Include email address in subject alt name: another PKIX recommendation -#subjectAltName=email:move -# Copy issuer details -#issuerAltName=issuer:copy - -subjectAltName = @alt_names - -[ alt_names ] -DNS.1 = localhost -DNS.2 = localhost.localdomain -DNS.3 = localhost4 -DNS.4 = localhost4.localdomain4 -DNS.5 = localhost6 -DNS.6 = localhost6.localdomain6 -IP.1 = 127.0.0.1 -IP.2 = ::1 diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.crt b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.crt deleted file mode 100644 index 45efce91ef33a..0000000000000 --- a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.crt +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDbTCCAlWgAwIBAgIJAIxTS7Qdho9jMA0GCSqGSIb3DQEBCwUAMFMxKzApBgNV -BAMTIkVsYXN0aWNzZWFyY2ggVGVzdCBJbnRlcm1lZGlhdGUgQ0ExFjAUBgNVBAsT -DUVsYXN0aWNzZWFyY2gxDDAKBgNVBAoTA29yZzAeFw0xOTA3MTkxMzMzNDFaFw0y -MzA3MTgxMzMzNDFaMEoxIjAgBgNVBAMTGUVsYXN0aWNzZWFyY2ggVGVzdCBDbGll -bnQxFjAUBgNVBAsTDUVsYXN0aWNzZWFyY2gxDDAKBgNVBAoTA29yZzCCASIwDQYJ -KoZIhvcNAQEBBQADggEPADCCAQoCggEBANHgMX2aX8t0nj4sGLNuKISmmXIYCj9R -wRqS7L03l9Nng7kOKnhHu/nXDt7zMRJyHj+q6FAt5khlavYSVCQyrDybRuA5z31g -OdqXerrjs2OXS5HSHNvoDAnHFsaYX/5geMewVTtc/vqpd7Ph/QtaKfmG2FK0JNQo -0k24tcgCIcyMtBh6BA70yGBM0OT8GdOgd/d/mA7mRhaxIUMNYQzRYRsp4hMnnWoO -TkR5Q8KSO3MKw9dPSpPe8EnwtJE10S3s5aXmgytru/xQqrFycPBNj4KbKVmqMP0G -60CzXik5pr2LNvOFz3Qb6sYJtqeZF+JKgGWdaTC89m63+TEnUHqk0lcCAwEAAaNN -MEswCQYDVR0TBAIwADAdBgNVHQ4EFgQU/+aAD6Q4mFq1vpHorC25/OY5zjcwHwYD -VR0jBBgwFoAU8siFCiMiYZZm/95qFC75AG/LRE0wDQYJKoZIhvcNAQELBQADggEB -AIRpCgDLpvXcgDHUk10uhxev21mlIbU+VP46ANnCuj0UELhTrdTuWvO1PAI4z+Wb -DUxryQfOOXO9R6D0dE5yR56L/J7d+KayW34zU7yRDZM7+rXpocdQ1Ex8mjP9HJ/B -f56YZTBQJpXeDrKow4FvtkI3bcIMkqmbG16LHQXeG3RS4ds4S4wCnE2nA6vIn9y+ -4R999q6y1VSBORrYULcDWxS54plHLEdiMr1vVallg82AGobS9GMcTL2U4Nx5IYZG -7sbTk3LrDxVpVg/S2wLofEdOEwqCeHug/iOihNLJBabEW6z4TDLJAVW5KCY1Dfhk -YlBfHn7vxKkfKoCUK/yLWWI= ------END CERTIFICATE----- diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.key b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.key deleted file mode 100644 index 186e6f86745f1..0000000000000 --- a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testClient.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEA0eAxfZpfy3SePiwYs24ohKaZchgKP1HBGpLsvTeX02eDuQ4q -eEe7+dcO3vMxEnIeP6roUC3mSGVq9hJUJDKsPJtG4DnPfWA52pd6uuOzY5dLkdIc -2+gMCccWxphf/mB4x7BVO1z++ql3s+H9C1op+YbYUrQk1CjSTbi1yAIhzIy0GHoE -DvTIYEzQ5PwZ06B393+YDuZGFrEhQw1hDNFhGyniEyedag5ORHlDwpI7cwrD109K -k97wSfC0kTXRLezlpeaDK2u7/FCqsXJw8E2PgpspWaow/QbrQLNeKTmmvYs284XP -dBvqxgm2p5kX4kqAZZ1pMLz2brf5MSdQeqTSVwIDAQABAoIBAQDAjP767Ioc4LZZ -9h0HafaUlUDMs4+bPkd7OPcoNnv+AceRHZULW0zz0EIdfGM2OCrWYNfYz/Op0hpK -/s/hkfgBdriU+ZUKwyDxEu8Pzd6EbYdwlqPRgdihk92qgJv5hsro8jeQSibJFHf1 -Ok3tf2BpRTTs08fCOl2P3vowMPyPa5Ho9bf4lzP8IsR2BZvoaev3za9ZWR6ZDzE6 -EWkBBNgIU4aPn1IJ6dz2+rVtN6+xXET0eYSBEac3xMQaPWLEX0EDBYPW1d+mUva/ -3lJvTrs3g8oyiTyVu0l9Yxdgox1mtgmrqqwxJ6XuouzImuXMMDXaz0K/E/+u2yPF -V6kRvWuJAoGBAPOnEgBC3ezl+x+47cgbwpy97uZhZmV9HkMrSH9DKDwC+t57TdGX -ypt2S/IS/vbPupFv0aHaWmJ6SN/HyTN4znwuulV3kE8mEpQzIPbluWfgQzT6ukJe -+YFI/+IXwIRBLA7khtfo01LGHSmLTENsnd/aoRySY3K6zJz36Ys3vFdjAoGBANyC -7rF5YjPdgsAgOT7EboNGkc8UuW/Sh3xRp0c4Y+PBenf60yA5XkRJLYR4sZDjWTr0 -aKBY7Y8r+59U+bBrwUuhhoW08JZ/SBWja05+4DhH0ToA3vtbPv9lRyQfkF1DdBkn -XpyM2vaJE5M454acwnKJ81AyoueYtZ8pD3Q7c219AoGAJ+F1wdMwDgGKvCOB0Boz -HYK9IrpYj04OcQIZqLLuV/xI4befAiptQEr5nVLcprtTl1CNKIfb+Xh4iyBhX2pr -qcngN/MNDNd3fQhtYdwyH72GYpqTeB+hiTbQo0ot+bfNJVbkd1ylkkvZJB6nyfVy -VdysOEgBvRq0OREfCemCi28CgYEAoF1EE6NQDKICTZDhsMkQCb5PmcbbmPwFdh63 -xW64DlGNrCWoVt4BtS12wck4cUM1iE9oq3wgv6df5Z7ZuziSKVt9xk0xTnGgTcQ7 -7KkOjT+FZGZvw2K3bOsNkrK1vW2pyAU+pCE3uGU17DJNBjOIod27Kk649C61ntsw -lvoJVs0CgYBLr9pzBRPyD5/lM9hm2EI7ITa+fVcu3V3bJfXENHKzpb0lB2fhl0PI -swpiU8RUEKWyjBuHsdQdxg7AgFi/7s+SX7KLo4cudDRd73iiXYdNGB7R0/MAG8Jl -/lMXn14noS4trA8fNGGg/2fANTBtLTbOX9i4s7clAo8ETywQ33owug== ------END RSA PRIVATE KEY----- diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.crt b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.crt deleted file mode 100644 index 7d8781b888901..0000000000000 --- a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.crt +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEBTCCAu2gAwIBAgIJAIx9twpbtGkCMA0GCSqGSIb3DQEBCwUAMEsxIzAhBgNV -BAMTGkVsYXN0aWNzZWFyY2ggVGVzdCBSb290IENBMRYwFAYDVQQLEw1lbGFzdGlj -c2VhcmNoMQwwCgYDVQQKEwNvcmcwHhcNMTkwNzE5MTMzMjM0WhcNMjMwNzE4MTMz -MjM0WjBTMSswKQYDVQQDEyJFbGFzdGljc2VhcmNoIFRlc3QgSW50ZXJtZWRpYXRl -IENBMRYwFAYDVQQLEw1FbGFzdGljc2VhcmNoMQwwCgYDVQQKEwNvcmcwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCnJ2KTJZnQzOt0uUf+5oLNcvDLnnWY -LzXZpOOX666Almwx+PVkDxkiGSe0QB9RWJqHSrsP1ryGIeCIzGMOctLt6QA7Peee -HdrKqOQgN620nDSd2EZ3s0Iddh1Ns/lfTtBJCP/03suaktm7j8EYKAyOlTIUhiKm -sTFlxPUSKjbtR4wR1ljnKN8X+j/ghr9mWhQrMR9rsGFObU8DQFho2Ti90C4HoMNU -dy4j+2G3VVpaq4he4/4CbPrWQQ3dKGpzVAngIuAv4eQ/y88EHAFwutxQZWAew4Va -5y3O112acSb9oC7g0NHQcBnos/WIChF5ki8V3LFnxN7jYvUUk9YxfA8hAgMBAAGj -geMwgeAwHQYDVR0OBBYEFPLIhQojImGWZv/eahQu+QBvy0RNMB8GA1UdIwQYMBaA -FM4SyNzpz82ihQ160zrLUVaWfI+1MAwGA1UdEwQFMAMBAf8wgY8GA1UdEQSBhzCB -hIIJbG9jYWxob3N0ghVsb2NhbGhvc3QubG9jYWxkb21haW6CCmxvY2FsaG9zdDSC -F2xvY2FsaG9zdDQubG9jYWxkb21haW40ggpsb2NhbGhvc3Q2ghdsb2NhbGhvc3Q2 -LmxvY2FsZG9tYWluNocEfwAAAYcQAAAAAAAAAAAAAAAAAAAAATANBgkqhkiG9w0B -AQsFAAOCAQEAMkh4nUi2yt5TX+ryBWaaA4/2ZOsxSeec5E1EjemPMUWGzFipV1YY -k/mpv51E+BbPgtmGMG8Win/PETKYuX8D+zPauFEmJmyJmm5B4mr1406RWERqNDql -36sOw89G0mDT/wIB4tkNdh830ml+d75aRVVB4X5pFAE8ZzI3g4OW4YxT3ZfUEhDl -QeGVatobvIaX8KpNSevjFAFuQzSgj61VXI+2+UIRV4tJP2xEqu5ISuArHcGhvNlS -bU3vZ80tTCa0tHyJrVqaqtQ23MDBzYPj6wJ/pvBQWAgZKnC3qJgXlJ9des117I1g -J98AXCDGu5LBW/p2C9VpSktpnfzsX4NHqg== ------END CERTIFICATE----- diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.key b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.key deleted file mode 100644 index 5147725f4486a..0000000000000 --- a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testIntermediateCA.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEogIBAAKCAQEApydikyWZ0MzrdLlH/uaCzXLwy551mC812aTjl+uugJZsMfj1 -ZA8ZIhkntEAfUViah0q7D9a8hiHgiMxjDnLS7ekAOz3nnh3ayqjkIDettJw0ndhG -d7NCHXYdTbP5X07QSQj/9N7LmpLZu4/BGCgMjpUyFIYiprExZcT1Eio27UeMEdZY -5yjfF/o/4Ia/ZloUKzEfa7BhTm1PA0BYaNk4vdAuB6DDVHcuI/tht1VaWquIXuP+ -Amz61kEN3Shqc1QJ4CLgL+HkP8vPBBwBcLrcUGVgHsOFWuctztddmnEm/aAu4NDR -0HAZ6LP1iAoReZIvFdyxZ8Te42L1FJPWMXwPIQIDAQABAoIBABp4z1C0dL6vpV5v -9Wn2AaMd3+qvZro6R9H3HiAyMAmnSO1FGz/EcFuJFlOikBMm8BobCLMCdAreFJw1 -mj5wit0ouGOpcyQEYGEWDELZ7oWa825IESjl18OosA1dQlIIvk3Cwh56pk4NkbP1 -mUQFG6/9CthbQeOaTlNqtNEypE5Bc+JGbQaUhRP6tF+Rxnpys2nIJt/Vp9khw0Du -K7Z6astunhfPDwLFGwHhflc6re1B+mxpLKTDHCcydJo2Kuh/LuuEtPkE5Ar4LwQk -D+/61iZHC4B8/4IkBlAsgCJ1B18L6JdTbSYeVlepkSkJML5t6z+cvt5VcObF7F8X -pPZn+kECgYEA2NaB0eshWNnHTMRv+sE92DCv0M7uV1eKtaopxOElAKJ/J2gpqcTh -GzdTVRg1M2LgVNk97ViL5bsXaVStRe085m8oA0bI9WbIoQRUFp40dRFRUjl+4TN0 -pdxXL4VmQMWuwlO6p8/JY8sInnHVCT+2z8lek8P3bdtTQZV9OZQTn0kCgYEAxVe8 -obJdnUSXuRDWg588TW35PNqOTJcerIU6eRKwafvCcrhMoX62Xbv6y6kKXndW/JuW -AbfSNiAOV+HGUbf8Xc54Xzk2mouoJA0S0tJ040jqOkFOaKIxYQudTU8y9bTXNsAk -oX3wOhlt2q9xffAK1gYffP5XPXnYnsb8qaMIeRkCgYBM9yaxOgJmJTbGmtscaEbp -W66sMScMPXhwruuQhFG7/fGgLSrMpaM5I9QiWitYB/qUY1/FxS4y5suSiYnPTjvV -lxLexttBr6/65yxpstHv06vHwby1dqwqyyDvLyxyRTiYpVuVgP18vG5cvw7c746W -BmXZkS9cAQN2Pfdq3pJwcQKBgEbCZd2owg5hCPIPyosZbpro4uRiDYIC8bm0b7n3 -7I+j+R3/XWLOt382pv+dlh03N1aORyRIkDReHCaAywaELRZJsTmbnyudBeYfVe+I -DOduPqYywnWcKo58hqOw0Tnu5Pg5vyi0qo16jrxKCiy5BHmnamT8IbXmWbjc6r28 -uo4JAoGAfAPvPJ2fV5vpzr4LPoVyaSiFj414D+5XYxX6CWpdTryelpP2Rs1VfJ1a -7EusUtWs26pAKwttDY4yoTvog7rrskgtXzisaoNMDbH/PfsoqjMnnIgakvKmHpUM -l6E1ecWFExEg5v6yvmxFC7JIUzIYOoysWu3X44G8rQ+vDQNRFZQ= ------END RSA PRIVATE KEY----- diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.crt b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.crt deleted file mode 100644 index 50ba7a21727a6..0000000000000 --- a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.crt +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID/TCCAuWgAwIBAgIJAIAPVUXOUQDNMA0GCSqGSIb3DQEBCwUAMEsxIzAhBgNV -BAMTGkVsYXN0aWNzZWFyY2ggVGVzdCBSb290IENBMRYwFAYDVQQLEw1lbGFzdGlj -c2VhcmNoMQwwCgYDVQQKEwNvcmcwHhcNMTkwNzE5MTMzMjIwWhcNMjMwNzE4MTMz -MjIwWjBLMSMwIQYDVQQDExpFbGFzdGljc2VhcmNoIFRlc3QgUm9vdCBDQTEWMBQG -A1UECxMNZWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEAzIgn8r2kirt90id0uoi6YEGBPx+XDzthLbLsN+M0 -nXhj40OVcGPiww+cre14bJr0M6MG4CvFjRJc92RoVrE8+7XOKt0bgiHeVM+b0LEh -wVMH9koararPVMo0CjCMN4ChHMOWKBPUNZswvk+pFC+QbTcfgQLycqh+lTB1O6l3 -hPnmunEqhLIj9ke3FwA326igdb+16EbKYVL2c5unNoC5ZMc5Z9bnn4/GNXptkHhy -+SvG7IZKW2pAzei3Df/n47ZhJfQKERUCe9eO7b/ZmTEzAzYj9xucE5lYcpkOZd6g -IMU3vXe4FeD/BM4sOLkKTtMejiElEecxw8cLI9Nji/0y1wIDAQABo4HjMIHgMB0G -A1UdDgQWBBTOEsjc6c/NooUNetM6y1FWlnyPtTAfBgNVHSMEGDAWgBTOEsjc6c/N -ooUNetM6y1FWlnyPtTAMBgNVHRMEBTADAQH/MIGPBgNVHREEgYcwgYSCCWxvY2Fs -aG9zdIIVbG9jYWxob3N0LmxvY2FsZG9tYWluggpsb2NhbGhvc3Q0ghdsb2NhbGhv -c3Q0LmxvY2FsZG9tYWluNIIKbG9jYWxob3N0NoIXbG9jYWxob3N0Ni5sb2NhbGRv -bWFpbjaHBH8AAAGHEAAAAAAAAAAAAAAAAAAAAAEwDQYJKoZIhvcNAQELBQADggEB -ACHjwoDJILv77sQ5QN6SoAp6GYqiC9/doDIzDFCd/WP7G8EbaosHM6jM7NbrlK3g -PNTzuY1pLPoI3YJSO4Al/UfzEffaYSbZC2QZG9F6fUSWhvR+nxzPSXWkjzIInv1j -pPMgnUl6oJaUbsSR/evtvWNSxrM3LewkRTOoktkXM6SjTUHjdP6ikrkrarrWZgzr -K30BqGL6kDSv9LkyXe6RSgQDtQe51Yut+lKGCcy8AoEwG/3cjb7XnrWcFsJXjYbf -4m3QsS8yHU/O/xgyvVHOfki+uGVepzSjdzDMLE1GBkju05NR2eJZ8omj/QiJa0+z -1d/AOKExvWvo1yQ28ORcwo4= ------END CERTIFICATE----- diff --git a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.key b/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.key deleted file mode 100644 index 148bbd52bd76f..0000000000000 --- a/client/rest-high-level/out/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAzIgn8r2kirt90id0uoi6YEGBPx+XDzthLbLsN+M0nXhj40OV -cGPiww+cre14bJr0M6MG4CvFjRJc92RoVrE8+7XOKt0bgiHeVM+b0LEhwVMH9koa -rarPVMo0CjCMN4ChHMOWKBPUNZswvk+pFC+QbTcfgQLycqh+lTB1O6l3hPnmunEq -hLIj9ke3FwA326igdb+16EbKYVL2c5unNoC5ZMc5Z9bnn4/GNXptkHhy+SvG7IZK -W2pAzei3Df/n47ZhJfQKERUCe9eO7b/ZmTEzAzYj9xucE5lYcpkOZd6gIMU3vXe4 -FeD/BM4sOLkKTtMejiElEecxw8cLI9Nji/0y1wIDAQABAoIBAQC6LMnoPFW1brs1 -+3JWhTTZf2btlYzEcbGgjnhU2v0+xaJu8UrrFhEIq4JcE4gFm/rjsecFUPKu2eND -0eLj3st699+lxsRObRPbMWtMyJ/IQRNDTesA4DV/odtC1zQbJXwCGcrpyjrlXNE+ -unZWiIE32PBVV+BnHBa1KHneCAFiSRLrySAiDAnTIJxB6ufweoxevLoJPPNLlbo7 -H2jv6g1Som/Imjhof4KhD/1Q04Sed2wScSS/7Bz38eO68HG4NMFY+M2/cLzrbflg -QdeKHNhoIGnSFMEW5TCVlI4qrP8zvPPdZmLOMBT+Ocm3pc5xDAPwFYCe8wH1DVn+ -b3sVpwu5AoGBAOhFA7gUDZjRBkNAqJfbUdhdWSslePQsjeTKsu5rc4gk2aiL4bZ4 -fxG0Dq1hX7FjAmYrGqnsXsbxxDnCkhXGH1lY73kF0Zzwr2Pg1yRHyn1nCinhD4g4 -G2vBr37QtWn4wS/L7V//D3xrcCTG3QgAmvZZ99tYgqlmnUzmawdZ8kQ7AoGBAOFt -qg7sTSNWVpKkfkyX2NXvBMt5e3Qcwnge2pX+SBgljwjNUwSSMLwxdBDSyDXIhk8W -s4pJLtMDJsT/2WBKC9WJm9m3gc7yYZznLJ+5YPcieXHGGNXCRldPePhTIjnL591H -CSXoc3BZ2iKK745BYuPqSuLb2XfE3/hwoaFR4S4VAoGAQ6ywG7dECu2ELJ4vQSe2 -3hq8u1SMvGAq66mfntYR8G4EORagqkDLjUXwLNY9Qnr9nPUcLLxhFQgmS0oEtHFo -eujtxU5Lt7Vs9OXy6XA9cHJQRMl9dAwc+TWSw5ld8kV3TEzXmevAAFlxcFW82vMK -M5MdI3zTfTYXyOst7hNoAjcCgYAhz/cgAeWYFU0q9a1UA7qsbAuGEZSo1997cPVM -ZjWeGZQYt+Np3hudPrWwCE2rc4Zhun/3j/6L+/8GsXGDddfMkbVktJet2ME3bZ1N -39phdzRMEnCLL3aphewZIy8RCDqhABSpMPKPuYp0f+5qofgZQ300BdHamxcVBp/X -uJZT+QKBgQDdJQd+QxfCb8BZ11fWtyWJWQWZMmyX2EEbAIMvYQP3xh8PHmw2JoiQ -VQ103bCkegJ1S7ubrGltdt8pyjN4rrByXJmxCe1Y/LSHIp9w8D3jaiLCRSk1EmBw -jXjnZoiJn3GV5jmbV10hzrn7jqRcwhYA5zuoE7qb604V7cPZLzHtog== ------END RSA PRIVATE KEY----- diff --git a/modules/aggs-matrix-stats/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider b/modules/aggs-matrix-stats/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider deleted file mode 100644 index a2d706a39a60c..0000000000000 --- a/modules/aggs-matrix-stats/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider +++ /dev/null @@ -1 +0,0 @@ -org.elasticsearch.search.aggregations.matrix.spi.MatrixStatsNamedXContentProvider \ No newline at end of file diff --git a/modules/parent-join/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider b/modules/parent-join/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider deleted file mode 100644 index 48687c21c3250..0000000000000 --- a/modules/parent-join/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider +++ /dev/null @@ -1 +0,0 @@ -org.elasticsearch.join.spi.ParentJoinNamedXContentProvider \ No newline at end of file diff --git a/modules/rank-eval/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider b/modules/rank-eval/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider deleted file mode 100644 index cd505a43679c1..0000000000000 --- a/modules/rank-eval/out/production/resources/META-INF/services/org.elasticsearch.plugins.spi.NamedXContentProvider +++ /dev/null @@ -1 +0,0 @@ -org.elasticsearch.index.rankeval.RankEvalNamedXContentProvider \ No newline at end of file diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/_common.json b/rest-api-spec/out/production/resources/rest-api-spec/api/_common.json deleted file mode 100644 index 1505db774f0d1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/_common.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "documentation" : { - "description": "Parameters that are accepted by all API endpoints.", - "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html" - }, - "params": { - "pretty": { - "type": "boolean", - "description": "Pretty format the returned JSON response.", - "default": false - }, - "human": { - "type": "boolean", - "description": "Return human readable values for statistics.", - "default": true - }, - "error_trace": { - "type": "boolean", - "description": "Include the stack trace of returned errors.", - "default": false - }, - "source": { - "type": "string", - "description": "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests." - }, - "filter_path": { - "type": "list", - "description": "A comma-separated list of filters used to reduce the response." - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/bulk.json b/rest-api-spec/out/production/resources/rest-api-spec/api/bulk.json deleted file mode 100644 index 085ff88d0c135..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/bulk.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "bulk":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html", - "description":"Allows to perform multiple index/update/delete operations in a single request." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_bulk", - "methods":[ - "POST", - "PUT" - ] - }, - { - "path":"/{index}/_bulk", - "methods":[ - "POST", - "PUT" - ], - "parts":{ - "index":{ - "type":"string", - "description":"Default index for items which don't provide one" - } - } - }, - { - "path":"/{index}/{type}/_bulk", - "methods":[ - "POST", - "PUT" - ], - "parts":{ - "index":{ - "type":"string", - "description":"Default index for items which don't provide one" - }, - "type":{ - "type":"string", - "description":"Default document type for items which don't provide one" - } - } - } - ] - }, - "params":{ - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "refresh":{ - "type":"enum", - "options":[ - "true", - "false", - "wait_for" - ], - "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", - "description":"Specific routing value" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "type":{ - "type":"string", - "description":"Default document type for items which don't provide one" - }, - "_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_excludes":{ - "type":"list", - "description":"Default list of fields to exclude from the returned _source field, can be overridden on each sub-request" - }, - "_source_includes":{ - "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", - "description":"The pipeline id to preprocess incoming documents with" - } - }, - "body":{ - "description":"The operation definition and data (action-data pairs), separated by newlines", - "required":true, - "serialize":"bulk" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.aliases.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.aliases.json deleted file mode 100644 index 6ee594b099c43..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.aliases.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "cat.aliases":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html", - "description":"Shows information about currently configured aliases to indices including filter and routing infos." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/aliases", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/aliases/{name}", - "methods":[ - "GET" - ], - "parts":{ - "name":{ - "type":"list", - "description":"A comma-separated list of alias names to return" - } - } - } - ] - }, - "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)" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default": ["all"], - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.allocation.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.allocation.json deleted file mode 100644 index 7b3dc70b03c38..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.allocation.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "cat.allocation":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html", - "description":"Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/allocation", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/allocation/{node_id}", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "bytes":{ - "type":"enum", - "description":"The unit in which to display byte values", - "options":[ - "b", - "k", - "kb", - "m", - "mb", - "g", - "gb", - "t", - "tb", - "p", - "pb" - ] - }, - "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 - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.count.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.count.json deleted file mode 100644 index 8cfaddf8db83b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.count.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "cat.count":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html", - "description":"Provides quick access to the document count of the entire cluster, or individual indices." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/count", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/count/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to limit the returned information" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.fielddata.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.fielddata.json deleted file mode 100644 index 9fbde4736b5ef..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.fielddata.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "cat.fielddata":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html", - "description":"Shows how much heap memory is currently being used by fielddata on every data node in the cluster." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/fielddata", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/fielddata/{fields}", - "methods":[ - "GET" - ], - "parts":{ - "fields":{ - "type":"list", - "description":"A comma-separated list of fields to return the fielddata size" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "bytes":{ - "type":"enum", - "description":"The unit in which to display byte values", - "options":[ - "b", - "k", - "kb", - "m", - "mb", - "g", - "gb", - "t", - "tb", - "p", - "pb" - ] - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields to return in the output" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.health.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.health.json deleted file mode 100644 index 7e79b7cc2c977..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.health.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "cat.health":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html", - "description":"Returns a concise representation of the cluster health." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/health", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d (Days)", - "h (Hours)", - "m (Minutes)", - "s (Seconds)", - "ms (Milliseconds)", - "micros (Microseconds)", - "nanos (Nanoseconds)" - ] - }, - "ts":{ - "type":"boolean", - "description":"Set to false to disable timestamping", - "default":true - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.help.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.help.json deleted file mode 100644 index 54ab6d6e5168c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.help.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "cat.help":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html", - "description":"Returns help for the Cat APIs." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.indices.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.indices.json deleted file mode 100644 index d4a7eb3b051d2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.indices.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "cat.indices":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html", - "description":"Returns information about indices: number of primaries and replicas, document counts, disk size, ..." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/indices", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/indices/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to limit the returned information" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "bytes":{ - "type":"enum", - "description":"The unit in which to display byte values", - "options":[ - "b", - "k", - "kb", - "m", - "mb", - "g", - "gb", - "t", - "tb", - "p", - "pb" - ] - }, - "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" - }, - "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", - "default":false - }, - "pri":{ - "type":"boolean", - "description":"Set to true to return stats only for primary shards", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d", - "h", - "m", - "s", - "ms", - "micros", - "nanos" - ] - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - }, - "include_unloaded_segments":{ - "type":"boolean", - "description":"If set to true segment stats will include stats for segments that are not currently loaded into memory", - "default":false - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default": "all", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.master.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.master.json deleted file mode 100644 index 63fe159ee56b8..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.master.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "cat.master":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html", - "description":"Returns information about the master node." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/master", - "methods":[ - "GET" - ] - } - ] - }, - "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 - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodeattrs.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodeattrs.json deleted file mode 100644 index e688e23cab089..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodeattrs.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "cat.nodeattrs":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html", - "description":"Returns information about custom node attributes." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/nodeattrs", - "methods":[ - "GET" - ] - } - ] - }, - "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 - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodes.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodes.json deleted file mode 100644 index ba3faa92c5ec6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.nodes.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "cat.nodes":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html", - "description":"Returns basic statistics about performance of cluster nodes." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/nodes", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "bytes":{ - "type":"enum", - "description":"The unit in which to display byte values", - "options":[ - "b", - "k", - "kb", - "m", - "mb", - "g", - "gb", - "t", - "tb", - "p", - "pb" - ] - }, - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "full_id":{ - "type":"boolean", - "description":"Return the full node ID instead of the shortened version (default: false)" - }, - "local":{ - "type":"boolean", - "description":"Calculate the selected nodes using the local cluster state rather than the state from master node (default: false)", - "deprecated":{ - "version":"7.6.0", - "description":"This parameter does not cause this API to act locally." - } - }, - "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 - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d", - "h", - "m", - "s", - "ms", - "micros", - "nanos" - ] - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.pending_tasks.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.pending_tasks.json deleted file mode 100644 index 36fa33be495cd..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.pending_tasks.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "cat.pending_tasks":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html", - "description":"Returns a concise representation of the cluster pending tasks." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/pending_tasks", - "methods":[ - "GET" - ] - } - ] - }, - "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 - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d", - "h", - "m", - "s", - "ms", - "micros", - "nanos" - ] - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.plugins.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.plugins.json deleted file mode 100644 index d5346c6d9e7b4..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.plugins.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "cat.plugins":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html", - "description":"Returns information about installed plugins across nodes node." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/plugins", - "methods":[ - "GET" - ] - } - ] - }, - "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 - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.recovery.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.recovery.json deleted file mode 100644 index 7baf0b8ded609..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.recovery.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "cat.recovery":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html", - "description":"Returns information about index shard recoveries, both on-going completed." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/recovery", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/recovery/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"Comma-separated list or wildcard expression of index names to limit the returned information" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "active_only":{ - "type":"boolean", - "description":"If `true`, the response only includes ongoing shard recoveries", - "default":false - }, - "bytes":{ - "type":"enum", - "description":"The unit in which to display byte values", - "options":[ - "b", - "k", - "kb", - "m", - "mb", - "g", - "gb", - "t", - "tb", - "p", - "pb" - ] - }, - "detailed":{ - "type":"boolean", - "description":"If `true`, the response includes detailed information about shard recoveries", - "default":false - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "index":{ - "type":"list", - "description":"Comma-separated list or wildcard expression of index names to limit the returned information" - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d", - "h", - "m", - "s", - "ms", - "micros", - "nanos" - ] - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.repositories.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.repositories.json deleted file mode 100644 index 84d9965907ff3..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.repositories.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "cat.repositories":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html", - "description":"Returns information about snapshot repositories registered in the cluster." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/repositories", - "methods":[ - "GET" - ] - } - ] - }, - "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 - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.segments.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.segments.json deleted file mode 100644 index 472ef7fd22eee..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.segments.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "cat.segments":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html", - "description":"Provides low-level information about the segments in the shards of an index." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/segments", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/segments/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to limit the returned information" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "bytes":{ - "type":"enum", - "description":"The unit in which to display byte values", - "options":[ - "b", - "k", - "kb", - "m", - "mb", - "g", - "gb", - "t", - "tb", - "p", - "pb" - ] - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.shards.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.shards.json deleted file mode 100644 index a13c0f6bf6d4a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.shards.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "cat.shards":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html", - "description":"Provides a detailed view of shard allocation on nodes." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/shards", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/shards/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to limit the returned information" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "bytes":{ - "type":"enum", - "description":"The unit in which to display byte values", - "options":[ - "b", - "k", - "kb", - "m", - "mb", - "g", - "gb", - "t", - "tb", - "p", - "pb" - ] - }, - "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 - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d", - "h", - "m", - "s", - "ms", - "micros", - "nanos" - ] - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.snapshots.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.snapshots.json deleted file mode 100644 index 757c2cfbe7dc6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.snapshots.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "cat.snapshots":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html", - "description":"Returns all snapshots in a specific repository." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/snapshots", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/snapshots/{repository}", - "methods":[ - "GET" - ], - "parts":{ - "repository":{ - "type":"list", - "description":"Name of repository from which to fetch the snapshot information" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Set to true to ignore unavailable snapshots", - "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 - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d", - "h", - "m", - "s", - "ms", - "micros", - "nanos" - ] - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.tasks.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.tasks.json deleted file mode 100644 index ae25ab10c0138..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.tasks.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "cat.tasks":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", - "description":"Returns information about the tasks currently executing on one or more nodes in the cluster." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/tasks", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - }, - "actions":{ - "type":"list", - "description":"A comma-separated list of actions that should be returned. Leave empty to return all." - }, - "detailed":{ - "type":"boolean", - "description":"Return detailed task information (default: false)" - }, - "parent_task":{ - "type":"number", - "description":"Return tasks with specified parent task id. Set to -1 to return all." - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d", - "h", - "m", - "s", - "ms", - "micros", - "nanos" - ] - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.templates.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.templates.json deleted file mode 100644 index 53fc872b5dae2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.templates.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "cat.templates":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html", - "description":"Returns information about existing templates." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/templates", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/templates/{name}", - "methods":[ - "GET" - ], - "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 - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.thread_pool.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cat.thread_pool.json deleted file mode 100644 index d2ce7ed665d5a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cat.thread_pool.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "cat.thread_pool":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html", - "description":"Returns cluster-wide thread pool statistics per node.\nBy default the active, queue and rejected statistics are returned for all thread pools." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/thread_pool", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/thread_pool/{thread_pool_patterns}", - "methods":[ - "GET" - ], - "parts":{ - "thread_pool_patterns":{ - "type":"list", - "description":"A comma-separated list of regular-expressions to filter the thread pools in the output" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "size":{ - "type":"enum", - "description":"The multiplier in which to display values", - "options":[ - "", - "k", - "m", - "g", - "t", - "p" - ] - }, - "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 - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/clear_scroll.json b/rest-api-spec/out/production/resources/rest-api-spec/api/clear_scroll.json deleted file mode 100644 index f484c94246c7b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/clear_scroll.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "clear_scroll":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#_clear_scroll_api", - "description":"Explicitly clears the search context for a scroll." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_search/scroll", - "methods":[ - "DELETE" - ] - }, - { - "path":"/_search/scroll/{scroll_id}", - "methods":[ - "DELETE" - ], - "parts":{ - "scroll_id":{ - "type":"list", - "description":"A comma-separated list of scroll IDs to clear", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"A scroll id can be quite large and should be specified as part of the body" - } - } - ] - }, - "params":{}, - "body":{ - "description":"A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.allocation_explain.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.allocation_explain.json deleted file mode 100644 index e46218a781e1b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.allocation_explain.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "cluster.allocation_explain":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html", - "description":"Provides explanations for shard allocations in the cluster." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cluster/allocation/explain", - "methods":[ - "GET", - "POST" - ] - } - ] - }, - "params":{ - "include_yes_decisions":{ - "type":"boolean", - "description":"Return 'YES' decisions in explanation (default: false)" - }, - "include_disk_info":{ - "type":"boolean", - "description":"Return information about disk usage and shard sizes (default: false)" - } - }, - "body":{ - "description":"The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.delete_component_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.delete_component_template.json deleted file mode 100644 index 6ddfe6c7ead5f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.delete_component_template.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "cluster.delete_component_template":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-templates.html", - "description":"Deletes a component template" - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_component_template/{name}", - "methods":[ - "DELETE" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the template" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_component_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_component_template.json deleted file mode 100644 index 27bd093e620f0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_component_template.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "cluster.get_component_template":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-templates.html", - "description":"Returns one or more component templates" - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_component_template", - "methods":[ - "GET" - ] - }, - { - "path":"/_component_template/{name}", - "methods":[ - "GET" - ], - "parts":{ - "name":{ - "type":"list", - "description":"The comma separated names of the component templates" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_settings.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_settings.json deleted file mode 100644 index 6f91fbbedf5de..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.get_settings.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "cluster.get_settings":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html", - "description":"Returns cluster settings." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cluster/settings", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "include_defaults":{ - "type":"boolean", - "description":"Whether to return all default clusters setting.", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.health.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.health.json deleted file mode 100644 index 2a21ff3725b6a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.health.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "cluster.health":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html", - "description":"Returns basic information about the health of the cluster." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cluster/health", - "methods":[ - "GET" - ] - }, - { - "path":"/_cluster/health/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"Limit the information returned to a specific index" - } - } - } - ] - }, - "params":{ - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"all", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "level":{ - "type":"enum", - "options":[ - "cluster", - "indices", - "shards" - ], - "default":"cluster", - "description":"Specify the level of detail for returned information" - }, - "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" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "wait_for_active_shards":{ - "type":"string", - "description":"Wait until the specified number of shards is active" - }, - "wait_for_nodes":{ - "type":"string", - "description":"Wait until the specified number of nodes is available" - }, - "wait_for_events":{ - "type":"enum", - "options":[ - "immediate", - "urgent", - "high", - "normal", - "low", - "languid" - ], - "description":"Wait until all currently queued events with the given priority are processed" - }, - "wait_for_no_relocating_shards":{ - "type":"boolean", - "description":"Whether to wait until there are no relocating shards in the cluster" - }, - "wait_for_no_initializing_shards":{ - "type":"boolean", - "description":"Whether to wait until there are no initializing shards in the cluster" - }, - "wait_for_status":{ - "type":"enum", - "options":[ - "green", - "yellow", - "red" - ], - "default":null, - "description":"Wait until cluster is in a specific state" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.pending_tasks.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.pending_tasks.json deleted file mode 100644 index d940adf9aef5d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.pending_tasks.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "cluster.pending_tasks":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html", - "description":"Returns a list of any cluster-level changes (e.g. create index, update mapping,\nallocate or fail shard) which have not yet been executed." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cluster/pending_tasks", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_component_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_component_template.json deleted file mode 100644 index 3bdac2357d023..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_component_template.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "cluster.put_component_template":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-templates.html", - "description":"Creates or updates a component template" - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_component_template/{name}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the template" - } - } - } - ] - }, - "params":{ - "create":{ - "type":"boolean", - "description":"Whether the index template should only be added if new or can also replace an existing one", - "default":false - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - } - }, - "body":{ - "description":"The template definition", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_settings.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_settings.json deleted file mode 100644 index f6b9a0863380e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.put_settings.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "cluster.put_settings":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html", - "description":"Updates the cluster settings." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cluster/settings", - "methods":[ - "PUT" - ] - } - ] - }, - "params":{ - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - }, - "body":{ - "description":"The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart).", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.remote_info.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.remote_info.json deleted file mode 100644 index 4eac0b55ce6f1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.remote_info.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "cluster.remote_info":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html", - "description":"Returns the information about configured remote clusters." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_remote/info", - "methods":[ - "GET" - ] - } - ] - }, - "params":{} - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.reroute.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.reroute.json deleted file mode 100644 index b0e8054fc9e53..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.reroute.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "cluster.reroute":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html", - "description":"Allows to manually change the allocation of individual shards in the cluster." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cluster/reroute", - "methods":[ - "POST" - ] - } - ] - }, - "params":{ - "dry_run":{ - "type":"boolean", - "description":"Simulate the operation only and return the resulting state" - }, - "explain":{ - "type":"boolean", - "description":"Return an explanation of why the commands can or cannot be executed" - }, - "retry_failed":{ - "type":"boolean", - "description":"Retries allocation of shards that are blocked due to too many subsequent allocation failures" - }, - "metric":{ - "type":"list", - "options":[ - "_all", - "blocks", - "metadata", - "nodes", - "routing_table", - "master_node", - "version" - ], - "description":"Limit the information returned to the specified metrics. Defaults to all but metadata" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - }, - "body":{ - "description":"The definition of `commands` to perform (`move`, `cancel`, `allocate`)" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.state.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.state.json deleted file mode 100644 index 017705082d189..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.state.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "cluster.state":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html", - "description":"Returns a comprehensive information about the state of the cluster." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cluster/state", - "methods":[ - "GET" - ] - }, - { - "path":"/_cluster/state/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "blocks", - "metadata", - "nodes", - "routing_table", - "routing_nodes", - "master_node", - "version" - ], - "description":"Limit the information returned to the specified metrics" - } - } - }, - { - "path":"/_cluster/state/{metric}/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - }, - "metric":{ - "type":"list", - "options":[ - "_all", - "blocks", - "metadata", - "nodes", - "routing_table", - "routing_nodes", - "master_node", - "version" - ], - "description":"Limit the information returned to the specified metrics" - } - } - } - ] - }, - "params":{ - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - }, - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "wait_for_metadata_version":{ - "type":"number", - "description":"Wait for the metadata version to be equal or greater than the specified metadata version" - }, - "wait_for_timeout":{ - "type":"time", - "description":"The maximum time to wait for wait_for_metadata_version before timing out" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.stats.json b/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.stats.json deleted file mode 100644 index f36db0979f4f7..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/cluster.stats.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "cluster.stats":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html", - "description":"Returns high-level overview of cluster statistics." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cluster/stats", - "methods":[ - "GET" - ] - }, - { - "path":"/_cluster/stats/nodes/{node_id}", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - } - ] - }, - "params":{ - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/count.json b/rest-api-spec/out/production/resources/rest-api-spec/api/count.json deleted file mode 100644 index 9f6461b16d3eb..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/count.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "count":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html", - "description":"Returns number of documents matching a query." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_count", - "methods":[ - "POST", - "GET" - ] - - }, - { - "path":"/{index}/_count", - "methods":[ - "POST", - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of indices to restrict the results" - } - } - }, - { - "path":"/{index}/{type}/_count", - "methods":[ - "POST", - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of indices to restrict the results" - }, - "type": { - "type" : "list", - "description" : "A comma-separated list of types to restrict the results" - } - }, - "deprecated": { - "version" : "7.0.0", - "description" : "Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "ignore_throttled":{ - "type":"boolean", - "description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "min_score":{ - "type":"number", - "description":"Include only documents with a specific `_score` value in the result" - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "routing":{ - "type":"list", - "description":"A comma-separated list of specific routing values" - }, - "q":{ - "type":"string", - "description":"Query in the Lucene query string syntax" - }, - "analyzer":{ - "type":"string", - "description":"The analyzer to use for the query string" - }, - "analyze_wildcard":{ - "type":"boolean", - "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" - }, - "default_operator":{ - "type":"enum", - "options":[ - "AND", - "OR" - ], - "default":"OR", - "description":"The default operator for query string query (AND or OR)" - }, - "df":{ - "type":"string", - "description":"The field to use as default where no field prefix is given in the query string" - }, - "lenient":{ - "type":"boolean", - "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "terminate_after":{ - "type":"number", - "description":"The maximum count for each shard, upon reaching which the query execution will terminate early" - } - }, - "body":{ - "description":"A query to restrict the results specified with the Query DSL (optional)" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/create.json b/rest-api-spec/out/production/resources/rest-api-spec/api/create.json deleted file mode 100644 index 171f3da44d36d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/create.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "create":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html", - "description":"Creates a new document in the index.\n\nReturns a 409 response when a document with a same ID already exists in the index." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_create/{id}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - }, - { - "path":"/{index}/{type}/{id}/_create", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "refresh":{ - "type":"enum", - "options":[ - "true", - "false", - "wait_for" - ], - "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", - "description":"Specific routing value" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte" - ], - "description":"Specific version type" - }, - "pipeline":{ - "type":"string", - "description":"The pipeline id to preprocess incoming documents with" - } - }, - "body":{ - "description":"The document", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/delete.json b/rest-api-spec/out/production/resources/rest-api-spec/api/delete.json deleted file mode 100644 index 0d82bca9d4173..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/delete.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "delete":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html", - "description":"Removes a document from the index." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_doc/{id}", - "methods":[ - "DELETE" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - }, - { - "path":"/{index}/{type}/{id}", - "methods":[ - "DELETE" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "refresh":{ - "type":"enum", - "options":[ - "true", - "false", - "wait_for" - ], - "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", - "description":"Specific routing value" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "if_seq_no":{ - "type":"number", - "description":"only perform the delete operation if the last operation that has changed the document has the specified sequence number" - }, - "if_primary_term":{ - "type":"number", - "description":"only perform the delete operation if the last operation that has changed the document has the specified primary term" - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte", - "force" - ], - "description":"Specific version type" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query.json b/rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query.json deleted file mode 100644 index c840c763f4d90..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query.json +++ /dev/null @@ -1,201 +0,0 @@ -{ - "delete_by_query":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html", - "description":"Deletes documents matching the provided query." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_delete_by_query", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - } - } - }, - { - "path" : "/{index}/{type}/_delete_by_query", - "methods": ["POST"], - "parts": { - "index": { - "required": true, - "type": "list", - "description": "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - }, - "type": { - "type": "list", - "description": "A comma-separated list of document types to search; leave empty to perform the operation on all types" - } - }, - "deprecated": { - "version" : "7.0.0", - "description" : "Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "analyzer": { - "type" : "string", - "description" : "The analyzer to use for the query string" - }, - "analyze_wildcard": { - "type" : "boolean", - "description" : "Specify whether wildcard and prefix queries should be analyzed (default: false)" - }, - "default_operator": { - "type" : "enum", - "options" : ["AND","OR"], - "default" : "OR", - "description" : "The default operator for query string query (AND or OR)" - }, - "df": { - "type" : "string", - "description" : "The field to use as default where no field prefix is given in the query string" - }, - "from": { - "type" : "number", - "description" : "Starting offset (default: 0)" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "type" : "boolean", - "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "conflicts": { - "note": "This is not copied from search", - "type" : "enum", - "options": ["abort", "proceed"], - "default": "abort", - "description" : "What to do when the delete by query hits version conflicts?" - }, - "expand_wildcards": { - "type" : "enum", - "options" : [ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default" : "open", - "description" :"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "lenient": { - "type" : "boolean", - "description" : "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "preference": { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random)" - }, - "q": { - "type" : "string", - "description" : "Query in the Lucene query string syntax" - }, - "routing": { - "type" : "list", - "description" : "A comma-separated list of specific routing values" - }, - "scroll": { - "type" : "time", - "description" : "Specify how long a consistent view of the index should be maintained for scrolled search" - }, - "search_type": { - "type" : "enum", - "options" : ["query_then_fetch", "dfs_query_then_fetch"], - "description" : "Search operation type" - }, - "search_timeout": { - "type" : "time", - "description" : "Explicit timeout for each search request. Defaults to no timeout." - }, - "size": { - "type" : "number", - "description" : "Deprecated, please use `max_docs` instead" - }, - "max_docs": { - "type" : "number", - "description" : "Maximum number of documents to process (default: all documents)" - }, - "sort": { - "type" : "list", - "description" : "A comma-separated list of : pairs" - }, - "_source": { - "type" : "list", - "description" : "True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes": { - "type" : "list", - "description" : "A list of fields to exclude from the returned _source field" - }, - "_source_includes": { - "type" : "list", - "description" : "A list of fields to extract and return from the _source field" - }, - "terminate_after": { - "type" : "number", - "description" : "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." - }, - "stats": { - "type" : "list", - "description" : "Specific 'tag' of the request for logging and statistical purposes" - }, - "version": { - "type" : "boolean", - "description" : "Specify whether to return document version as part of a hit" - }, - "request_cache": { - "type" : "boolean", - "description" : "Specify if request cache should be used for this request or not, defaults to index level setting" - }, - "refresh": { - "type" : "boolean", - "description" : "Should the effected indexes be refreshed?" - }, - "timeout": { - "type" : "time", - "default": "1m", - "description" : "Time each individual bulk request should wait for shards that are unavailable." - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "scroll_size": { - "type": "number", - "defaut_value": 100, - "description": "Size on the scroll request powering the delete by query" - }, - "wait_for_completion": { - "type" : "boolean", - "default": true, - "description" : "Should the request should block until the delete by query is complete." - }, - "requests_per_second": { - "type": "number", - "default": 0, - "description": "The throttle for this request in sub-requests per second. -1 means no throttle." - }, - "slices": { - "type": "number|string", - "default": 1, - "description": "The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`." - } - }, - "body":{ - "description":"The search definition using the Query DSL", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query_rethrottle.json b/rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query_rethrottle.json deleted file mode 100644 index 112bfc8a7d2e0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/delete_by_query_rethrottle.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "delete_by_query_rethrottle":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html", - "description":"Changes the number of requests per second for a particular Delete By Query operation." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_delete_by_query/{task_id}/_rethrottle", - "methods":[ - "POST" - ], - "parts":{ - "task_id":{ - "type":"string", - "description":"The task id to rethrottle" - } - } - } - ] - }, - "params":{ - "requests_per_second":{ - "type":"number", - "required":true, - "description":"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/delete_script.json b/rest-api-spec/out/production/resources/rest-api-spec/api/delete_script.json deleted file mode 100644 index b38b97ae57c2e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/delete_script.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "delete_script":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html", - "description":"Deletes a script." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_scripts/{id}", - "methods":[ - "DELETE" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Script ID" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/exists.json b/rest-api-spec/out/production/resources/rest-api-spec/api/exists.json deleted file mode 100644 index 09042376a256b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/exists.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "exists":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", - "description":"Returns information about whether a document exists in an index." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_doc/{id}", - "methods":[ - "HEAD" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - }, - { - "path":"/{index}/{type}/{id}", - "methods":[ - "HEAD" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document (use `_all` to fetch the first document matching the ID across all types)", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "stored_fields":{ - "type":"list", - "description":"A comma-separated list of stored fields to return in the response" - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "realtime":{ - "type":"boolean", - "description":"Specify whether to perform the operation in realtime or search mode" - }, - "refresh":{ - "type":"boolean", - "description":"Refresh the shard containing the document before performing the operation" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte", - "force" - ], - "description":"Specific version type" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/exists_source.json b/rest-api-spec/out/production/resources/rest-api-spec/api/exists_source.json deleted file mode 100644 index 143ee406025ce..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/exists_source.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "exists_source":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", - "description":"Returns information about whether a document source exists in an index." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_source/{id}", - "methods":[ - "HEAD" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - }, - { - "path":"/{index}/{type}/{id}/_source", - "methods":[ - "HEAD" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document; deprecated and optional starting with 7.0", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "realtime":{ - "type":"boolean", - "description":"Specify whether to perform the operation in realtime or search mode" - }, - "refresh":{ - "type":"boolean", - "description":"Refresh the shard containing the document before performing the operation" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte", - "force" - ], - "description":"Specific version type" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/explain.json b/rest-api-spec/out/production/resources/rest-api-spec/api/explain.json deleted file mode 100644 index c7c393a6a1cba..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/explain.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "explain":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html", - "description":"Returns information about why a specific matches (or doesn't match) a query." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_explain/{id}", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - }, - { - "path":"/{index}/{type}/{id}/_explain", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "analyze_wildcard":{ - "type":"boolean", - "description":"Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)" - }, - "analyzer":{ - "type":"string", - "description":"The analyzer for the query string query" - }, - "default_operator":{ - "type":"enum", - "options":[ - "AND", - "OR" - ], - "default":"OR", - "description":"The default operator for query string query (AND or OR)" - }, - "df":{ - "type":"string", - "description":"The default field for query string query (default: _all)" - }, - "stored_fields":{ - "type":"list", - "description":"A comma-separated list of stored fields to return in the response" - }, - "lenient":{ - "type":"boolean", - "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "q":{ - "type":"string", - "description":"Query in the Lucene query string syntax" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - } - }, - "body":{ - "description":"The query definition using the Query DSL" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/field_caps.json b/rest-api-spec/out/production/resources/rest-api-spec/api/field_caps.json deleted file mode 100644 index d56c3313a0bf0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/field_caps.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "field_caps":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html", - "description":"Returns the information about the capabilities of fields among multiple indices." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_field_caps", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_field_caps", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "fields":{ - "type":"list", - "description":"A comma-separated list of field names" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "include_unmapped":{ - "type":"boolean", - "default":false, - "description":"Indicates whether unmapped fields should be included in the response." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/get.json b/rest-api-spec/out/production/resources/rest-api-spec/api/get.json deleted file mode 100644 index 0c8d62d6d1d34..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/get.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "get":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", - "description":"Returns a document." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_doc/{id}", - "methods":[ - "GET" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - }, - { - "path":"/{index}/{type}/{id}", - "methods":[ - "GET" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document (use `_all` to fetch the first document matching the ID across all types)", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "stored_fields":{ - "type":"list", - "description":"A comma-separated list of stored fields to return in the response" - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "realtime":{ - "type":"boolean", - "description":"Specify whether to perform the operation in realtime or search mode" - }, - "refresh":{ - "type":"boolean", - "description":"Refresh the shard containing the document before performing the operation" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte", - "force" - ], - "description":"Specific version type" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/get_script.json b/rest-api-spec/out/production/resources/rest-api-spec/api/get_script.json deleted file mode 100644 index 14307bea2ef0b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/get_script.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "get_script":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html", - "description":"Returns a script." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_scripts/{id}", - "methods":[ - "GET" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Script ID" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/get_script_context.json b/rest-api-spec/out/production/resources/rest-api-spec/api/get_script_context.json deleted file mode 100644 index 16e8d0a0cfab3..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/get_script_context.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "get_script_context":{ - "documentation":{ - "description":"Returns all script contexts." - }, - "stability":"experimental", - "url":{ - "paths":[ - { - "path":"/_script_context", - "methods":[ - "GET" - ] - } - ] - }, - "params":{} - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/get_script_languages.json b/rest-api-spec/out/production/resources/rest-api-spec/api/get_script_languages.json deleted file mode 100644 index 5a45392d9ee11..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/get_script_languages.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "get_script_languages":{ - "documentation":{ - "description":"Returns available script types, languages and contexts" - }, - "stability":"experimental", - "url":{ - "paths":[ - { - "path":"/_script_language", - "methods":[ - "GET" - ] - } - ] - }, - "params":{} - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/get_source.json b/rest-api-spec/out/production/resources/rest-api-spec/api/get_source.json deleted file mode 100644 index e5336059d3924..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/get_source.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "get_source":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html", - "description":"Returns the source of a document." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_source/{id}", - "methods":[ - "GET" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - }, - { - "path":"/{index}/{type}/{id}/_source", - "methods":[ - "GET" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document; deprecated and optional starting with 7.0", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "realtime":{ - "type":"boolean", - "description":"Specify whether to perform the operation in realtime or search mode" - }, - "refresh":{ - "type":"boolean", - "description":"Refresh the shard containing the document before performing the operation" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte", - "force" - ], - "description":"Specific version type" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/index.json b/rest-api-spec/out/production/resources/rest-api-spec/api/index.json deleted file mode 100644 index 7ecd7a0e9279e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/index.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "index":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html", - "description":"Creates or updates a document in an index." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_doc/{id}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - }, - { - "path":"/{index}/_doc", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The name of the index" - } - } - }, - { - "path":"/{index}/{type}", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - }, - { - "path":"/{index}/{type}/{id}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "op_type":{ - "type":"enum", - "options":[ - "index", - "create" - ], - "description":"Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID" - }, - "refresh":{ - "type":"enum", - "options":[ - "true", - "false", - "wait_for" - ], - "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", - "description":"Specific routing value" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte" - ], - "description":"Specific version type" - }, - "if_seq_no":{ - "type":"number", - "description":"only perform the index operation if the last operation that has changed the document has the specified sequence number" - }, - "if_primary_term":{ - "type":"number", - "description":"only perform the index operation if the last operation that has changed the document has the specified primary term" - }, - "pipeline":{ - "type":"string", - "description":"The pipeline id to preprocess incoming documents with" - } - }, - "body":{ - "description":"The document", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.analyze.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.analyze.json deleted file mode 100644 index aa8e84c1985d6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.analyze.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "indices.analyze":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html", - "description":"Performs the analysis process on a text and return the tokens breakdown of the text." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_analyze", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_analyze", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The name of the index to scope the operation" - } - } - } - ] - }, - "params":{ - "index":{ - "type":"string", - "description":"The name of the index to scope the operation" - } - }, - "body":{ - "description":"Define analyzer/tokenizer parameters and the text on which the analysis should be performed" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.clear_cache.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.clear_cache.json deleted file mode 100644 index 64c10a520c7c4..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.clear_cache.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "indices.clear_cache":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html", - "description":"Clears all or specific caches for one or more indices." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cache/clear", - "methods":[ - "POST" - ] - }, - { - "path":"/{index}/_cache/clear", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index name to limit the operation" - } - } - } - ] - }, - "params":{ - "fielddata":{ - "type":"boolean", - "description":"Clear field data" - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields to clear when using the `fielddata` parameter (default: all)" - }, - "query":{ - "type":"boolean", - "description":"Clear query caches" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "index":{ - "type":"list", - "description":"A comma-separated list of index name to limit the operation" - }, - "request":{ - "type":"boolean", - "description":"Clear request cache" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.clone.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.clone.json deleted file mode 100644 index d3a249583bd84..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.clone.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "indices.clone": { - "documentation": { - "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html", - "description": "Clones an index" - }, - "stability": "stable", - "url": { - "paths": [ - { - "path": "/{index}/_clone/{target}", - "methods": [ - "PUT", - "POST" - ], - "parts": { - "index": { - "type": "string", - "description": "The name of the source index to clone" - }, - "target": { - "type": "string", - "description": "The name of the target index to clone into" - } - } - } - ] - }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Set the number of active shards to wait for on the cloned index before the operation returns." - } - }, - "body": { - "description" : "The configuration for the target index (`settings` and `aliases`)" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.close.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.close.json deleted file mode 100644 index f26c8e77a06a6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.close.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "indices.close":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html", - "description":"Closes an index." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_close", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma separated list of indices to close" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of active shards to wait for before the operation returns." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.create.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.create.json deleted file mode 100644 index 2b9e8617a661c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.create.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "indices.create":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html", - "description":"Creates an index with optional settings and mappings." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}", - "methods":[ - "PUT" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The name of the index" - } - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether a type should be expected in the body of the mappings." - }, - "wait_for_active_shards":{ - "type":"string", - "description":"Set the number of active shards to wait for before the operation returns." - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - } - }, - "body":{ - "description":"The configuration for the index (`settings` and `mappings`)" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.create_data_stream.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.create_data_stream.json deleted file mode 100644 index ef8615a69b1ca..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.create_data_stream.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "indices.create_data_stream":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html", - "description":"Creates or updates a data stream" - }, - "stability":"experimental", - "url":{ - "paths":[ - { - "path":"/_data_stream/{name}", - "methods":[ - "PUT" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the data stream" - } - } - } - ] - }, - "params":{ - }, - "body":{ - "description":"The data stream definition", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete.json deleted file mode 100644 index 53fdf44bb36a1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "indices.delete":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html", - "description":"Deletes an index." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}", - "methods":[ - "DELETE" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Ignore unavailable indexes (default: false)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_alias.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_alias.json deleted file mode 100644 index 13abf70ca739b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_alias.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "indices.delete_alias":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", - "description":"Deletes an alias." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_alias/{name}", - "methods":[ - "DELETE" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names (supports wildcards); use `_all` for all indices" - }, - "name":{ - "type":"list", - "description":"A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices." - } - } - }, - { - "path":"/{index}/_aliases/{name}", - "methods":[ - "DELETE" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names (supports wildcards); use `_all` for all indices" - }, - "name":{ - "type":"list", - "description":"A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices." - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit timestamp for the document" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_data_stream.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_data_stream.json deleted file mode 100644 index 71ed5808caefc..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_data_stream.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "indices.delete_data_stream":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html", - "description":"Deletes a data stream." - }, - "stability":"experimental", - "url":{ - "paths":[ - { - "path":"/_data_stream/{name}", - "methods":[ - "DELETE" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the data stream" - } - } - } - ] - }, - "params":{} - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_template.json deleted file mode 100644 index ca484a73e99f9..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.delete_template.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "indices.delete_template":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", - "description":"Deletes an index template." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_template/{name}", - "methods":[ - "DELETE" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the template" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists.json deleted file mode 100644 index 7539f44a81eed..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "indices.exists":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html", - "description":"Returns information about whether a particular index exists." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}", - "methods":[ - "HEAD" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names" - } - } - } - ] - }, - "params":{ - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Ignore unavailable indexes (default: false)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" - }, - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "include_defaults":{ - "type":"boolean", - "description":"Whether to return all default setting for each of the indices.", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_alias.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_alias.json deleted file mode 100644 index 66e5ce92cbbe5..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_alias.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "indices.exists_alias":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", - "description":"Returns information about whether a particular alias exists." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_alias/{name}", - "methods":[ - "HEAD" - ], - "parts":{ - "name":{ - "type":"list", - "description":"A comma-separated list of alias names to return" - } - } - }, - { - "path":"/{index}/_alias/{name}", - "methods":[ - "HEAD" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to filter aliases" - }, - "name":{ - "type":"list", - "description":"A comma-separated list of alias names to return" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"all", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_template.json deleted file mode 100644 index 9796bdd9d21ff..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_template.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "indices.exists_template":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", - "description":"Returns information about whether a particular index template exists." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_template/{name}", - "methods":[ - "HEAD" - ], - "parts":{ - "name":{ - "type":"list", - "description":"The comma separated names of the index templates" - } - } - } - ] - }, - "params":{ - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_type.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_type.json deleted file mode 100644 index c854d0e8fd841..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.exists_type.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "indices.exists_type":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html", - "description":"Returns information about whether a particular document type exists. (DEPRECATED)" - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_mapping/{type}", - "methods":[ - "HEAD" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` to check the types across all indices" - }, - "type":{ - "type":"list", - "description":"A comma-separated list of document types to check" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush.json deleted file mode 100644 index 35138b920466f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "indices.flush":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html", - "description":"Performs the flush operation on one or more indices." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_flush", - "methods":[ - "POST", - "GET" - ] - }, - { - "path":"/{index}/_flush", - "methods":[ - "POST", - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string for all indices" - } - } - } - ] - }, - "params":{ - "force":{ - "type":"boolean", - "description":"Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal)" - }, - "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 true. If set to false the flush will be skipped iff if another flush operation is already running." - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush_synced.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush_synced.json deleted file mode 100644 index a7b4541c9623a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.flush_synced.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "indices.flush_synced":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush-api.html", - "description":"Performs a synced flush operation on one or more indices. Synced flush is deprecated and will be removed in 8.0. Use flush instead" - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_flush/synced", - "methods":[ - "POST", - "GET" - ] - }, - { - "path":"/{index}/_flush/synced", - "methods":[ - "POST", - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string for all indices" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.forcemerge.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.forcemerge.json deleted file mode 100644 index 6036b75bb83e4..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.forcemerge.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "indices.forcemerge":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html", - "description":"Performs the force merge operation on one or more indices." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_forcemerge", - "methods":[ - "POST" - ] - }, - { - "path":"/{index}/_forcemerge", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "flush":{ - "type":"boolean", - "description":"Specify whether the index should be flushed after performing the operation (default: true)" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "max_num_segments":{ - "type":"number", - "description":"The number of segments the index should be merged into (default: dynamic)" - }, - "only_expunge_deletes":{ - "type":"boolean", - "description":"Specify whether the operation should only expunge deleted documents" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get.json deleted file mode 100644 index f78b410f5b489..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "indices.get":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html", - "description":"Returns information about one or more indices." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names" - } - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether to add the type name to the response (default: false)" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Ignore unavailable indexes (default: false)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" - }, - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "include_defaults":{ - "type":"boolean", - "description":"Whether to return all default setting for each of the indices.", - "default":false - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_alias.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_alias.json deleted file mode 100644 index e238c4fc38afc..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_alias.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "indices.get_alias":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", - "description":"Returns an alias." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_alias", - "methods":[ - "GET" - ] - }, - { - "path":"/_alias/{name}", - "methods":[ - "GET" - ], - "parts":{ - "name":{ - "type":"list", - "description":"A comma-separated list of alias names to return" - } - } - }, - { - "path":"/{index}/_alias/{name}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to filter aliases" - }, - "name":{ - "type":"list", - "description":"A comma-separated list of alias names to return" - } - } - }, - { - "path":"/{index}/_alias", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to filter aliases" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default": ["all"], - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_data_streams.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_data_streams.json deleted file mode 100644 index 42415068d4a5d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_data_streams.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "indices.get_data_streams":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html", - "description":"Returns data streams." - }, - "stability":"experimental", - "url":{ - "paths":[ - { - "path":"/_data_streams", - "methods":[ - "GET" - ] - }, - { - "path":"/_data_streams/{name}", - "methods":[ - "GET" - ], - "parts":{ - "name":{ - "type":"list", - "description":"The comma separated names of data streams" - } - } - } - ] - }, - "params":{ - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_field_mapping.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_field_mapping.json deleted file mode 100644 index 15cc48a582cc4..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_field_mapping.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "indices.get_field_mapping":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html", - "description":"Returns mapping for one or more fields." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_mapping/field/{fields}", - "methods":[ - "GET" - ], - "parts":{ - "fields":{ - "type":"list", - "description":"A comma-separated list of fields" - } - } - }, - { - "path":"/{index}/_mapping/field/{fields}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names" - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields" - } - } - }, - { - "path":"/_mapping/{type}/field/{fields}", - "methods":[ - "GET" - ], - "parts":{ - "type":{ - "type":"list", - "description":"A comma-separated list of document types", - "deprecated":true - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields" - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - }, - { - "path":"/{index}/_mapping/{type}/field/{fields}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names" - }, - "type":{ - "type":"list", - "description":"A comma-separated list of document types", - "deprecated":true - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields" - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether a type should be returned in the body of the mappings." - }, - "include_defaults":{ - "type":"boolean", - "description":"Whether the default mapping values should be returned as well" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_mapping.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_mapping.json deleted file mode 100644 index 188203dc13664..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_mapping.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "indices.get_mapping":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html", - "description":"Returns mappings for one or more indices." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_mapping", - "methods":[ - "GET" - ] - }, - { - "path":"/{index}/_mapping", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names" - } - } - }, - { - "path":"/_mapping/{type}", - "methods":[ - "GET" - ], - "parts":{ - "type":{ - "type":"list", - "description":"A comma-separated list of document types", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - }, - { - "path":"/{index}/_mapping/{type}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names" - }, - "type":{ - "type":"list", - "description":"A comma-separated list of document types", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether to add the type name to the response (default: false)" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_settings.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_settings.json deleted file mode 100644 index 4a1dea974f750..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_settings.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "indices.get_settings":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html", - "description":"Returns settings for one or more indices." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_settings", - "methods":[ - "GET" - ] - }, - { - "path":"/{index}/_settings", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - }, - { - "path":"/{index}/_settings/{name}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - }, - "name":{ - "type":"list", - "description":"The name of the settings that should be included" - } - } - }, - { - "path":"/_settings/{name}", - "methods":[ - "GET" - ], - "parts":{ - "name":{ - "type":"list", - "description":"The name of the settings that should be included" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":[ - "open", - "closed" - ], - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "include_defaults":{ - "type":"boolean", - "description":"Whether to return all default setting for each of the indices.", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_template.json deleted file mode 100644 index 9e07ae663ff8f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_template.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "indices.get_template":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", - "description":"Returns an index template." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_template", - "methods":[ - "GET" - ] - }, - { - "path":"/_template/{name}", - "methods":[ - "GET" - ], - "parts":{ - "name":{ - "type":"list", - "description":"The comma separated names of the index templates" - } - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether a type should be returned in the body of the mappings." - }, - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_upgrade.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_upgrade.json deleted file mode 100644 index 472a90121fd2a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.get_upgrade.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "indices.get_upgrade":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html", - "description":"The _upgrade API is no longer useful and will be removed." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_upgrade", - "methods":[ - "GET" - ] - }, - { - "path":"/{index}/_upgrade", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.open.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.open.json deleted file mode 100644 index 1dab468ce4ff4..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.open.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "indices.open":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html", - "description":"Opens an index." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_open", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma separated list of indices to open" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"closed", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of active shards to wait for before the operation returns." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_alias.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_alias.json deleted file mode 100644 index 603f24b665eb7..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_alias.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "indices.put_alias":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", - "description":"Creates or updates an alias." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_alias/{name}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices." - }, - "name":{ - "type":"string", - "description":"The name of the alias to be created or updated" - } - } - }, - { - "path":"/{index}/_aliases/{name}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices." - }, - "name":{ - "type":"string", - "description":"The name of the alias to be created or updated" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit timestamp for the document" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - } - }, - "body":{ - "description":"The settings for the alias, such as `routing` or `filter`", - "required":false - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_mapping.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_mapping.json deleted file mode 100644 index deb7bb728f733..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_mapping.json +++ /dev/null @@ -1,205 +0,0 @@ -{ - "indices.put_mapping":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html", - "description":"Updates the index mappings." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_mapping", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." - } - } - }, - { - "path":"/{index}/{type}/_mapping", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." - }, - "type":{ - "type":"string", - "description":"The name of the document type", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - }, - { - "path":"/{index}/_mapping/{type}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." - }, - "type":{ - "type":"string", - "description":"The name of the document type", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - }, - { - "path":"/{index}/{type}/_mappings", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." - }, - "type":{ - "type":"string", - "description":"The name of the document type", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - }, - { - "path":"/{index}/_mappings/{type}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." - }, - "type":{ - "type":"string", - "description":"The name of the document type", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - }, - { - "path":"/_mappings/{type}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "type":{ - "type":"string", - "description":"The name of the document type", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - }, - { - "path":"{index}/_mappings", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"The plural mappings is accepted but only /_mapping is documented" - } - }, - { - "path":"/_mapping/{type}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "type":{ - "type":"string", - "description":"The name of the document type", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether a type should be expected in the body of the mappings." - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - }, - "body":{ - "description":"The mapping definition", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_settings.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_settings.json deleted file mode 100644 index 66fe23bab8ba2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_settings.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "indices.put_settings":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html", - "description":"Updates the index settings." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_settings", - "methods":[ - "PUT" - ] - }, - { - "path":"/{index}/_settings", - "methods":[ - "PUT" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "preserve_existing":{ - "type":"boolean", - "description":"Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false`" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - } - }, - "body":{ - "description":"The index settings to be updated", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_template.json deleted file mode 100644 index 701a722d89eb8..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.put_template.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "indices.put_template":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", - "description":"Creates or updates an index template." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_template/{name}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the template" - } - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether a type should be returned in the body of the mappings." - }, - "order":{ - "type":"number", - "description":"The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)" - }, - "create":{ - "type":"boolean", - "description":"Whether the index template should only be added if new or can also replace an existing one", - "default":false - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - } - }, - "body":{ - "description":"The template definition", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.recovery.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.recovery.json deleted file mode 100644 index 8b134bbe2413a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.recovery.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "indices.recovery":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html", - "description":"Returns information about ongoing index shard recoveries." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_recovery", - "methods":[ - "GET" - ] - }, - { - "path":"/{index}/_recovery", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "detailed":{ - "type":"boolean", - "description":"Whether to display detailed information about shard recovery", - "default":false - }, - "active_only":{ - "type":"boolean", - "description":"Display only those recoveries that are currently on-going", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.refresh.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.refresh.json deleted file mode 100644 index 950e0a62489fa..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.refresh.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "indices.refresh":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html", - "description":"Performs the refresh operation in one or more indices." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_refresh", - "methods":[ - "POST", - "GET" - ] - }, - { - "path":"/{index}/_refresh", - "methods":[ - "POST", - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.rollover.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.rollover.json deleted file mode 100644 index 4ed1f9b490969..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.rollover.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "indices.rollover":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html", - "description":"Updates an alias to point to a new index when the existing index\nis considered to be too large or too old." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{alias}/_rollover", - "methods":[ - "POST" - ], - "parts":{ - "alias":{ - "type":"string", - "description":"The name of the alias to rollover" - } - } - }, - { - "path":"/{alias}/_rollover/{new_index}", - "methods":[ - "POST" - ], - "parts":{ - "alias":{ - "type":"string", - "description":"The name of the alias to rollover" - }, - "new_index":{ - "type":"string", - "description":"The name of the rollover index" - } - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether a type should be included in the body of the mappings." - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "dry_run":{ - "type":"boolean", - "description":"If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - }, - "wait_for_active_shards":{ - "type":"string", - "description":"Set the number of active shards to wait for on the newly created rollover index before the operation returns." - } - }, - "body":{ - "description":"The conditions that needs to be met for executing rollover" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.segments.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.segments.json deleted file mode 100644 index 83430a9a85600..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.segments.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "indices.segments":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html", - "description":"Provides low-level information about segments in a Lucene index." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_segments", - "methods":[ - "GET" - ] - }, - { - "path":"/{index}/_segments", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "verbose":{ - "type":"boolean", - "description":"Includes detailed memory usage by Lucene.", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.shard_stores.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.shard_stores.json deleted file mode 100644 index 7e48e99916171..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.shard_stores.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "indices.shard_stores":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html", - "description":"Provides store information for shard copies of indices." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_shard_stores", - "methods":[ - "GET" - ] - }, - { - "path":"/{index}/_shard_stores", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "status":{ - "type":"list", - "options":[ - "green", - "yellow", - "red", - "all" - ], - "description":"A comma-separated list of statuses used to filter on shards to get store information for" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.shrink.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.shrink.json deleted file mode 100644 index fd6d705d6a5fa..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.shrink.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "indices.shrink":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html", - "description":"Allow to shrink an existing index into a new index with fewer primary shards." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_shrink/{target}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The name of the source index to shrink" - }, - "target":{ - "type":"string", - "description":"The name of the target index to shrink into" - } - } - } - ] - }, - "params":{ - "copy_settings": { - "type" : "boolean", - "description" : "whether or not to copy settings from the source index (defaults to false)" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Set the number of active shards to wait for on the shrunken index before the operation returns." - } - }, - "body":{ - "description":"The configuration for the target index (`settings` and `aliases`)" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.split.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.split.json deleted file mode 100644 index 02df3cdedf01f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.split.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "indices.split":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html", - "description":"Allows you to split an existing index into a new index with more primary shards." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_split/{target}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The name of the source index to split" - }, - "target":{ - "type":"string", - "description":"The name of the target index to split into" - } - } - } - ] - }, - "params": { - "copy_settings": { - "type" : "boolean", - "description" : "whether or not to copy settings from the source index (defaults to false)" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Set the number of active shards to wait for on the shrunken index before the operation returns." - } - }, - "body":{ - "description":"The configuration for the target index (`settings` and `aliases`)" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.stats.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.stats.json deleted file mode 100644 index 0a8960f2f9e89..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.stats.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "indices.stats":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html", - "description":"Provides statistics on operations happening in an index." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_stats", - "methods":[ - "GET" - ] - }, - { - "path":"/_stats/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "completion", - "docs", - "fielddata", - "query_cache", - "flush", - "get", - "indexing", - "merge", - "request_cache", - "refresh", - "search", - "segments", - "store", - "warmer", - "suggest" - ], - "description":"Limit the information returned the specific metrics." - } - } - }, - { - "path":"/{index}/_stats", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - }, - { - "path":"/{index}/_stats/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - }, - "metric":{ - "type":"list", - "options":[ - "_all", - "completion", - "docs", - "fielddata", - "query_cache", - "flush", - "get", - "indexing", - "merge", - "request_cache", - "refresh", - "search", - "segments", - "store", - "warmer", - "suggest" - ], - "description":"Limit the information returned the specific metrics." - } - } - } - ] - }, - "params":{ - "completion_fields":{ - "type":"list", - "description":"A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)" - }, - "fielddata_fields":{ - "type":"list", - "description":"A comma-separated list of fields for `fielddata` index metric (supports wildcards)" - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)" - }, - "groups":{ - "type":"list", - "description":"A comma-separated list of search groups for `search` index metric" - }, - "level":{ - "type":"enum", - "description":"Return stats aggregated at cluster, index or shard level", - "options":[ - "cluster", - "indices", - "shards" - ], - "default":"indices" - }, - "types":{ - "type":"list", - "description":"A comma-separated list of document types for the `indexing` index metric" - }, - "include_segment_file_sizes":{ - "type":"boolean", - "description":"Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)", - "default":false - }, - "include_unloaded_segments":{ - "type":"boolean", - "description":"If set to true segment stats will include stats for segments that are not currently loaded into memory", - "default":false - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "forbid_closed_indices":{ - "type":"boolean", - "description":"If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices", - "default":true - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.update_aliases.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.update_aliases.json deleted file mode 100644 index d4a222f2061c8..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.update_aliases.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "indices.update_aliases":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html", - "description":"Updates index aliases." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_aliases", - "methods":[ - "POST" - ] - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Request timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - } - }, - "body":{ - "description":"The definition of `actions` to perform", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.upgrade.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.upgrade.json deleted file mode 100644 index 670d3e0a33586..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.upgrade.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "indices.upgrade":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html", - "description":"The _upgrade API is no longer useful and will be removed." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_upgrade", - "methods":[ - "POST" - ] - }, - { - "path":"/{index}/_upgrade", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "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/rest-api-spec/out/production/resources/rest-api-spec/api/indices.validate_query.json b/rest-api-spec/out/production/resources/rest-api-spec/api/indices.validate_query.json deleted file mode 100644 index 3becec003a9e6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/indices.validate_query.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "indices.validate_query":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html", - "description":"Allows a user to validate a potentially expensive query without executing it." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_validate/query", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_validate/query", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices" - } - } - }, - { - "path":"/{index}/{type}/_validate/query", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices" - }, - "type":{ - "type":"list", - "description":"A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "explain":{ - "type":"boolean", - "description":"Return detailed information about the error" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "q":{ - "type":"string", - "description":"Query in the Lucene query string syntax" - }, - "analyzer":{ - "type":"string", - "description":"The analyzer to use for the query string" - }, - "analyze_wildcard":{ - "type":"boolean", - "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" - }, - "default_operator":{ - "type":"enum", - "options":[ - "AND", - "OR" - ], - "default":"OR", - "description":"The default operator for query string query (AND or OR)" - }, - "df":{ - "type":"string", - "description":"The field to use as default where no field prefix is given in the query string" - }, - "lenient":{ - "type":"boolean", - "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "rewrite":{ - "type":"boolean", - "description":"Provide a more detailed explanation showing the actual Lucene query that will be executed." - }, - "all_shards":{ - "type":"boolean", - "description":"Execute validation on all shards instead of one random shard per index" - } - }, - "body":{ - "description":"The query definition specified with the Query DSL" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/info.json b/rest-api-spec/out/production/resources/rest-api-spec/api/info.json deleted file mode 100644 index 1c48f05d02e9d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/info.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "info":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html", - "description":"Returns basic information about the cluster." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/", - "methods":[ - "GET" - ] - } - ] - }, - "params":{} - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.delete_pipeline.json b/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.delete_pipeline.json deleted file mode 100644 index 29b4219038cd2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.delete_pipeline.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "ingest.delete_pipeline":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html", - "description":"Deletes a pipeline." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_ingest/pipeline/{id}", - "methods":[ - "DELETE" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Pipeline ID" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.get_pipeline.json b/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.get_pipeline.json deleted file mode 100644 index 65fc4f91b2b42..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.get_pipeline.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "ingest.get_pipeline":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html", - "description":"Returns a pipeline." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_ingest/pipeline", - "methods":[ - "GET" - ] - }, - { - "path":"/_ingest/pipeline/{id}", - "methods":[ - "GET" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Comma separated list of pipeline ids. Wildcards supported" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.processor_grok.json b/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.processor_grok.json deleted file mode 100644 index ac8ad6e6d0669..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.processor_grok.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "ingest.processor_grok":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get", - "description":"Returns a list of the built-in patterns." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_ingest/processor/grok", - "methods":[ - "GET" - ] - } - ] - }, - "params":{} - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.put_pipeline.json b/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.put_pipeline.json deleted file mode 100644 index 4d2105866791c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.put_pipeline.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "ingest.put_pipeline":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html", - "description":"Creates or updates a pipeline." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_ingest/pipeline/{id}", - "methods":[ - "PUT" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Pipeline ID" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - }, - "body":{ - "description":"The ingest definition", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.simulate.json b/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.simulate.json deleted file mode 100644 index 8122f7a0ffa19..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/ingest.simulate.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "ingest.simulate":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html", - "description":"Allows to simulate a pipeline with example documents." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_ingest/pipeline/_simulate", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/_ingest/pipeline/{id}/_simulate", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Pipeline ID" - } - } - } - ] - }, - "params":{ - "verbose":{ - "type":"boolean", - "description":"Verbose mode. Display data output for each processor in executed pipeline", - "default":false - } - }, - "body":{ - "description":"The simulate definition", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/mget.json b/rest-api-spec/out/production/resources/rest-api-spec/api/mget.json deleted file mode 100644 index f1d35aee7d62f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/mget.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "mget":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html", - "description":"Allows to get multiple documents in one request." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_mget", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_mget", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The name of the index" - } - } - }, - { - "path":"/{index}/{type}/_mget", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "stored_fields":{ - "type":"list", - "description":"A comma-separated list of stored fields to return in the response" - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "realtime":{ - "type":"boolean", - "description":"Specify whether to perform the operation in realtime or search mode" - }, - "refresh":{ - "type":"boolean", - "description":"Refresh the shard containing the document before performing the operation" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - } - }, - "body":{ - "description":"Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL.", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/msearch.json b/rest-api-spec/out/production/resources/rest-api-spec/api/msearch.json deleted file mode 100644 index e3e6ef57e42c8..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/msearch.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "msearch":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html", - "description":"Allows to execute several search operations in one request." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_msearch", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_msearch", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to use as default" - } - } - }, - { - "path" : "/{index}/{type}/_msearch", - "methods": ["GET", "POST"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names to use as default" - }, - "type": { - "type" : "list", - "description" : "A comma-separated list of document types to use as default" - } - }, - "deprecated": { - "version" : "7.0.0", - "description" : "Specifying types in urls has been deprecated" - } - } - ] - }, - "params": { - "search_type":{ - "type":"enum", - "options":[ - "query_then_fetch", - "query_and_fetch", - "dfs_query_then_fetch", - "dfs_query_and_fetch" - ], - "description":"Search operation type" - }, - "max_concurrent_searches" : { - "type" : "number", - "description" : "Controls the maximum number of concurrent searches the multi search api will execute" - }, - "typed_keys": { - "type" : "boolean", - "description" : "Specify whether aggregation and suggester names should be prefixed by their respective types in the response" - }, - "pre_filter_shard_size":{ - "type":"number", - "description" : "A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint." - }, - "max_concurrent_shard_requests" : { - "type" : "number", - "description" : "The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests", - "default" : 5 - }, - "rest_total_hits_as_int" : { - "type": "boolean", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default": false - }, - "ccs_minimize_roundtrips":{ - "type":"boolean", - "description":"Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", - "default":"true" - } - }, - "body":{ - "description":"The request definitions (metadata-search request definition pairs), separated by newlines", - "required":true, - "serialize":"bulk" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/msearch_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/msearch_template.json deleted file mode 100644 index 8eb300c975932..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/msearch_template.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "msearch_template":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html", - "description":"Allows to execute several search template operations in one request." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_msearch/template", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_msearch/template", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to use as default" - } - } - }, - { - "path" : "/{index}/{type}/_msearch/template", - "methods": ["GET", "POST"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names to use as default" - }, - "type": { - "type" : "list", - "description" : "A comma-separated list of document types to use as default" - } - }, - "deprecated": { - "version" : "7.0.0", - "description" : "Specifying types in urls has been deprecated" - } - } - ] - }, - "params": { - "search_type":{ - "type":"enum", - "options":[ - "query_then_fetch", - "query_and_fetch", - "dfs_query_then_fetch", - "dfs_query_and_fetch" - ], - "description":"Search operation type" - }, - "typed_keys": { - "type" : "boolean", - "description" : "Specify whether aggregation and suggester names should be prefixed by their respective types in the response" - }, - "max_concurrent_searches" : { - "type" : "number", - "description" : "Controls the maximum number of concurrent searches the multi search api will execute" - }, - "rest_total_hits_as_int" : { - "type" : "boolean", - "description" : "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default" : false - }, - "ccs_minimize_roundtrips": { - "type" : "boolean", - "description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", - "default" : "true" - } - }, - "body":{ - "description":"The request definitions (metadata-search request definition pairs), separated by newlines", - "required":true, - "serialize":"bulk" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/mtermvectors.json b/rest-api-spec/out/production/resources/rest-api-spec/api/mtermvectors.json deleted file mode 100644 index 93dee177e8026..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/mtermvectors.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "mtermvectors":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html", - "description":"Returns multiple termvectors in one request." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_mtermvectors", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_mtermvectors", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The index in which the document resides." - } - } - }, - { - "path" : "/{index}/{type}/_mtermvectors", - "methods" : ["GET", "POST"], - "parts" : { - "index" : { - "type" : "string", - "description" : "The index in which the document resides." - }, - "type" : { - "type" : "string", - "description" : "The type of the document." - } - }, - "deprecated":{ - "version" : "7.0.0", - - "description" : "Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "ids":{ - "type":"list", - "description":"A comma-separated list of documents ids. You must define ids as parameter or set \"ids\" or \"docs\" in the request body" - }, - "term_statistics":{ - "type":"boolean", - "description":"Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "default":false - }, - "field_statistics":{ - "type":"boolean", - "description":"Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "default":true - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\"." - }, - "offsets":{ - "type":"boolean", - "description":"Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "default":true - }, - "positions":{ - "type":"boolean", - "description":"Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "default":true - }, - "payloads":{ - "type":"boolean", - "description":"Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "default":true - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\"." - }, - "routing":{ - "type":"string", - "description":"Specific routing value. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\"." - }, - "realtime":{ - "type":"boolean", - "description":"Specifies if requests are real-time as opposed to near-real-time (default: true)." - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte", - "force" - ], - "description":"Specific version type" - } - }, - "body":{ - "description":"Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation.", - "required":false - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.hot_threads.json b/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.hot_threads.json deleted file mode 100644 index 0830344dc4ad4..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.hot_threads.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "nodes.hot_threads":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html", - "description":"Returns information about hot threads on each node in the cluster." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_nodes/hot_threads", - "methods":[ - "GET" - ] - }, - { - "path":"/_nodes/{node_id}/hot_threads", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - }, - { - "path":"/_cluster/nodes/hotthreads", - "methods":[ - "GET" - ], - "parts":{}, - "deprecated":{ - "version":"7.0.0", - "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" - } - }, - { - "path":"/_cluster/nodes/{node_id}/hotthreads", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" - } - }, - { - "path":"/_nodes/hotthreads", - "methods":[ - "GET" - ], - "parts":{}, - "deprecated":{ - "version":"7.0.0", - "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" - } - }, - { - "path":"/_nodes/{node_id}/hotthreads", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" - } - }, - { - "path":"/_cluster/nodes/hot_threads", - "methods":[ - "GET" - ], - "parts":{}, - "deprecated":{ - "version":"7.0.0", - "description":"The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" - } - }, - { - "path":"/_cluster/nodes/{node_id}/hot_threads", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" - } - } - ] - }, - "params":{ - "interval":{ - "type":"time", - "description":"The interval for the second sampling of threads" - }, - "snapshots":{ - "type":"number", - "description":"Number of samples of thread stacktrace (default: 10)" - }, - "threads":{ - "type":"number", - "description":"Specify the number of threads to provide information for (default: 3)" - }, - "ignore_idle_threads":{ - "type":"boolean", - "description":"Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true)" - }, - "type":{ - "type":"enum", - "options":[ - "cpu", - "wait", - "block" - ], - "description":"The type to sample (default: cpu)" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.info.json b/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.info.json deleted file mode 100644 index 37279edd3106f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.info.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "nodes.info":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html", - "description":"Returns information about nodes in the cluster." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_nodes", - "methods":[ - "GET" - ] - }, - { - "path":"/_nodes/{node_id}", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - }, - { - "path":"/_nodes/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "settings", - "os", - "process", - "jvm", - "thread_pool", - "transport", - "http", - "plugins", - "ingest" - ], - "description":"A comma-separated list of metrics you wish returned. Leave empty to return all." - } - } - }, - { - "path":"/_nodes/{node_id}/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - }, - "metric":{ - "type":"list", - "options":[ - "settings", - "os", - "process", - "jvm", - "thread_pool", - "transport", - "http", - "plugins", - "ingest" - ], - "description":"A comma-separated list of metrics you wish returned. Leave empty to return all." - } - } - } - ] - }, - "params":{ - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.reload_secure_settings.json b/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.reload_secure_settings.json deleted file mode 100644 index b1be8af3eee67..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.reload_secure_settings.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "nodes.reload_secure_settings":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings", - "description":"Reloads secure settings." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_nodes/reload_secure_settings", - "methods":[ - "POST" - ] - }, - { - "path":"/_nodes/{node_id}/reload_secure_settings", - "methods":[ - "POST" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes." - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.stats.json b/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.stats.json deleted file mode 100644 index 1aa57ee849c66..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.stats.json +++ /dev/null @@ -1,224 +0,0 @@ -{ - "nodes.stats":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html", - "description":"Returns statistical information about nodes in the cluster." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_nodes/stats", - "methods":[ - "GET" - ] - }, - { - "path":"/_nodes/{node_id}/stats", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - }, - { - "path":"/_nodes/stats/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "breaker", - "fs", - "http", - "indices", - "jvm", - "os", - "process", - "thread_pool", - "transport", - "discovery" - ], - "description":"Limit the information returned to the specified metrics" - } - } - }, - { - "path":"/_nodes/{node_id}/stats/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "breaker", - "fs", - "http", - "indices", - "jvm", - "os", - "process", - "thread_pool", - "transport", - "discovery" - ], - "description":"Limit the information returned to the specified metrics" - }, - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - }, - { - "path":"/_nodes/stats/{metric}/{index_metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "breaker", - "fs", - "http", - "indices", - "jvm", - "os", - "process", - "thread_pool", - "transport", - "discovery" - ], - "description":"Limit the information returned to the specified metrics" - }, - "index_metric":{ - "type":"list", - "options":[ - "_all", - "completion", - "docs", - "fielddata", - "query_cache", - "flush", - "get", - "indexing", - "merge", - "request_cache", - "refresh", - "search", - "segments", - "store", - "warmer", - "suggest" - ], - "description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified." - } - } - }, - { - "path":"/_nodes/{node_id}/stats/{metric}/{index_metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "breaker", - "fs", - "http", - "indices", - "jvm", - "os", - "process", - "thread_pool", - "transport", - "discovery" - ], - "description":"Limit the information returned to the specified metrics" - }, - "index_metric":{ - "type":"list", - "options":[ - "_all", - "completion", - "docs", - "fielddata", - "query_cache", - "flush", - "get", - "indexing", - "merge", - "request_cache", - "refresh", - "search", - "segments", - "store", - "warmer", - "suggest" - ], - "description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified." - }, - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - } - ] - }, - "params":{ - "completion_fields":{ - "type":"list", - "description":"A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)" - }, - "fielddata_fields":{ - "type":"list", - "description":"A comma-separated list of fields for `fielddata` index metric (supports wildcards)" - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)" - }, - "groups":{ - "type":"boolean", - "description":"A comma-separated list of search groups for `search` index metric" - }, - "level":{ - "type":"enum", - "description":"Return indices stats aggregated at index, node or shard level", - "options":[ - "indices", - "node", - "shards" - ], - "default":"node" - }, - "types":{ - "type":"list", - "description":"A comma-separated list of document types for the `indexing` index metric" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "include_segment_file_sizes":{ - "type":"boolean", - "description":"Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)", - "default":false - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.usage.json b/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.usage.json deleted file mode 100644 index 5acbf7a51116c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/nodes.usage.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "nodes.usage":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html", - "description":"Returns low-level information about REST actions usage on nodes." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_nodes/usage", - "methods":[ - "GET" - ] - }, - { - "path":"/_nodes/{node_id}/usage", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - }, - { - "path":"/_nodes/usage/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "rest_actions" - ], - "description":"Limit the information returned to the specified metrics" - } - } - }, - { - "path":"/_nodes/{node_id}/usage/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "rest_actions" - ], - "description":"Limit the information returned to the specified metrics" - }, - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/ping.json b/rest-api-spec/out/production/resources/rest-api-spec/api/ping.json deleted file mode 100644 index 0e787e039d09e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/ping.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "ping":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html", - "description":"Returns whether the cluster is running." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/", - "methods":[ - "HEAD" - ] - } - ] - }, - "params":{} - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/put_script.json b/rest-api-spec/out/production/resources/rest-api-spec/api/put_script.json deleted file mode 100644 index 750f7fdf4eb62..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/put_script.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "put_script":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html", - "description":"Creates or updates a script." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_scripts/{id}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Script ID" - } - } - }, - { - "path":"/_scripts/{id}/{context}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Script ID" - }, - "context":{ - "type":"string", - "description":"Script context" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Specify timeout for connection to master" - }, - "context":{ - "type":"string", - "description":"Context name to compile script against" - } - }, - "body":{ - "description":"The document", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/rank_eval.json b/rest-api-spec/out/production/resources/rest-api-spec/api/rank_eval.json deleted file mode 100644 index eadf240192394..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/rank_eval.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "rank_eval":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html", - "description":"Allows to evaluate the quality of ranked search results over a set of typical search queries" - }, - "stability":"experimental", - "url":{ - "paths":[ - { - "path":"/_rank_eval", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_rank_eval", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "search_type":{ - "type":"enum", - "options":[ - "query_then_fetch", - "dfs_query_then_fetch" - ], - "description":"Search operation type" - } - }, - "body":{ - "description":"The ranking evaluation search definition, including search requests, document ratings and ranking metric definition.", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/reindex.json b/rest-api-spec/out/production/resources/rest-api-spec/api/reindex.json deleted file mode 100644 index 2fbaf86cab616..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/reindex.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "reindex":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html", - "description":"Allows to copy documents from one index to another, optionally filtering the source\ndocuments by a query, changing the destination index settings, or fetching the\ndocuments from a remote cluster." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_reindex", - "methods":[ - "POST" - ] - } - ] - }, - "params":{ - "refresh":{ - "type":"boolean", - "description":"Should the affected indexes be refreshed?" - }, - "timeout":{ - "type":"time", - "default":"1m", - "description":"Time each individual bulk request should wait for shards that are unavailable." - }, - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "wait_for_completion":{ - "type":"boolean", - "default":true, - "description":"Should the request should block until the reindex is complete." - }, - "requests_per_second":{ - "type":"number", - "default":0, - "description":"The throttle to set on this request in sub-requests per second. -1 means no throttle." - }, - "scroll":{ - "type":"time", - "description":"Control how long to keep the search context alive", - "default":"5m" - }, - "slices":{ - "type":"number|string", - "default":1, - "description":"The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`." - }, - "max_docs":{ - "type":"number", - "description":"Maximum number of documents to process (default: all documents)" - } - }, - "body":{ - "description":"The search definition using the Query DSL and the prototype for the index request.", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/reindex_rethrottle.json b/rest-api-spec/out/production/resources/rest-api-spec/api/reindex_rethrottle.json deleted file mode 100644 index d91365b3c49a5..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/reindex_rethrottle.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "reindex_rethrottle":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html", - "description":"Changes the number of requests per second for a particular Reindex operation." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_reindex/{task_id}/_rethrottle", - "methods":[ - "POST" - ], - "parts":{ - "task_id":{ - "type":"string", - "description":"The task id to rethrottle" - } - } - } - ] - }, - "params":{ - "requests_per_second":{ - "type":"number", - "required":true, - "description":"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/render_search_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/render_search_template.json deleted file mode 100644 index c2c474edd9853..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/render_search_template.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "render_search_template":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html#_validating_templates", - "description":"Allows to use the Mustache language to pre-render a search definition." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_render/template", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/_render/template/{id}", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The id of the stored search template" - } - } - } - ] - }, - "body":{ - "description":"The search definition template and its params" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/scripts_painless_execute.json b/rest-api-spec/out/production/resources/rest-api-spec/api/scripts_painless_execute.json deleted file mode 100644 index 9f761fb452ba1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/scripts_painless_execute.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "scripts_painless_execute":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html", - "description":"Allows an arbitrary script to be executed and a result to be returned" - }, - "stability":"experimental", - "url":{ - "paths":[ - { - "path":"/_scripts/painless/_execute", - "methods":[ - "GET", - "POST" - ] - } - ] - }, - "params":{}, - "body":{ - "description":"The script to execute" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/scroll.json b/rest-api-spec/out/production/resources/rest-api-spec/api/scroll.json deleted file mode 100644 index ea0cbe2675325..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/scroll.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "scroll":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll", - "description":"Allows to retrieve a large numbers of results from a single search request." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_search/scroll", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/_search/scroll/{scroll_id}", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "scroll_id":{ - "type":"string", - "description":"The scroll ID", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"A scroll id can be quite large and should be specified as part of the body" - } - } - ] - }, - "params":{ - "scroll":{ - "type":"time", - "description":"Specify how long a consistent view of the index should be maintained for scrolled search" - }, - "scroll_id":{ - "type":"string", - "description":"The scroll ID for scrolled search" - }, - "rest_total_hits_as_int":{ - "type":"boolean", - "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default":false - } - }, - "body":{ - "description":"The scroll ID if not passed by URL or query parameter." - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/search.json b/rest-api-spec/out/production/resources/rest-api-spec/api/search.json deleted file mode 100644 index 7770acc52f978..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/search.json +++ /dev/null @@ -1,252 +0,0 @@ -{ - "search":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html", - "description":"Returns results matching a query." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_search", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_search", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - } - } - }, - { - "path" : "/{index}/{type}/_search", - "methods": ["GET", "POST"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - }, - "type": { - "type": "list", - "description": "A comma-separated list of document types to search; leave empty to perform the operation on all types" - } - }, - "deprecated" : { - "version" : "7.0.0", - "description" : "Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "analyzer":{ - "type":"string", - "description":"The analyzer to use for the query string" - }, - "analyze_wildcard":{ - "type":"boolean", - "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" - }, - "ccs_minimize_roundtrips":{ - "type":"boolean", - "description":"Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", - "default":"true" - }, - "default_operator":{ - "type":"enum", - "options":[ - "AND", - "OR" - ], - "default":"OR", - "description":"The default operator for query string query (AND or OR)" - }, - "df":{ - "type":"string", - "description":"The field to use as default where no field prefix is given in the query string" - }, - "explain":{ - "type":"boolean", - "description":"Specify whether to return detailed information about score computation as part of a hit" - }, - "stored_fields":{ - "type":"list", - "description":"A comma-separated list of stored fields to return as part of a hit" - }, - "docvalue_fields":{ - "type":"list", - "description":"A comma-separated list of fields to return as the docvalue representation of a field for each hit" - }, - "from":{ - "type":"number", - "description":"Starting offset (default: 0)" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "ignore_throttled":{ - "type":"boolean", - "description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "lenient":{ - "type":"boolean", - "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "q":{ - "type":"string", - "description":"Query in the Lucene query string syntax" - }, - "routing":{ - "type":"list", - "description":"A comma-separated list of specific routing values" - }, - "scroll":{ - "type":"time", - "description":"Specify how long a consistent view of the index should be maintained for scrolled search" - }, - "search_type":{ - "type":"enum", - "options":[ - "query_then_fetch", - "dfs_query_then_fetch" - ], - "description":"Search operation type" - }, - "size":{ - "type":"number", - "description":"Number of hits to return (default: 10)" - }, - "sort":{ - "type":"list", - "description":"A comma-separated list of : pairs" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - }, - "terminate_after":{ - "type":"number", - "description":"The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." - }, - "stats":{ - "type":"list", - "description":"Specific 'tag' of the request for logging and statistical purposes" - }, - "suggest_field":{ - "type":"string", - "description":"Specify which field to use for suggestions" - }, - "suggest_mode":{ - "type":"enum", - "options":[ - "missing", - "popular", - "always" - ], - "default":"missing", - "description":"Specify suggest mode" - }, - "suggest_size":{ - "type":"number", - "description":"How many suggestions to return in response" - }, - "suggest_text":{ - "type":"string", - "description":"The source text for which the suggestions should be returned" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "track_scores":{ - "type":"boolean", - "description":"Whether to calculate and return scores even if they are not used for sorting" - }, - "track_total_hits":{ - "type":"boolean", - "description":"Indicate if the number of documents that match the query should be tracked" - }, - "allow_partial_search_results":{ - "type":"boolean", - "default":true, - "description":"Indicate if an error should be returned if there is a partial search failure or timeout" - }, - "typed_keys":{ - "type":"boolean", - "description":"Specify whether aggregation and suggester names should be prefixed by their respective types in the response" - }, - "version":{ - "type":"boolean", - "description":"Specify whether to return document version as part of a hit" - }, - "seq_no_primary_term":{ - "type":"boolean", - "description":"Specify whether to return sequence number and primary term of the last modification of each hit" - }, - "request_cache":{ - "type":"boolean", - "description":"Specify if request cache should be used for this request or not, defaults to index level setting" - }, - "batched_reduce_size":{ - "type":"number", - "description":"The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.", - "default":512 - }, - "max_concurrent_shard_requests":{ - "type":"number", - "description":"The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests", - "default":5 - }, - "pre_filter_shard_size":{ - "type":"number", - "description":"A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint." - }, - "rest_total_hits_as_int":{ - "type":"boolean", - "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default":false - } - }, - "body":{ - "description":"The search definition using the Query DSL" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/search_shards.json b/rest-api-spec/out/production/resources/rest-api-spec/api/search_shards.json deleted file mode 100644 index 74b7055b4c4b0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/search_shards.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "search_shards":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html", - "description":"Returns information about the indices and shards that a search request would be executed against." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_search_shards", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_search_shards", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/search_template.json b/rest-api-spec/out/production/resources/rest-api-spec/api/search_template.json deleted file mode 100644 index 00bd09729c908..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/search_template.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "search_template":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html", - "description":"Allows to use the Mustache language to pre-render a search definition." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_search/template", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_search/template", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - } - } - }, - { - "path" : "/{index}/{type}/_search/template", - "methods": ["GET", "POST"], - "parts": { - "index": { - "type" : "list", - "description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - }, - "type": { - "type" : "list", - "description" : "A comma-separated list of document types to search; leave empty to perform the operation on all types" - } - }, - "deprecated" : { - "version" : "7.0.0", - "description" : "Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "ignore_throttled":{ - "type":"boolean", - "description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "routing":{ - "type":"list", - "description":"A comma-separated list of specific routing values" - }, - "scroll":{ - "type":"time", - "description":"Specify how long a consistent view of the index should be maintained for scrolled search" - }, - "search_type":{ - "type":"enum", - "options":[ - "query_then_fetch", - "query_and_fetch", - "dfs_query_then_fetch", - "dfs_query_and_fetch" - ], - "description":"Search operation type" - }, - "explain":{ - "type":"boolean", - "description":"Specify whether to return detailed information about score computation as part of a hit" - }, - "profile":{ - "type":"boolean", - "description":"Specify whether to profile the query execution" - }, - "typed_keys":{ - "type":"boolean", - "description":"Specify whether aggregation and suggester names should be prefixed by their respective types in the response" - }, - "rest_total_hits_as_int":{ - "type":"boolean", - "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default":false - }, - "ccs_minimize_roundtrips": { - "type" : "boolean", - "description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", - "default" : "true" - } - }, - "body":{ - "description":"The search definition template and its params", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.cleanup_repository.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.cleanup_repository.json deleted file mode 100644 index 1d216dcb0b322..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.cleanup_repository.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "snapshot.cleanup_repository": { - "documentation": { - "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "description": "Removes stale data from repository." - }, - "stability": "stable", - "url": { - "paths": [ - { - "path": "/_snapshot/{repository}/_cleanup", - "methods": [ - "POST" - ], - "parts": { - "repository": { - "type": "string", - "description": "A repository name" - } - } - } - ] - }, - "params": { - "master_timeout": { - "type" : "time", - "description" : "Explicit operation timeout for connection to master node" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - } - }, - "body": {} - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create.json deleted file mode 100644 index da8cb9916f584..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "snapshot.create":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "description":"Creates a snapshot in a repository." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_snapshot/{repository}/{snapshot}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - }, - "snapshot":{ - "type":"string", - "description":"A snapshot name" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "wait_for_completion":{ - "type":"boolean", - "description":"Should this request wait until the operation has completed before returning", - "default":false - } - }, - "body":{ - "description":"The snapshot definition", - "required":false - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create_repository.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create_repository.json deleted file mode 100644 index 431ac3c68c0bd..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.create_repository.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "snapshot.create_repository":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "description":"Creates a repository." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_snapshot/{repository}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "verify":{ - "type":"boolean", - "description":"Whether to verify the repository after creation" - } - }, - "body":{ - "description":"The repository definition", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete.json deleted file mode 100644 index 30053cd5b94d3..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "snapshot.delete":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "description":"Deletes a snapshot." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_snapshot/{repository}/{snapshot}", - "methods":[ - "DELETE" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - }, - "snapshot":{ - "type":"string", - "description":"A snapshot name" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete_repository.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete_repository.json deleted file mode 100644 index b94c5f39b4f22..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.delete_repository.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "snapshot.delete_repository":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "description":"Deletes a repository." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_snapshot/{repository}", - "methods":[ - "DELETE" - ], - "parts":{ - "repository":{ - "type":"list", - "description":"A comma-separated list of repository names" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get.json deleted file mode 100644 index 20006f6f499b6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "snapshot.get":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "description":"Returns information about a snapshot." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_snapshot/{repository}/{snapshot}", - "methods":[ - "GET" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - }, - "snapshot":{ - "type":"list", - "description":"A comma-separated list of snapshot names" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown" - }, - "verbose":{ - "type":"boolean", - "description":"Whether to show verbose snapshot info or only show the basic info found in the repository index blob" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get_repository.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get_repository.json deleted file mode 100644 index 8c91caa4fe81f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.get_repository.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "snapshot.get_repository":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "description":"Returns information about a repository." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_snapshot", - "methods":[ - "GET" - ] - }, - { - "path":"/_snapshot/{repository}", - "methods":[ - "GET" - ], - "parts":{ - "repository":{ - "type":"list", - "description":"A comma-separated list of repository names" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.restore.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.restore.json deleted file mode 100644 index 697ea395dcc2b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.restore.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "snapshot.restore":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "description":"Restores a snapshot." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_snapshot/{repository}/{snapshot}/_restore", - "methods":[ - "POST" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - }, - "snapshot":{ - "type":"string", - "description":"A snapshot name" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "wait_for_completion":{ - "type":"boolean", - "description":"Should this request wait until the operation has completed before returning", - "default":false - } - }, - "body":{ - "description":"Details of what to restore", - "required":false - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.status.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.status.json deleted file mode 100644 index 70a7ba23ef506..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.status.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "snapshot.status":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "description":"Returns information about the status of a snapshot." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_snapshot/_status", - "methods":[ - "GET" - ] - }, - { - "path":"/_snapshot/{repository}/_status", - "methods":[ - "GET" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - } - } - }, - { - "path":"/_snapshot/{repository}/{snapshot}/_status", - "methods":[ - "GET" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - }, - "snapshot":{ - "type":"list", - "description":"A comma-separated list of snapshot names" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.verify_repository.json b/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.verify_repository.json deleted file mode 100644 index de638c19d4a0b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/snapshot.verify_repository.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "snapshot.verify_repository":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html", - "description":"Verifies a repository." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_snapshot/{repository}/_verify", - "methods":[ - "POST" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.cancel.json b/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.cancel.json deleted file mode 100644 index d9d681899868d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.cancel.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "tasks.cancel":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", - "description":"Cancels a task, if it can be cancelled through an API." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_tasks/_cancel", - "methods":[ - "POST" - ] - }, - { - "path":"/_tasks/{task_id}/_cancel", - "methods":[ - "POST" - ], - "parts":{ - "task_id":{ - "type":"string", - "description":"Cancel the task with specified task id (node_id:task_number)" - } - } - } - ] - }, - "params":{ - "nodes":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - }, - "actions":{ - "type":"list", - "description":"A comma-separated list of actions that should be cancelled. Leave empty to cancel all." - }, - "parent_task_id":{ - "type":"string", - "description":"Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.get.json b/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.get.json deleted file mode 100644 index 63bd1b6a96e98..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.get.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "tasks.get":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", - "description":"Returns information about a task." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_tasks/{task_id}", - "methods":[ - "GET" - ], - "parts":{ - "task_id":{ - "type":"string", - "description":"Return the task with specified id (node_id:task_number)" - } - } - } - ] - }, - "params":{ - "wait_for_completion":{ - "type":"boolean", - "description":"Wait for the matching tasks to complete (default: false)" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.list.json b/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.list.json deleted file mode 100644 index 0aba6d6391d48..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/tasks.list.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "tasks.list":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html", - "description":"Returns a list of tasks." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_tasks", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "nodes":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - }, - "actions":{ - "type":"list", - "description":"A comma-separated list of actions that should be returned. Leave empty to return all." - }, - "detailed":{ - "type":"boolean", - "description":"Return detailed task information (default: false)" - }, - "parent_task_id":{ - "type":"string", - "description":"Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all." - }, - "wait_for_completion":{ - "type":"boolean", - "description":"Wait for the matching tasks to complete (default: false)" - }, - "group_by":{ - "type":"enum", - "description":"Group tasks by nodes or parent/child relationships", - "options":[ - "nodes", - "parents", - "none" - ], - "default":"nodes" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/termvectors.json b/rest-api-spec/out/production/resources/rest-api-spec/api/termvectors.json deleted file mode 100644 index dd7fac97d79a7..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/termvectors.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "termvectors":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html", - "description":"Returns information and statistics about terms in the fields of a particular document." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_termvectors/{id}", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The index in which the document resides." - }, - "id":{ - "type":"string", - "description":"The id of the document, when not specified a doc param should be supplied." - } - } - }, - { - "path":"/{index}/_termvectors", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The index in which the document resides." - } - } - }, - { - "path" : "/{index}/{type}/{id}/_termvectors", - "methods" : ["GET", "POST"], - "parts" : { - "index" : { - "type" : "string", - "description" : "The index in which the document resides.", - "required" : true - }, - "type" : { - "type" : "string", - "description" : "The type of the document.", - "required" : false - }, - "id" : { - "type" : "string", - "description" : "The id of the document, when not specified a doc param should be supplied." - } - }, - "deprecated": { - "version" : "7.0.0", - "description" : "Specifying types in urls has been deprecated" - } - }, - { - "path" : "/{index}/{type}/_termvectors", - "methods" : ["GET", "POST"], - "parts" : { - "index" : { - "type" : "string", - "description" : "The index in which the document resides.", - "required" : true - }, - "type" : { - "type" : "string", - "description" : "The type of the document.", - "required" : false - } - }, - "deprecated": { - "version" : "7.0.0", - "description" : "Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "term_statistics":{ - "type":"boolean", - "description":"Specifies if total term frequency and document frequency should be returned.", - "default":false - }, - "field_statistics":{ - "type":"boolean", - "description":"Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.", - "default":true - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields to return." - }, - "offsets":{ - "type":"boolean", - "description":"Specifies if term offsets should be returned.", - "default":true - }, - "positions":{ - "type":"boolean", - "description":"Specifies if term positions should be returned.", - "default":true - }, - "payloads":{ - "type":"boolean", - "description":"Specifies if term payloads should be returned.", - "default":true - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)." - }, - "routing":{ - "type":"string", - "description":"Specific routing value." - }, - "realtime":{ - "type":"boolean", - "description":"Specifies if request is real-time as opposed to near-real-time (default: true)." - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte", - "force" - ], - "description":"Specific version type" - } - }, - "body":{ - "description":"Define parameters and or supply a document to get termvectors for. See documentation.", - "required":false - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/update.json b/rest-api-spec/out/production/resources/rest-api-spec/api/update.json deleted file mode 100644 index 45b6f764387eb..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/update.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "update":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html", - "description":"Updates a document with a script or partial document." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_update/{id}", - "methods":[ - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - }, - { - "path":"/{index}/{type}/{id}/_update", - "methods":[ - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - }, - "lang":{ - "type":"string", - "description":"The script language (default: painless)" - }, - "refresh":{ - "type":"enum", - "options":[ - "true", - "false", - "wait_for" - ], - "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." - }, - "retry_on_conflict":{ - "type":"number", - "description":"Specify how many times should the operation be retried when a conflict occurs (default: 0)" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "if_seq_no":{ - "type":"number", - "description":"only perform the update operation if the last operation that has changed the document has the specified sequence number" - }, - "if_primary_term":{ - "type":"number", - "description":"only perform the update operation if the last operation that has changed the document has the specified primary term" - } - }, - "body":{ - "description":"The request definition requires either `script` or partial `doc`", - "required":true - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query.json b/rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query.json deleted file mode 100644 index eb4c7ea258b3b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "update_by_query":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html", - "description":"Performs an update on every document in the index without changing the source,\nfor example to pick up a mapping change." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_update_by_query", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - } - } - }, - { - "path" : "/{index}/{type}/_update_by_query", - "methods": ["POST"], - "parts": { - "index": { - "required": true, - "type": "list", - "description": "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - }, - "type": { - "type": "list", - "description": "A comma-separated list of document types to search; leave empty to perform the operation on all types" - } - }, - "deprecated" : { - "version" : "7.0.0", - "description" : "Specifying types in urls has been deprecated" - } - } - ] - }, - "params":{ - "analyzer":{ - "type":"string", - "description":"The analyzer to use for the query string" - }, - "analyze_wildcard":{ - "type":"boolean", - "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" - }, - "default_operator":{ - "type":"enum", - "options":[ - "AND", - "OR" - ], - "default":"OR", - "description":"The default operator for query string query (AND or OR)" - }, - "df":{ - "type":"string", - "description":"The field to use as default where no field prefix is given in the query string" - }, - "from":{ - "type":"number", - "description":"Starting offset (default: 0)" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "conflicts":{ - "note":"This is not copied from search", - "type":"enum", - "options":[ - "abort", - "proceed" - ], - "default":"abort", - "description":"What to do when the update by query hits version conflicts?" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "lenient":{ - "type":"boolean", - "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "pipeline":{ - "type":"string", - "description":"Ingest pipeline to set on index requests made by this action. (default: none)" - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "q":{ - "type":"string", - "description":"Query in the Lucene query string syntax" - }, - "routing":{ - "type":"list", - "description":"A comma-separated list of specific routing values" - }, - "scroll":{ - "type":"time", - "description":"Specify how long a consistent view of the index should be maintained for scrolled search" - }, - "search_type":{ - "type":"enum", - "options":[ - "query_then_fetch", - "dfs_query_then_fetch" - ], - "description":"Search operation type" - }, - "search_timeout":{ - "type":"time", - "description":"Explicit timeout for each search request. Defaults to no timeout." - }, - "size": { - "type" : "number", - "description" : "Deprecated, please use `max_docs` instead" - }, - "max_docs":{ - "type":"number", - "description":"Maximum number of documents to process (default: all documents)" - }, - "sort":{ - "type":"list", - "description":"A comma-separated list of : pairs" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - }, - "terminate_after":{ - "type":"number", - "description":"The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." - }, - "stats":{ - "type":"list", - "description":"Specific 'tag' of the request for logging and statistical purposes" - }, - "version":{ - "type":"boolean", - "description":"Specify whether to return document version as part of a hit" - }, - "version_type":{ - "type":"boolean", - "description":"Should the document increment the version number (internal) on hit or not (reindex)" - }, - "request_cache":{ - "type":"boolean", - "description":"Specify if request cache should be used for this request or not, defaults to index level setting" - }, - "refresh":{ - "type":"boolean", - "description":"Should the affected indexes be refreshed?" - }, - "timeout":{ - "type":"time", - "default":"1m", - "description":"Time each individual bulk request should wait for shards that are unavailable." - }, - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "scroll_size":{ - "type":"number", - "defaut_value":100, - "description":"Size on the scroll request powering the update by query" - }, - "wait_for_completion":{ - "type":"boolean", - "default":true, - "description":"Should the request should block until the update by query operation is complete." - }, - "requests_per_second":{ - "type":"number", - "default":0, - "description":"The throttle to set on this request in sub-requests per second. -1 means no throttle." - }, - "slices":{ - "type":"number|string", - "default":1, - "description":"The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`." - } - }, - "body":{ - "description":"The search definition using the Query DSL" - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query_rethrottle.json b/rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query_rethrottle.json deleted file mode 100644 index bd70f6e1231c9..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/api/update_by_query_rethrottle.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "update_by_query_rethrottle":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html", - "description":"Changes the number of requests per second for a particular Update By Query operation." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_update_by_query/{task_id}/_rethrottle", - "methods":[ - "POST" - ], - "parts":{ - "task_id":{ - "type":"string", - "description":"The task id to rethrottle" - } - } - } - ] - }, - "params":{ - "requests_per_second":{ - "type":"number", - "required":true, - "description":"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." - } - } - } -} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/README.asciidoc b/rest-api-spec/out/production/resources/rest-api-spec/test/README.asciidoc deleted file mode 100644 index 920fedd3e7414..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/README.asciidoc +++ /dev/null @@ -1,387 +0,0 @@ -Test Suite: -=========== - -[NOTE] -.Required settings -======================================= -Certain tests require specific settings to be applied to the -Elasticsearch instance in order to pass. You should run -Elasticsearch as follows: - -[source,sh] ---------------------- -bin/elasticsearch -Enode.attr.testattr=test -Epath.repo=/tmp -Erepositories.url.allowed_urls='http://snapshot.*' ---------------------- - -======================================= - -Test file structure --------------------- - -A YAML test file consists of: - -- an optional `setup` section, followed by -- an optional `teardown` section, followed by -- one or more test sections - -For instance: - - setup: - - do: .... - - do: .... - - --- - teardown: - - do: .... - - --- - "First test": - - do: ... - - match: ... - - --- - "Second test": - - do: ... - - match: ... - - -A `setup` section contains a list of commands to run before each test -section in order to setup the same environment for each test section. - -A `teardown` section contains a list of commands to run after each test -section in order to setup the same environment for each test section. This -may be needed for modifications made by the test that are not cleared by the -deletion of indices and templates. - -A test section represents an independent test, containing multiple `do` -statements and assertions. The contents of a test section must be run in -order, but individual test sections may be run in any order, as follows: - -1. run `setup` (if any) -2. reset the `response` var and the `stash` (see below) -2. run test contents -3. run `teardown` (if any) -4. delete all indices and all templates - -Dot notation: -------------- -Dot notation is used for (1) method calls and (2) hierarchical data structures. For -instance, a method call like `cluster.health` would do the equivalent of: - - client.cluster.health(...params...) - -A test against `_tokens.1.token` would examine the `token` key, in the second element -of the `tokens` array, inside the `response` var (see below): - - $val = $response->{tokens}[1]{token} # Perl syntax roolz! - -If one of the levels (eg `tokens`) does not exist, it should return an undefined value. -If no field name is given (ie the empty string) then return the current -$val -- used for testing the whole response body. - -Use \. to specify paths that actually contain '.' in the key name, for example -in the `indices.get_settings` API. - -Skipping tests: ---------------- -If a test section should only be run on certain versions of Elasticsearch, -then the first entry in the section (after the title) should be called -`skip`, and should contain the range of versions to be -skipped, and the reason why the tests are skipped. For instance: - -.... - "Parent": - - skip: - version: "0.20.1 - 0.90.2" - reason: Delete ignores the parent param - - - do: - ... test definitions ... -.... - -All tests in the file following the skip statement should be skipped if: -`min <= current <= max`. - -The `version` range can leave either bound empty, which means "open ended". -For instance: -.... - "Parent": - - skip: - version: "1.0.0.Beta1 - " - reason: Delete ignores the parent param - - - do: - ... test definitions ... -.... - -The skip section can also be used to list new features that need to be -supported in order to run a test. This way the up-to-date runners will -run the test, while the ones that don't support the feature yet can -temporarily skip it, and avoid having lots of test failures in the meantime. -Once all runners have implemented the feature, it can be declared supported -by default, thus the related skip sections can be removed from the tests. - -.... - "Parent": - - skip: - features: regex - - - do: - ... test definitions ... -.... - -The `features` field can either be a string or an array of strings. -The skip section requires to specify either a `version` or a `features` list. - -Required operators: -------------------- - -=== `do` - -The `do` operator calls a method on the client. For instance: - -.... - - do: - cluster.health: - level: shards -.... - -The response from the `do` operator should be stored in the `response` var, which -is reset (1) at the beginning of a file or (2) on the next `do`. - -If the arguments to `do` include `catch`, then we are expecting an error, which should -be caught and tested. For instance: - -.... - - do: - catch: missing - get: - index: test - type: test - id: 1 -.... - -The argument to `catch` can be any of: - -[horizontal] -`bad_request`:: a 400 response from ES -`unauthorized`:: a 401 response from ES -`forbidden`:: a 403 response from ES -`missing`:: a 404 response from ES -`request_timeout`:: a 408 response from ES -`conflict`:: a 409 response from ES -`request`:: a 4xx-5xx error response from ES, not equal to any named response - above -`unavailable`:: a 503 response from ES -`param`:: a client-side error indicating an unknown parameter has been passed - to the method -`/foo bar/`:: the text of the error message matches this regular expression - -If `catch` is specified, then the `response` var must be cleared, and the test -should fail if no error is thrown. - -If the arguments to `do` include `warnings` then we are expecting a `Warning` -header to come back from the request. If the arguments *don't* include a -`warnings` argument then we *don't* expect the response to include a `Warning` -header. The warnings must match exactly. Using it looks like this: - -.... - - do: - warnings: - - '[index] is deprecated' - - quotes are not required because yaml - - but this argument is always a list, never a single string - - no matter how many warnings you expect - get: - index: test - type: test - id: 1 -.... - -If the arguments to `do` include `allowed_warnings` then matching `Warning` -headers do not fail the request. Unlike the `warnings` argument, these aren't -expected so much as "allowed". This usually comes up in backwards compatibility -testing. Using it looks like this: - -.... - - do: - allowed_warnings: - - some warning - - this argument is also always a list, never a single string - - no matter how many warnings you expect - get: - index: test - type: test - id: 1 -.... - -If the arguments to `do` include `node_selector` then the request is only -sent to nodes that match the `node_selector`. It looks like this: - -.... -"test id": - - skip: - features: node_selector - - do: - node_selector: - version: " - 6.9.99" - index: - index: test-weird-index-中文 - type: weird.type - id: 1 - body: { foo: bar } -.... - -If you list multiple selectors then the request will only go to nodes that -match all of those selectors. The following selectors are supported: - -- `version`: Only nodes who's version is within the range will receive the -request. The syntax for the pattern is the same as when `version` is within -`skip`. -- `attribute`: Only nodes that have an attribute matching the name and value -of the provided attribute match. -Looks like: -.... - node_selector: - attribute: - name: value -.... - -=== `set` - -For some tests, it is necessary to extract a value from the previous `response`, in -order to reuse it in a subsequent `do` and other tests. For instance, when -testing indexing a document without a specified ID: - -.... - - do: - index: - index: test - type: test - - set: { _id: id } # stash the value of `response._id` as `id` - - do: - get: - index: test - type: test - id: $id # replace `$id` with the stashed value - - match: { _id: $id } # the returned `response._id` matches the stashed `id` -.... - -The last response obtained gets always stashed automatically as a string, called `body`. -This is useful when needing to test apis that return text rather than json (e.g. cat api), -as it allows to treat the whole body as an ordinary string field. - -Stashed values can be used in property names, eg: - -.... - - do: - cluster.state: {} - - - set: {master_node: master} - - - do: - nodes.info: - metric: [ transport ] - - - is_true: nodes.$master.transport.profiles -.... - - -Note that not only expected values can be retrieved from the stashed values (as in the -example above), but the same goes for actual values: - -.... - - match: { $body: /^.+$/ } # the returned `body` matches the provided regex if the body is text - - match: { $body: {} } # the returned `body` matches the JSON object if the body is JSON -.... - -The stash should be reset at the beginning of each test file. - -=== `transform_and_set` - -For some tests, it is necessary to extract a value and transform it from the previous `response`, in -order to reuse it in a subsequent `do` and other tests. -Currently, it only has support for `base64EncodeCredentials`, for unknown transformations it will not -do anything and stash the value as is. -For instance, when testing you may want to base64 encode username and password for -`Basic` authorization header: - -.... - - do: - index: - index: test - type: test - - transform_and_set: { login_creds: "#base64EncodeCredentials(user,password)" } # stash the base64 encoded credentials of `response.user` and `response.password` as `login_creds` - - do: - headers: - Authorization: Basic ${login_creds} # replace `$login_creds` with the stashed value - get: - index: test - type: test -.... - -Stashed values can be used as described in the `set` section - -=== `is_true` - -The specified key exists and has a true value (ie not `0`, `false`, `undefined`, `null` -or the empty string), eg: - -.... - - is_true: fields.foo # the foo key exists in the fields hash and is "true" -.... - -=== `is_false` - -The specified key doesn't exist or has a false value (ie `0`, `false`, `undefined`, -`null` or the empty string), eg: - -.... - - is_false: fields._source # the _source key doesn't exist in the fields hash or is "false" -.... - -=== `match` - -Used to compare two variables (could be scalars, arrays or hashes). The two variables -should be identical, eg: - -.... - - match: { _source: { foo: bar }} -.... - -Supports also regular expressions with flag X for more readability (accepts whitespaces and comments): - -.... - - match: - $body: > - /^ epoch \s+ timestamp \s+ count \s+ \n - \d+ \s+ \d{2}:\d{2}:\d{2} \s+ \d+ \s+ \n $/ -.... - -**Note:** `$body` is used to refer to the last obtained response body as a string, while `''` refers to the parsed representation (parsed into a Map by the Java runner for instance). Having the raw string response is for example useful when testing cat APIs. - -=== `lt` and `gt` - -Compares two numeric values, eg: - -.... - - lt: { foo: 10000 } # the `foo` value is less than 10,000 -.... - -=== `lte` and `gte` - -Compares two numeric values, eg: - -.... - - lte: { foo: 10000 } # the `foo` value is less than or equal to 10,000 -.... - -=== `length` - -This depends on the datatype of the value being examined, eg: - -.... - - length: { _id: 22 } # the `_id` string is 22 chars long - - length: { _tokens: 3 } # the `_tokens` array has 3 elements - - length: { _source: 5 } # the `_source` hash has 5 keys -.... diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/10_basic.yml deleted file mode 100644 index 95ee564d0c1a3..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/10_basic.yml +++ /dev/null @@ -1,124 +0,0 @@ ---- -"Array of objects": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - bulk: - refresh: true - body: - - index: - _index: test_index - _id: test_id - - f1: v1 - f2: 42 - - index: - _index: test_index - _id: test_id2 - - f1: v2 - f2: 47 - - - do: - count: - index: test_index - - - match: {count: 2} - ---- -"Empty _id": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - bulk: - refresh: true - body: - - index: - _index: test - _id: '' - - f: 1 - - index: - _index: test - _id: id - - f: 2 - - index: - _index: test - - f: 3 - - match: { errors: true } - - match: { items.0.index.status: 400 } - - match: { items.0.index.error.type: illegal_argument_exception } - - match: { items.0.index.error.reason: if _id is specified it must not be empty } - - match: { items.1.index.result: created } - - match: { items.2.index.result: created } - - - do: - count: - index: test - - - match: { count: 2 } - ---- -"Empty _id with op_type create": - - skip: - version: " - 7.4.99" - reason: "auto id + op type create only supported since 7.5" - - - do: - bulk: - refresh: true - body: - - index: - _index: test - _id: '' - - f: 1 - - index: - _index: test - _id: id - - f: 2 - - index: - _index: test - - f: 3 - - create: - _index: test - - f: 4 - - index: - _index: test - op_type: create - - f: 5 - - match: { errors: true } - - match: { items.0.index.status: 400 } - - match: { items.0.index.error.type: illegal_argument_exception } - - match: { items.0.index.error.reason: if _id is specified it must not be empty } - - match: { items.1.index.result: created } - - match: { items.2.index.result: created } - - match: { items.3.create.result: created } - - match: { items.4.create.result: created } - - - do: - count: - index: test - - - match: { count: 4 } - - ---- -"empty action": - - - skip: - version: " - 6.99.99" - features: headers - reason: types are required in requests before 7.0.0 - - - do: - catch: /Malformed action\/metadata line \[3\], expected FIELD_NAME but found \[END_OBJECT\]/ - headers: - Content-Type: application/json - bulk: - body: | - {"index": {"_index": "test_index", "_id": "test_id"}} - {"f1": "v1", "f2": 42} - {} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/11_basic_with_types.yml deleted file mode 100644 index 6bebed7bc1dd0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/11_basic_with_types.yml +++ /dev/null @@ -1,120 +0,0 @@ ---- -"Array of objects": - - do: - bulk: - refresh: true - body: - - index: - _index: test_index - _type: test_type - _id: test_id - - f1: v1 - f2: 42 - - index: - _index: test_index - _type: test_type - _id: test_id2 - - f1: v2 - f2: 47 - - - do: - count: - index: test_index - - - match: {count: 2} - ---- -"Empty _id": - - do: - bulk: - refresh: true - body: - - index: - _index: test - _type: type - _id: '' - - f: 1 - - index: - _index: test - _type: type - _id: id - - f: 2 - - index: - _index: test - _type: type - - f: 3 - - match: { errors: true } - - match: { items.0.index.status: 400 } - - match: { items.0.index.error.type: illegal_argument_exception } - - match: { items.0.index.error.reason: if _id is specified it must not be empty } - - match: { items.1.index.result: created } - - match: { items.2.index.result: created } - - - do: - count: - index: test - - - match: { count: 2 } - ---- -"Empty _id with op_type create": - - skip: - version: " - 7.4.99" - reason: "auto id + op type create only supported since 7.5" - - - do: - bulk: - refresh: true - body: - - index: - _index: test - _type: type - _id: '' - - f: 1 - - index: - _index: test - _type: type - _id: id - - f: 2 - - index: - _index: test - _type: type - - f: 3 - - create: - _index: test - _type: type - - f: 4 - - index: - _index: test - _type: type - op_type: create - - f: 5 - - match: { errors: true } - - match: { items.0.index.status: 400 } - - match: { items.0.index.error.type: illegal_argument_exception } - - match: { items.0.index.error.reason: if _id is specified it must not be empty } - - match: { items.1.index.result: created } - - match: { items.2.index.result: created } - - match: { items.3.create.result: created } - - match: { items.4.create.result: created } - - - do: - count: - index: test - - - match: { count: 4 } - ---- -"empty action": - - skip: - features: headers - - - do: - catch: /Malformed action\/metadata line \[3\], expected FIELD_NAME but found \[END_OBJECT\]/ - headers: - Content-Type: application/json - bulk: - body: | - {"index": {"_index": "test_index", "_type": "test_type", "_id": "test_id"}} - {"f1": "v1", "f2": 42} - {} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/20_list_of_strings.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/20_list_of_strings.yml deleted file mode 100644 index b23517f6a8f25..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/20_list_of_strings.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -"List of strings": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - bulk: - refresh: true - body: - - '{"index": {"_index": "test_index", "_id": "test_id"}}' - - '{"f1": "v1", "f2": 42}' - - '{"index": {"_index": "test_index", "_id": "test_id2"}}' - - '{"f1": "v2", "f2": 47}' - - - do: - count: - index: test_index - - - match: {count: 2} - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/21_list_of_strings_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/21_list_of_strings_with_types.yml deleted file mode 100644 index def91f4280722..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/21_list_of_strings_with_types.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -"List of strings": - - do: - bulk: - refresh: true - body: - - '{"index": {"_index": "test_index", "_type": "test_type", "_id": "test_id"}}' - - '{"f1": "v1", "f2": 42}' - - '{"index": {"_index": "test_index", "_type": "test_type", "_id": "test_id2"}}' - - '{"f1": "v2", "f2": 47}' - - - do: - count: - index: test_index - - - match: {count: 2} - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/30_big_string.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/30_big_string.yml deleted file mode 100644 index 38706d133e44b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/30_big_string.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -"One big string": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - bulk: - refresh: true - body: | - {"index": {"_index": "test_index", "_id": "test_id"}} - {"f1": "v1", "f2": 42} - {"index": {"_index": "test_index", "_id": "test_id2"}} - {"f1": "v2", "f2": 47} - - - do: - count: - index: test_index - - - match: {count: 2} - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/31_big_string_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/31_big_string_with_types.yml deleted file mode 100644 index 1d117253c9b01..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/31_big_string_with_types.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -"One big string": - - do: - bulk: - refresh: true - body: | - {"index": {"_index": "test_index", "_type": "test_type", "_id": "test_id"}} - {"f1": "v1", "f2": 42} - {"index": {"_index": "test_index", "_type": "test_type", "_id": "test_id2"}} - {"f1": "v2", "f2": 47} - - - do: - count: - index: test_index - - - match: {count: 2} - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/40_source.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/40_source.yml deleted file mode 100644 index 5e783d60d3d46..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/40_source.yml +++ /dev/null @@ -1,75 +0,0 @@ ---- -"Source filtering": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - index: - refresh: true - index: test_index - id: test_id_1 - body: { "foo": "bar", "bar": "foo" } - - - do: - index: - refresh: true - index: test_index - id: test_id_2 - body: { "foo": "qux", "bar": "pux" } - - - do: - index: - refresh: true - index: test_index - id: test_id_3 - body: { "foo": "corge", "bar": "forge" } - - - - do: - bulk: - refresh: true - body: | - { "update": { "_index": "test_index", "_id": "test_id_1", "_source": true } } - { "doc": { "foo": "baz" } } - { "update": { "_index": "test_index", "_id": "test_id_2" } } - { "_source": true, "doc": { "foo": "quux" } } - - - match: { items.0.update.get._source.foo: baz } - - match: { items.1.update.get._source.foo: quux } - - - do: - bulk: - index: test_index - _source: true - body: | - { "update": { "_id": "test_id_3" } } - { "doc": { "foo": "garply" } } - - - match: { items.0.update.get._source.foo: garply } - - - do: - bulk: - refresh: true - body: | - { "update": { "_index": "test_index", "_id": "test_id_1", "_source": {"includes": "bar"} } } - { "doc": { "foo": "baz" } } - { "update": { "_index": "test_index", "_id": "test_id_2" } } - { "_source": {"includes": "foo"}, "doc": { "foo": "quux" } } - - - match: { items.0.update.get._source.bar: foo } - - is_false: items.0.update.get._source.foo - - match: { items.1.update.get._source.foo: quux } - - is_false: items.1.update.get._source.bar - - - do: - bulk: - index: test_index - _source_includes: foo - body: | - { "update": { "_id": "test_id_3" } } - { "doc": { "foo": "garply" } } - - - match: { items.0.update.get._source.foo: garply } - - is_false: items.0.update.get._source.bar - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/41_source_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/41_source_with_types.yml deleted file mode 100644 index 3c8a86c13bdac..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/41_source_with_types.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- -"Source filtering": - - do: - index: - refresh: true - index: test_index - type: test_type - id: test_id_1 - body: { "foo": "bar", "bar": "foo" } - - - do: - index: - refresh: true - index: test_index - type: test_type - id: test_id_2 - body: { "foo": "qux", "bar": "pux" } - - - do: - index: - refresh: true - index: test_index - type: test_type - id: test_id_3 - body: { "foo": "corge", "bar": "forge" } - - - - do: - bulk: - refresh: true - body: | - { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_1", "_source": true } } - { "doc": { "foo": "baz" } } - { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_2" } } - { "_source": true, "doc": { "foo": "quux" } } - - - match: { items.0.update.get._source.foo: baz } - - match: { items.1.update.get._source.foo: quux } - - - do: - bulk: - index: test_index - type: test_type - _source: true - body: | - { "update": { "_id": "test_id_3" } } - { "doc": { "foo": "garply" } } - - - match: { items.0.update.get._source.foo: garply } - - - do: - bulk: - refresh: true - body: | - { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_1", "_source": {"includes": "bar"} } } - { "doc": { "foo": "baz" } } - { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_2" } } - { "_source": {"includes": "foo"}, "doc": { "foo": "quux" } } - - - match: { items.0.update.get._source.bar: foo } - - is_false: items.0.update.get._source.foo - - match: { items.1.update.get._source.foo: quux } - - is_false: items.1.update.get._source.bar - - - do: - bulk: - index: test_index - type: test_type - _source_includes: foo - body: | - { "update": { "_id": "test_id_3" } } - { "doc": { "foo": "garply" } } - - - match: { items.0.update.get._source.foo: garply } - - is_false: items.0.update.get._source.bar - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/50_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/50_refresh.yml deleted file mode 100644 index 77098779c0c4f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/50_refresh.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -"refresh=true immediately makes changes are visible in search": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - bulk: - refresh: true - body: | - {"index": {"_index": "bulk_50_refresh_1", "_id": "bulk_50_refresh_id1"}} - {"f1": "v1", "f2": 42} - {"index": {"_index": "bulk_50_refresh_1", "_id": "bulk_50_refresh_id2"}} - {"f1": "v2", "f2": 47} - - - do: - count: - index: bulk_50_refresh_1 - - match: {count: 2} - ---- -"refresh=empty string immediately makes changes are visible in search": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - bulk: - refresh: "" - body: | - {"index": {"_index": "bulk_50_refresh_2", "_id": "bulk_50_refresh_id3"}} - {"f1": "v1", "f2": 42} - {"index": {"_index": "bulk_50_refresh_2", "_id": "bulk_50_refresh_id4"}} - {"f1": "v2", "f2": 47} - - - do: - count: - index: bulk_50_refresh_2 - - match: {count: 2} - - ---- -"refresh=wait_for waits until changes are visible in search": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - bulk: - refresh: wait_for - body: | - {"index": {"_index": "bulk_50_refresh_3", "_id": "bulk_50_refresh_id5"}} - {"f1": "v1", "f2": 42} - {"index": {"_index": "bulk_50_refresh_3", "_id": "bulk_50_refresh_id6"}} - {"f1": "v2", "f2": 47} - - - do: - count: - index: bulk_50_refresh_3 - - match: {count: 2} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/51_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/51_refresh_with_types.yml deleted file mode 100644 index 6326b9464caa0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/51_refresh_with_types.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -"refresh=true immediately makes changes are visible in search": - - do: - bulk: - refresh: true - body: | - {"index": {"_index": "bulk_50_refresh_1", "_type": "test_type", "_id": "bulk_50_refresh_id1"}} - {"f1": "v1", "f2": 42} - {"index": {"_index": "bulk_50_refresh_1", "_type": "test_type", "_id": "bulk_50_refresh_id2"}} - {"f1": "v2", "f2": 47} - - - do: - count: - index: bulk_50_refresh_1 - - match: {count: 2} - ---- -"refresh=empty string immediately makes changes are visible in search": - - do: - bulk: - refresh: "" - body: | - {"index": {"_index": "bulk_50_refresh_2", "_type": "test_type", "_id": "bulk_50_refresh_id3"}} - {"f1": "v1", "f2": 42} - {"index": {"_index": "bulk_50_refresh_2", "_type": "test_type", "_id": "bulk_50_refresh_id4"}} - {"f1": "v2", "f2": 47} - - - do: - count: - index: bulk_50_refresh_2 - - match: {count: 2} - - ---- -"refresh=wait_for waits until changes are visible in search": - - do: - bulk: - refresh: wait_for - body: | - {"index": {"_index": "bulk_50_refresh_3", "_type": "test_type", "_id": "bulk_50_refresh_id5"}} - {"f1": "v1", "f2": 42} - {"index": {"_index": "bulk_50_refresh_3", "_type": "test_type", "_id": "bulk_50_refresh_id6"}} - {"f1": "v2", "f2": 47} - - - do: - count: - index: bulk_50_refresh_3 - - match: {count: 2} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/60_deprecated.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/60_deprecated.yml deleted file mode 100644 index 1401fcc086208..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/60_deprecated.yml +++ /dev/null @@ -1,26 +0,0 @@ - ---- -"Deprecated parameters should fail in Bulk query": - - - skip: - version: " - 6.99.99" - reason: some parameters are removed starting from 7.0, their equivalents without underscore are used instead - features: "warnings" - - - do: - catch: bad_request - bulk: - body: | - { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_1", "_version": 1 } } - { "doc": { "f1": "v1" } } - { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_2", "_version": 1 } } - { "doc": { "f1": "v2" } } - - - do: - catch: bad_request - bulk: - body: | - { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_1", "_routing": "test1" } } - { "doc": { "f1": "v1" } } - { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_2", "_routing": "test1" } } - { "doc": { "f1": "v2" } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/70_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/70_mix_typeless_typeful.yml deleted file mode 100644 index cad0891b21e52..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/70_mix_typeless_typeful.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -"bulk without types on an index that has types": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - do: - bulk: - refresh: true - body: - - index: - _index: index - _id: 0 - - foo: bar - - index: - _index: index - _id: 1 - - foo: bar - - - do: - count: - index: index - - - match: {count: 2} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/80_cas.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/80_cas.yml deleted file mode 100644 index 902621cfba578..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/80_cas.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -"Compare And Swap Sequence Numbers": - - - skip: - version: " - 6.99.99" - reason: typeless API are add in 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - match: { _version: 1} - - set: { _seq_no: seqno } - - set: { _primary_term: primary_term } - - - do: - bulk: - body: - - index: - _index: test_1 - _id: 1 - if_seq_no: 10000 - if_primary_term: $primary_term - - foo: bar2 - - - match: { errors: true } - - match: { items.0.index.status: 409 } - - match: { items.0.index.error.type: version_conflict_engine_exception } - - - do: - bulk: - body: - - index: - _index: test_1 - _id: 1 - if_seq_no: $seqno - if_primary_term: $primary_term - - foo: bar2 - - - match: { errors: false} - - match: { items.0.index.status: 200 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/81_cas_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/81_cas_with_types.yml deleted file mode 100644 index 101316e7bf504..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/bulk/81_cas_with_types.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -"Compare And Swap Sequence Numbers": - - - skip: - version: " - 6.6.99" - reason: cas operations with sequence numbers was added in 6.7 - - - do: - index: - index: test_1 - type: _doc - id: 1 - body: { foo: bar } - - match: { _version: 1} - - set: { _seq_no: seqno } - - set: { _primary_term: primary_term } - - - do: - bulk: - body: - - index: - _index: test_1 - _type: _doc - _id: 1 - if_seq_no: 10000 - if_primary_term: $primary_term - - foo: bar2 - - - match: { errors: true } - - match: { items.0.index.status: 409 } - - match: { items.0.index.error.type: version_conflict_engine_exception } - - - do: - bulk: - body: - - index: - _index: test_1 - _type: _doc - _id: 1 - if_seq_no: $seqno - if_primary_term: $primary_term - - foo: bar2 - - - match: { errors: false} - - match: { items.0.index.status: 200 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/10_basic.yml deleted file mode 100644 index 5669206ee87ad..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/10_basic.yml +++ /dev/null @@ -1,489 +0,0 @@ - ---- -"Help": - - skip: - version: " - 7.3.99" - reason: "is_write_index is shown in cat.aliases starting version 7.4.0" - - - do: - cat.aliases: - help: true - - - match: - $body: | - /^ alias .+ \n - index .+ \n - filter .+ \n - routing.index .+ \n - routing.search .+ \n - is_write_index .+ \n - $/ - ---- -"Help (pre 7.4.0)": - - skip: - version: "7.4.0 - " - features: node_selector - reason: "is_write_index is shown in cat.aliases starting version 7.4.0" - - - do: - node_selector: - version: " - 7.3.99" - cat.aliases: - help: true - - - match: - $body: | - /^ alias .+ \n - index .+ \n - filter .+ \n - routing.index .+ \n - routing.search .+ \n - $/ - ---- -"Empty cluster": - - - do: - cat.aliases: {} - - - match: - $body: | - /^ - $/ - ---- -"Simple alias": - - skip: - version: " - 7.3.99" - reason: "is_write_index is shown in cat.aliases starting version 7.4.0" - - - do: - indices.create: - index: test - - - do: - indices.put_alias: - index: test - name: test_alias - - - do: - cat.aliases: {} - - - match: - $body: | - /^ - test_alias \s+ - test \s+ - - \s+ - - \s+ - - \s+ - - \s+ - $/ - ---- -"Simple alias (pre 7.4.0)": - - skip: - version: "7.4.0 - " - features: node_selector - reason: "is_write_index is shown in cat.aliases starting version 7.4.0" - - - do: - indices.create: - index: test - - - do: - indices.put_alias: - index: test - name: test_alias - - - do: - node_selector: - version: " - 7.3.99" - cat.aliases: {} - - - match: - $body: | - /^ - test_alias \s+ - test \s+ - - \s+ - - \s+ - - \s+ - $/ - ---- -"Complex alias": - - skip: - version: " - 7.3.99" - reason: "is_write_index is shown in cat.aliases starting version 7.4.0" - - - do: - indices.create: - index: test - body: - mappings: - properties: - foo: - type: text - - - do: - indices.put_alias: - index: test - name: test_alias - body: - index_routing: ir - search_routing: "sr1,sr2" - is_write_index: true - filter: - term: - foo: bar - - do: - cat.aliases: {} - - - match: - $body: | - /^ - test_alias \s+ - test \s+ - [*] \s+ - ir \s+ - sr1,sr2 \s+ - true \s+ - $/ - ---- -"Complex alias (pre 7.4.0)": - - skip: - version: "7.4.0 - " - features: node_selector - reason: "is_write_index is shown in cat.aliases starting version 7.4.0" - - - do: - indices.create: - index: test - body: - mappings: - properties: - foo: - type: text - - - do: - indices.put_alias: - index: test - name: test_alias - body: - index_routing: ir - search_routing: "sr1,sr2" - filter: - term: - foo: bar - - do: - node_selector: - version: " - 7.3.99" - cat.aliases: {} - - - match: - $body: | - /^ - test_alias \s+ - test \s+ - [*] \s+ - ir \s+ - sr1,sr2 \s+ - $/ - ---- -"Alias name": - - - do: - indices.create: - index: test - - - do: - indices.put_alias: - index: test - name: test_1 - - - do: - indices.put_alias: - index: test - name: test_2 - - - do: - cat.aliases: - name: test_1 - - - match: - $body: /^test_1 .+ \n$/ - - - do: - cat.aliases: - name: test_2 - - - match: - $body: /^test_2 .+ \n$/ - - - do: - cat.aliases: - name: test_* - - - match: - $body: / (^|\n)test_1 .+ \n/ - - - match: - $body: / (^|\n)test_2 .+ \n/ - ---- -"Multiple alias names": - - - do: - indices.create: - index: test - - - do: - indices.create: - index: test2 - - do: - indices.create: - index: test3 - - - do: - indices.put_alias: - index: test - name: foo - - - do: - indices.put_alias: - index: test2 - name: bar - - do: - indices.put_alias: - index: test3 - name: baz - - - do: - cat.aliases: - name: foo,bar - v: true - h: [alias, index] - s: [index] - - - match: - $body: | - /^ alias \s+ index \n - foo \s+ test \n - bar \s+ test2 - $/ - ---- -"Column headers": - - skip: - version: " - 7.3.99" - reason: "is_write_index is shown in cat.aliases starting version 7.4.0" - - - do: - indices.create: - index: test - - - do: - indices.put_alias: - index: test - name: test_1 - - - do: - cat.aliases: - v: true - - - match: - $body: | - /^ alias \s+ - index \s+ - filter \s+ - routing.index \s+ - routing.search \s+ - is_write_index - \n - test_1 \s+ - test \s+ - - \s+ - - \s+ - - \s+ - - \s+ - $/ - ---- -"Column headers (pre 7.4.0)": - - skip: - version: "7.4.0 - " - features: node_selector - reason: "is_write_index is shown in cat.aliases starting version 7.4.0" - - - do: - indices.create: - index: test - - - do: - indices.put_alias: - index: test - name: test_1 - - - do: - node_selector: - version: " - 7.3.99" - cat.aliases: - v: true - - - match: - $body: | - /^ alias \s+ - index \s+ - filter \s+ - routing.index \s+ - routing.search - \n - test_1 \s+ - test \s+ - - \s+ - - \s+ - - \s+ - $/ - ---- -"Select columns": - - - do: - indices.create: - index: test - - - do: - indices.put_alias: - index: test - name: test_1 - - - do: - cat.aliases: - h: [index, alias] - - - match: - $body: /^ test \s+ test_1 \s+ $/ - - - - do: - cat.aliases: - h: [index, alias] - v: true - - match: - $body: | - /^ - index \s+ alias \n - test \s+ test_1 \n - $/ - ---- -"Alias against closed index": - - skip: - version: " - 7.3.99" - reason: "is_write_index is shown in cat.aliases starting version 7.4.0" - - - do: - indices.create: - index: test_index - body: - aliases: - test_alias: {} - - - do: - indices.close: - index: test_index - - - do: - cat.aliases: {} - - - match: - $body: | - /^ - test_alias \s+ - test_index \s+ - - \s+ - - \s+ - - \s+ - - \s+ - $/ - ---- -"Alias against closed index (pre 7.4.0)": - - skip: - version: "7.4.0 - " - features: node_selector - reason: "is_write_index is shown in cat.aliases starting version 7.4.0" - - - do: - indices.create: - index: test_index - body: - aliases: - test_alias: {} - - - do: - indices.close: - index: test_index - - - do: - node_selector: - version: " - 7.3.99" - cat.aliases: {} - - - match: - $body: | - /^ - test_alias \s+ - test_index \s+ - - \s+ - - \s+ - - \s+ - $/ - ---- -"Alias sorting": - - - do: - indices.create: - index: test_index - body: - aliases: - test_alias: {} - my_alias: {} - - - do: - indices.create: - index: other_index - body: - aliases: - other_alias: {} - - - do: - cat.aliases: - h: [alias, index] - s: [index, alias] - - - match: - $body: | - /^ - other_alias \s+ other_index\n - my_alias \s+ test_index\n - test_alias \s+ test_index\n - $/ - - - do: - cat.aliases: - h: [alias, index] - s: [index, "a:desc"] - - - match: - $body: | - /^ - other_alias \s+ other_index\n - test_alias \s+ test_index\n - my_alias \s+ test_index\n - $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/20_headers.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/20_headers.yml deleted file mode 100644 index c5a806c5615c7..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/20_headers.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -"Simple alias with yaml body through Accept header": - - skip: - features: ["headers", "yaml"] - - - do: - indices.create: - index: test - - - do: - indices.put_alias: - index: test - name: test_alias - - - do: - cat.aliases: {} - headers: - Accept: application/yaml - - - match: {0.alias: test_alias} - - match: {0.index: test} - - match: {0.filter: "-"} - - match: {0.routing\.index: "-"} - - match: {0.routing\.search: "-"} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/30_json.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/30_json.yml deleted file mode 100644 index 178b77ce60dda..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/30_json.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -"Simple alias with json body through format argument": - - - do: - indices.create: - index: test - - - do: - indices.put_alias: - index: test - name: test_alias - - - do: - cat.aliases: - format: json - - - match: {0.alias: test_alias} - - match: {0.index: test} - - match: {0.filter: "-"} - - match: {0.routing\.index: "-"} - - match: {0.routing\.search: "-"} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/40_hidden.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/40_hidden.yml deleted file mode 100644 index 3aa7fdbb1f760..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.aliases/40_hidden.yml +++ /dev/null @@ -1,147 +0,0 @@ ---- -"Test cat aliases output with a hidden index with a hidden alias": - - skip: - version: "- 7.6.99" - reason: "hidden indices and aliases were added in 7.7.0" - - - do: - indices.create: - index: test - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - index: - hidden: true - aliases: - test_alias: - is_hidden: true - - - do: - cat.aliases: {} - - - match: - $body: | - /^ - test_alias \s+ - test \s+ - - \s+ - - \s+ - - \s+ - - \s+ - $/ - - - do: - cat.aliases: - name: test_alias - - - match: - $body: | - /^ - test_alias \s+ - test \s+ - - \s+ - - \s+ - - \s+ - - \s+ - $/ - - - - do: - cat.aliases: - expand_wildcards: ["open","closed"] - - - match: - $body: | - /^ - $/ ---- -"Test cat aliases output with a hidden index with a visible alias": - - skip: - version: "- 7.6.99" - reason: "hidden indices and aliases were added in 7.7.0" - - - do: - indices.create: - index: test - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - index: - hidden: true - aliases: - test_alias: {} - - do: - cat.aliases: {} - - - match: - $body: | - /^ - test_alias \s+ - test \s+ - - \s+ - - \s+ - - \s+ - - \s+ - $/ - - - do: - cat.aliases: - name: test_alias - - - match: - $body: | - /^ - test_alias \s+ - test \s+ - - \s+ - - \s+ - - \s+ - - \s+ - $/ - ---- -"Test cat aliases output with a visible index with a hidden alias": - - skip: - version: "- 7.6.99" - reason: "hidden indices and aliases were added in 7.7.0" - - - do: - indices.create: - index: test - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - aliases: - test_alias: - is_hidden: true - - do: - cat.aliases: {} - - - match: - $body: | - /^ - test_alias \s+ - test \s+ - - \s+ - - \s+ - - \s+ - - \s+ - $/ - - - do: - cat.aliases: - name: test_alias - - - match: - $body: | - /^ - test_alias \s+ - test \s+ - - \s+ - - \s+ - - \s+ - - \s+ - $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.allocation/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.allocation/10_basic.yml deleted file mode 100644 index 73e35972aecaa..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.allocation/10_basic.yml +++ /dev/null @@ -1,230 +0,0 @@ ---- -"Help": - - do: - cat.allocation: - help: true - - - match: - $body: | - /^ shards .+ \n - disk.indices .+ \n - disk.used .+ \n - disk.avail .+ \n - disk.total .+ \n - disk.percent .+ \n - host .+ \n - ip .+ \n - node .+ \n - $/ - ---- -"Empty cluster": - - - do: - cat.allocation: {} - - - match: - $body: | - /^ - ( 0 \s+ - 0b \s+ - \d+(\.\d+)?[kmgt]?b \s+ - (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes - (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes - (\d+ \s+)? #no value from client nodes - [-\w.]+ \s+ - \d+(\.\d+){3} \s+ - [-\w.]+ - \n - )+ - $/ - ---- -"One index": - - - do: - indices.create: - index: test - - - do: - cat.allocation: {} - - - match: - $body: | - /^ - ( \s* #allow leading spaces to account for right-justified text - \d+ \s+ - \d+(\.\d+)?[kmgt]?b \s+ - \d+(\.\d+)?[kmgt]?b \s+ - (\d+(\.\d+)?[kmgt]b \s+) #always should return value since we filter out non data nodes by default - (\d+(\.\d+)?[kmgt]b \s+) #always should return value since we filter out non data nodes by default - (\d+ \s+) #always should return value since we filter out non data nodes by default - [-\w.]+ \s+ - \d+(\.\d+){3} \s+ - [-\w.]+ - \n - )+ - ( - \s* #allow leading spaces to account for right-justified text - \d+ \s+ - UNASSIGNED - \n - )? - $/ - ---- -"Node ID": - - - do: - cat.allocation: - node_id: _master - - - match: - $body: | - /^ - ( 0 \s+ - \d+(\.\d+)?[kmgt]?b \s+ - \d+(\.\d+)?[kmgt]?b \s+ - (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes - (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes - (\d+ \s+)? #no value from client nodes - [-\w.]+ \s+ - \d+(\.\d+){3} \s+ - [-\w.]+ - \n - ) - $/ - - - do: - cat.allocation: - node_id: non_existent - - - match: - $body: | - /^ - $/ - ---- - -"All Nodes": - - - do: - cat.allocation: - node_id: "*" - - - match: - $body: | - /^ - ( \s* #allow leading spaces to account for right-justified text - \d+ \s+ - \d+(\.\d+)?[kmgt]?b \s+ - \d+(\.\d+)?[kmgt]?b \s+ - (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes - (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes - (\d+ \s+)? #no value from client nodes - [-\w.]+ \s+ - \d+(\.\d+){3} \s+ - [-\w.]+ - \n - )+ - ( - \s* #allow leading spaces to account for right-justified text - \d+ \s+ - UNASSIGNED - \n - )? - $/ - ---- -"Column headers": - - - do: - cat.allocation: - v: true - - match: - - $body: | - /^ shards \s+ - disk.indices \s+ - disk.used \s+ - disk.avail \s+ - disk.total \s+ - disk.percent \s+ - host \s+ - ip \s+ - node - \n - - ( \s* #allow leading spaces to account for right-justified text - 0 \s+ - 0b \s+ - \d+(\.\d+)?[kmgt]?b \s+ - (\d+(\.\d+)?[kmgt]b \s+) #always should return value since we filter out non data nodes by default - (\d+(\.\d+)?[kmgt]b \s+) #always should return value since we filter out non data nodes by default - (\d+ \s+) #always should return value since we filter out non data nodes by default - [-\w.]+ \s+ - \d+(\.\d+){3} \s+ - [-\w.]+ - \n - )+ - $/ - ---- -"Select columns": - - - do: - cat.allocation: - h: [disk.percent, node] - v: false - - - match: - $body: | - /^ - ( \d* \s+ - [-\w.]+ - \n - )+ - $/ - - - do: - cat.allocation: - h: [disk.percent, node] - v: true - - - match: - $body: | - /^ - disk.percent \s+ - node - \n - ( - \s+\d* \s+ - [-\w.]+ - \n - )+ - $/ - - ---- - -"Bytes": - - - do: - cat.allocation: - bytes: gb - - - match: - $body: | - /^ - ( 0 \s+ - 0 \s+ - \d+ \s+ - (\d+ \s+) #always should return value since we filter out non data nodes by default - (\d+ \s+) #always should return value since we filter out non data nodes by default - (\d+ \s+) #always should return value since we filter out non data nodes by default - [-\w.]+ \s+ - \d+(\.\d+){3} \s+ - [-\w.]+ - \n - )+ - $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.count/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.count/10_basic.yml deleted file mode 100644 index 7a6a29032cf74..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.count/10_basic.yml +++ /dev/null @@ -1,73 +0,0 @@ ---- -"Test cat count help": - - do: - cat.count: - help: true - - - match: - $body: | - /^ epoch .+ \n - timestamp .+ \n - count .+ \n $/ - ---- -"Test cat count output": - - - do: - cat.count: {} - - - match: - $body: | - /# epoch timestamp count - ^ \d+ \s \d{2}:\d{2}:\d{2} \s 0 \n$/ - - - do: - index: - index: index1 - id: 1 - body: { foo: bar } - refresh: true - - - do: - cat.count: {} - - - match: - $body: | - /# epoch timestamp count - ^ \d+ \s \d{2}:\d{2}:\d{2} \s 1 \n $/ - - - do: - index: - index: index2 - id: 1 - body: { foo: bar } - refresh: true - - - do: - cat.count: - h: count - - - match: - $body: | - /# count - ^ 2 \n $/ - - - - do: - cat.count: - index: index1 - - - match: - $body: | - /# epoch timestamp count - ^ \d+ \s \d{2}:\d{2}:\d{2} \s 1 \n $/ - - - do: - cat.count: - index: index2 - v: true - - - match: - $body: | - /^ epoch \s+ timestamp \s+ count \n - \d+ \s+ \d{2}:\d{2}:\d{2} \s+ \d+ \n $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.fielddata/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.fielddata/10_basic.yml deleted file mode 100644 index 6ef59f30753f7..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.fielddata/10_basic.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -"Help": - - do: - cat.fielddata: - help: true - - - match: - $body: | - /^ id .+ \n - host .+ \n - ip .+ \n - node .+ \n - field .+ \n - size .+ \n - $/ - ---- -"Test cat fielddata output": - - - do: - cat.fielddata: {} - - - do: - indices.create: - index: index - body: - settings: - number_of_shards: "1" - mappings: - properties: - foo: - type: text - fielddata: true - - - do: - index: - index: index - body: { foo: bar } - refresh: true - - - do: - search: - rest_total_hits_as_int: true - index: index - body: - query: { match_all: {} } - sort: foo - - - do: - cat.fielddata: - h: field,size - v: true - - - match: - $body: | - /^ field \s+ size \n - foo \s+ (\d+(\.\d+)?[gmk]?b \n)+ $/ - - - do: - cat.fielddata: - h: field,size - fields: notfoo,foo - v: true - - - match: - $body: | - /^ field \s+ size \n - foo \s+ (\d+(\.\d+)?[gmk]?b \n)+ $/ - - - do: - cat.fielddata: - h: field,size - fields: notfoo - v: true - - - match: - $body: | - /^ field \s+ size \n $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.health/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.health/10_basic.yml deleted file mode 100644 index 504b7c8f9b1b6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.health/10_basic.yml +++ /dev/null @@ -1,79 +0,0 @@ ---- -"Help": - - do: - cat.health: - help: true - - - match: - $body: | - /^ epoch .+ \n - timestamp .+ \n - cluster .+ \n - status .+ \n - node.total .+ \n - node.data .+ \n - shards .+ \n - pri .+ \n - relo .+ \n - init .+ \n - unassign .+ \n - pending_tasks .+ \n - max_task_wait_time .+ \n - active_shards_percent .+ \n - - $/ - - ---- -"Empty cluster": - - - do: - cat.health: {} - - - match: - $body: | - /^ - ( \d+ \s+ # epoch - \d\d:\d\d:\d\d \s+ # timestamp - \S+ \s+ # cluster - \w+ \s+ # status - \d+ \s+ # node.total - \d+ \s+ # node.data - \d+ \s+ # shards - \d+ \s+ # pri - \d+ \s+ # relo - \d+ \s+ # init - \d+ \s+ # unassign - \d+ \s+ # pending_tasks - (-|\d+(?:[.]\d+)?m?s) \s+ # max task waiting time - \d+\.\d+% # active shards percent - \n - )+ - $/ - - ---- -"With ts parameter": - - - do: - cat.health: - ts: false - - - match: - $body: | - /^ - ( \S+ \s+ # cluster - \w+ \s+ # status - \d+ \s+ # node.total - \d+ \s+ # node.data - \d+ \s+ # shards - \d+ \s+ # pri - \d+ \s+ # relo - \d+ \s+ # init - \d+ \s+ # unassign - \d+ \s+ # pending_tasks - (-|\d+(?:[.]\d+)?m?s) \s+ # max task waiting time - \d+\.\d+% # active shards percent - \n - )+ - $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/10_basic.yml deleted file mode 100644 index 4da58c2ed4d0d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/10_basic.yml +++ /dev/null @@ -1,275 +0,0 @@ ---- -"Test cat indices output (no indices)": - - - do: - cat.indices: {} - - - match: - $body: | - /^$/ ---- -"Test cat indices output": - - - do: - indices.create: - index: index1 - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - do: - cat.indices: {} - - - match: - $body: | - /^(green \s+ - open \s+ - index1 \s+ - ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ - 1 \s+ - 0 \s+ - 0 \s+ - 0 \s+ - (\d+|\d+[.]\d+)(kb|b) \s+ - (\d+|\d+[.]\d+)(kb|b) \s* - ) - $/ - - - do: - cat.indices: - v: false - h: i,cd,cds,creation.date,creation.date.string - - match: - $body: | - /^( - index1 \s+ - (\d+) \s+ - (\d\d\d\d\-\d\d\-\d\dT\d\d:\d\d:\d\d.\d\d\dZ) \s+ - (\d+) \s+ - (\d\d\d\d\-\d\d\-\d\dT\d\d:\d\d:\d\d.\d\d\dZ) \s* - ) - $/ ---- -"Test cat indices output for closed index (pre 7.2.0)": - - skip: - version: "7.2.0 - " - reason: "closed indices are replicated starting version 7.2.0" - - - do: - indices.create: - index: index-2 - body: - settings: - number_of_shards: 3 - number_of_replicas: 0 - - - do: - indices.close: - index: index-2 - - is_true: acknowledged - - - do: - cluster.health: - wait_for_status: green - - - do: - cat.indices: - index: index-* - - - match: - $body: | - /^( \s+ - close \s+ - index-2 \s+ - ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ - \s+ - \s+ - \s+ - \s+ - \s+ - \s* - ) - $/ ---- -"Test cat indices output for closed index": - - skip: - version: " - 7.1.99" - reason: "closed indices are replicated starting version 7.2.0" - - - do: - indices.create: - index: index-2 - body: - settings: - number_of_shards: 3 - number_of_replicas: 0 - - - do: - indices.close: - index: index-2 - - is_true: acknowledged - - - do: - cluster.health: - wait_for_status: green - - - do: - cat.indices: - index: index-* - - - match: - $body: | - /^(green \s+ - close \s+ - index-2 \s+ - ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ - 3 \s+ - 0 \s+ - \s+ - \s+ - \s+ - \s* - ) - $/ ---- -"Test cat indices using health status": - - - do: - cluster.health: {} - - - set: { number_of_data_nodes: count } - - - do: - indices.create: - index: foo - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - do: - indices.create: - index: bar - body: - settings: - number_of_shards: "1" - number_of_replicas: $count - - - do: - cat.indices: - health: green - h: index - - - match: - $body: | - /^(foo)$/ - - - do: - cat.indices: - health: yellow - h: index - - - match: - $body: | - /^(bar)$/ - ---- -"Test cat indices using wildcards": - - - do: - indices.create: - index: foo - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - indices.create: - index: bar - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - indices.create: - index: baz - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - cat.indices: - index: f* - v: false - h: i - - - match: - $body: | - /^(foo \n?)$/ - - - do: - cat.indices: - index: ba* - v: false - h: i - - - match: - $body: | - /^(ba(r|z) \n?){2}$/ - ---- -"Test cat indices sort": - - - do: - indices.create: - index: foo - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - indices.create: - index: bar - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - indices.create: - index: baz - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - indices.close: - index: bar - - - do: - cat.indices: - h: [status, index] - s: [status, index] - - - match: - $body: | - /^ close \s+ bar\n - open \s+ baz\n - open \s+ foo\n - $/ - - - do: - cat.indices: - h: [status, index] - s: [status, "index:desc"] - - - match: - $body: | - /^ close \s+ bar\n - open \s+ foo\n - open \s+ baz\n - $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/20_hidden.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/20_hidden.yml deleted file mode 100644 index 7a8cf51d4a129..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.indices/20_hidden.yml +++ /dev/null @@ -1,240 +0,0 @@ ---- -"Test cat indices output for hidden index": - - skip: - version: "- 7.6.99" - reason: "hidden indices were added in 7.7.0" - - - do: - indices.create: - index: index1 - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - index: - hidden: true - - do: - cat.indices: {} - - match: - $body: | - /^$/ - - - do: - cat.indices: - expand_wildcards: ["all"] - - match: - $body: | - /^(green \s+ - open \s+ - index1 \s+ - ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ - 1 \s+ - 0 \s+ - 0 \s+ - 0 \s+ - (\d+|\d+[.]\d+)(kb|b) \s+ - (\d+|\d+[.]\d+)(kb|b) \s* - ) - $/ - ---- -"Test cat indices output for dot-hidden index and dot-prefixed pattern": - - skip: - version: "- 7.6.99" - reason: "hidden indices were added in 7.7.0" - - - do: - indices.create: - index: .index1 - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - index: - hidden: true - - do: - cat.indices: {} - - match: - $body: | - /^$/ - - - do: - cat.indices: - index: ".*" - - match: - $body: | - /^(green \s+ - open \s+ - \.index1 \s+ - ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ - 1 \s+ - 0 \s+ - 0 \s+ - 0 \s+ - (\d+|\d+[.]\d+)(kb|b) \s+ - (\d+|\d+[.]\d+)(kb|b) \s* - ) - $/ - ---- -"Test cat indices output with a hidden index with a visible alias": - - skip: - version: "- 7.6.99" - reason: "hidden indices were added in 7.7.0" - - - do: - indices.create: - index: index1 - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - index: - hidden: true - aliases: - alias1: {} - - do: - cat.indices: - index: "i*" - # Can't use a bare wildcard here because Security replaces wildcards - # it with all matching authorized indices/aliases, including the visible - # alias - - match: - $body: | - /^$/ - - - do: - cat.indices: - expand_wildcards: ["open", "hidden"] - - match: - $body: | - /^(green \s+ - open \s+ - index1 \s+ - ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ - 1 \s+ - 0 \s+ - 0 \s+ - 0 \s+ - (\d+|\d+[.]\d+)(kb|b) \s+ - (\d+|\d+[.]\d+)(kb|b) \s* - ) - $/ - - - do: - cat.indices: - index: alias1 - - match: - $body: | - /^(green \s+ - open \s+ - index1 \s+ - ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ - 1 \s+ - 0 \s+ - 0 \s+ - 0 \s+ - (\d+|\d+[.]\d+)(kb|b) \s+ - (\d+|\d+[.]\d+)(kb|b) \s* - ) - $/ ---- -"Test cat indices output with a hidden index with a hidden alias": - - skip: - version: "- 7.6.99" - reason: "hidden indices and aliases were added in 7.7.0" - - - do: - indices.create: - index: index1 - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - index: - hidden: true - aliases: - alias1: - is_hidden: true - - do: - cat.indices: {} - - - match: - $body: | - /^$/ - - - do: - cat.indices: - expand_wildcards: ["all"] - - match: - $body: | - /^(green \s+ - open \s+ - index1 \s+ - ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ - 1 \s+ - 0 \s+ - 0 \s+ - 0 \s+ - (\d+|\d+[.]\d+)(kb|b) \s+ - (\d+|\d+[.]\d+)(kb|b) \s* - ) - $/ - - - do: - cat.indices: - index: alias1 - - match: - $body: | - /^(green \s+ - open \s+ - index1 \s+ - ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ - 1 \s+ - 0 \s+ - 0 \s+ - 0 \s+ - (\d+|\d+[.]\d+)(kb|b) \s+ - (\d+|\d+[.]\d+)(kb|b) \s* - ) - $/ ---- -"Test cat indices output with a hidden index, dot-hidden alias and dot pattern": - - skip: - version: "- 7.6.99" - reason: "hidden indices and aliases were added in 7.7.0" - - - do: - indices.create: - index: index1 - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - index: - hidden: true - aliases: - .alias1: - is_hidden: true - - do: - cat.indices: {} - - match: - $body: | - /^$/ - - do: - cat.indices: - index: ".*" - - match: - $body: | - /^(green \s+ - open \s+ - index1 \s+ - ([a-zA-Z0-9=/_+]|[\\\-]){22} \s+ - 1 \s+ - 0 \s+ - 0 \s+ - 0 \s+ - (\d+|\d+[.]\d+)(kb|b) \s+ - (\d+|\d+[.]\d+)(kb|b) \s* - ) - $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodeattrs/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodeattrs/10_basic.yml deleted file mode 100644 index c205e29ff6fec..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodeattrs/10_basic.yml +++ /dev/null @@ -1,70 +0,0 @@ ---- -"Help": - - do: - cat.nodeattrs: - help: true - - - match: - $body: | - /^ node .+ \n - id .+ \n - pid .+ \n - host .+ \n - ip .+ \n - port .+ \n - attr .+ \n - value .+ \n - $/ - ---- -"Test cat nodes attrs output": - - do: - cat.nodeattrs: {} - # All attributes look good - - match: - $body: | - /^# node\s+ host\s+ ip\s+ attr\s+ value\s* \n - (((\S+\s?){1,10})\s+(\S+)\s+(\d{1,3}\.){3}\d{1,3}\s+(\S+)\s+ (\S+)\s* \n)+ - $/ - # A specific planted attribute is present and looks good - - match: - $body: | - /# node\s+ host\s+ ip\s+ attr\s+ value\s* \n - (\S+(\s\S+){0,7})\s+ (\S+)\s+ (\d{1,3}\.){3}\d{1,3}\s+testattr\s+ test \s* \n - / - # Note for future editors: its quite possible to construct a regex with an - # intense amount of backtracking if you use something like (\S\s?)+ to match - # node name. - - - do: - cat.nodeattrs: - v: true - # All attributes look good including the heading - - match: - $body: | - /^ node\s+ host\s+ ip\s+ attr\s+ value\s* \n - (((\S+\s?){1,10})\s+(\S+)\s+(\d{1,3}\.){3}\d{1,3}\s+(\S+)\s+ (\S+)\s* \n)+ - $/ - # A specific planted attribute is present and looks good - - match: - $body: | - /# node\s+ host\s+ ip\s+ attr\s+ value\s* \n - (\S+(\s\S+){0,7})\s+ (\S+)\s+ (\d{1,3}\.){3}\d{1,3}\s+ testattr\s+ test \s* \n - / - - - do: - cat.nodeattrs: - h: attr,value - v: true - # All attributes look good - - match: - $body: | - /^ attr\s+ value\s*\n - ((\S+)\s+ (\S+)\s*)+ - $/ - # A specific planted attribute is present and looks good - - match: - $body: | - /# attr\s+ value\s*\n - testattr\s+ test\s*\n - / diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodes/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodes/10_basic.yml deleted file mode 100644 index 4c28f0bec5dfb..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.nodes/10_basic.yml +++ /dev/null @@ -1,108 +0,0 @@ ---- -"Test cat nodes output": - - - do: - cat.nodes: {} - - - match: - $body: | - / #ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name - ^ ((\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d* \s+ (-)?\d* \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)?\s+ ((-)?\d*(\.\d+)?)? \s+ (-|[dilmrt]{1,6}) \s+ [-*x] \s+ (\S+\s?)+ \n)+ $/ - - - do: - cat.nodes: - v: true - - - match: - $body: | - /^ ip \s+ heap\.percent \s+ ram\.percent \s+ cpu \s+ load_1m \s+ load_5m \s+ load_15m \s+ node\.role \s+ master \s+ name \n - ((\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d* \s+ (-)?\d* \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ (-|[dilmrt]{1,6}) \s+ [-*x] \s+ (\S+\s?)+ \n)+ $/ - - - do: - cat.nodes: - h: heap.current,heap.percent,heap.max - v: true - - - match: - $body: | - /^ heap\.current \s+ heap\.percent \s+ heap\.max \n - (\s+ \d+(\.\d+)?[ptgmk]?b \s+ \d+ \s+ \d+(\.\d+)?[ptgmk]?b \n)+ $/ - - - do: - cat.nodes: - h: heap.* - v: true - - - match: - $body: | - /^ heap\.current \s+ heap\.percent \s+ heap\.max \n - (\s+ \d+(\.\d+)?[ptgmk]?b \s+ \d+ \s+ \d+(\.\d+)?[ptgmk]?b \n)+ $/ - - - do: - cat.nodes: - h: file_desc.current,file_desc.percent,file_desc.max - v: true - - - match: - # Windows reports -1 for the file descriptor counts. - $body: | - /^ file_desc\.current \s+ file_desc\.percent \s+ file_desc\.max \n - (\s+ (-1|\d+) \s+ \d+ \s+ (-1|\d+) \n)+ $/ - - - do: - cat.nodes: - h: http - v: true - - - match: - $body: | - /^ http \n ((\d{1,3}\.){3}\d{1,3}:\d{1,5}\n)+ $/ - ---- -"Additional disk information": - - do: - cat.nodes: - h: diskAvail,diskTotal,diskUsed,diskUsedPercent - v: true - - - match: - # leading whitespace on columns and optional whitespace on values is necessary - # because `diskAvail` is right aligned and text representation of disk size might be - # longer so it's padded with leading whitespace - $body: | - /^ \s* diskAvail \s+ diskTotal \s+ diskUsed \s+ diskUsedPercent \n - (\s* \d+(\.\d+)?[ptgmk]?b \s+ \d+(\.\d+)?[ptgmk]?b \s+ \d+(\.\d+)?[ptgmk]?b\s+ (100\.00 | \d{1,2}\.\d{2}) \n)+ $/ - - - do: - cat.nodes: - h: disk,dt,du,dup - v: true - - - match: - # leading whitespace on columns and optional whitespace on values is necessary - # because `disk` is right aligned and text representation of disk size might be - # longer so it's padded with leading whitespace - $body: | - /^ \s* disk \s+ dt \s+ du \s+ dup \n - (\s* \d+(\.\d+)?[ptgmk]?b \s+ \d+(\.\d+)?[ptgmk]?b \s+ \d+(\.\d+)?[ptgmk]?b\s+ (100\.00 | \d{1,2}\.\d{2}) \n)+ $/ - ---- -"Test cat nodes output with full_id set": - - - do: - cat.nodes: - h: id - # check for a 4 char non-whitespace character string - - match: - $body: | - /^(\S{4}\n)+$/ - - - do: - cat.nodes: - h: id - full_id: true - # check for a 5+ char non-whitespace character string - - match: - $body: | - /^(\S{5,}\n)+$/ - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.plugins/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.plugins/10_basic.yml deleted file mode 100644 index 86f2a360afab0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.plugins/10_basic.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -"Help": - - do: - cat.plugins: - help: true - - - match: - $body: | - /^ id .+ \n - name .+ \n - component .+ \n - version .+ \n - description .+ \n - $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.recovery/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.recovery/10_basic.yml deleted file mode 100644 index ef1272322e9af..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.recovery/10_basic.yml +++ /dev/null @@ -1,134 +0,0 @@ ---- -"Test cat recovery output": - - - do: - cat.recovery: {} - - - match: - $body: | - /^$/ - - - do: - index: - index: index1 - id: 1 - body: { foo: bar } - refresh: true - - do: - cat.recovery: - h: i,s,t,ty,st,shost,thost,rep,snap,f,fr,fp,tf,b,br,bp,tb,to,tor,top - - - match: - $body: | - /^ - ( - index1 \s+ - \d \s+ # shard - (?:\d+ms|\d+(?:\.\d+)?s) \s+ # time in ms or seconds - (empty_store|existing_store|peer|snapshot|local_shards) \s+ # source type - (init|index|verify_index|translog|finalize|done) \s+ # stage - [-\w./]+ \s+ # source_host - [-\w./]+ \s+ # target_host - [-\w./]+ \s+ # repository - [-\w./]+ \s+ # snapshot - \d+ \s+ # files - \d+ \s+ # files_recovered - \d+\.\d+% \s+ # files_percent - \d+ \s+ # files_total - \d+ \s+ # bytes - \d+ \s+ # bytes_recovered - \d+\.\d+% \s+ # bytes_percent - \d+ \s+ # bytes_total - -?\d+ \s+ # translog_ops - \d+ \s+ # translog_ops_recovered - -?\d+\.\d+% # translog_ops_percent - \n - )+ - $/ - - - do: - cat.recovery: - h: shard,source_node,bytes - - - match: - $body: | - /^ - ( - \d \s+ # shard - ((\S+\s?){1,10})\s+ # source_node - \d+ # bytes - \n - )+ - $/ - - - do: - cat.recovery: - h: shard,target_node,bytes - - - match: - $body: | - /^ - ( - \d \s+ # shard - ((\S+\s?){1,10})\s+ # target_node - \d+ # bytes - \n - )+ - $/ - ---- -"Test cat recovery output for closed index": - - skip: - version: " - 7.1.99" - reason: closed indices are replicated starting version 7.2.0 - - - do: - indices.create: - index: index2 - body: - settings: - index: - number_of_replicas: 0 - - - do: - indices.close: - index: index2 - - is_true: acknowledged - - - do: - cluster.health: - index: index2 - wait_for_status: green - - - do: - cat.recovery: - index: index2 - h: i,s,t,ty,st,shost,thost,rep,snap,f,fr,fp,tf,b,br,bp,tb,to,tor,top - - - match: - $body: | - /^ - ( - index2 \s+ - \d \s+ # shard - (?:\d+ms|\d+(?:\.\d+)?s) \s+ # time in ms or seconds - existing_store \s+ # source type (always existing_store for closed indices) - done \s+ # stage - [-\w./]+ \s+ # source_host - [-\w./]+ \s+ # target_host - [-\w./]+ \s+ # repository - [-\w./]+ \s+ # snapshot - \d+ \s+ # files - \d+ \s+ # files_recovered - \d+\.\d+% \s+ # files_percent - \d+ \s+ # files_total - \d+ \s+ # bytes - \d+ \s+ # bytes_recovered - \d+\.\d+% \s+ # bytes_percent - \d+ \s+ # bytes_total - 0 \s+ # translog_ops (always 0 for closed indices) - 0 \s+ # translog_ops_recovered (always 0 for closed indices) - 100\.0% # translog_ops_percent (always 100.0% for closed indices) - \n - )+ - $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.repositories/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.repositories/10_basic.yml deleted file mode 100644 index ca1a03545e692..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.repositories/10_basic.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -"Help": - - do: - cat.repositories: - help: true - - - match: - $body: | - /^ id .+ \n - type .+ \n - $/ ---- -"Test cat repositories output": - - - do: - cat.repositories: {} - - - match: - $body: | - /^$/ - - - do: - snapshot.create_repository: - repository: test_cat_repo_1 - body: - type: fs - settings: - location: "test_cat_repo_1_loc" - - - do: - snapshot.create_repository: - repository: test_cat_repo_2 - body: - type: fs - settings: - location: "test_cat_repo_2_loc" - - - do: - cat.repositories: {} - - - match: - $body: | - /^ test_cat_repo_1\s+ fs\s*\n - test_cat_repo_2\s+ fs\s*\n - $/ - ---- -"Test cat repositories sort": - - do: - snapshot.create_repository: - repository: test_cat_repo_1 - body: - type: fs - settings: - location: "test_cat_repo_1_loc" - - - do: - snapshot.create_repository: - repository: test_cat_repo_2 - body: - type: fs - settings: - location: "test_cat_repo_2_loc" - - - do: - cat.repositories: - s: [type, id] - - - match: - $body: | - /^ test_cat_repo_1 \s+ fs \n - test_cat_repo_2 \s+ fs \n - $/ - - - do: - cat.repositories: - s: [type, "id:desc"] - - - match: - $body: | - /^ test_cat_repo_2 \s+ fs \n - test_cat_repo_1 \s+ fs \n - $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.segments/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.segments/10_basic.yml deleted file mode 100644 index 82488a0c23ce2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.segments/10_basic.yml +++ /dev/null @@ -1,167 +0,0 @@ ---- -"Help": - - do: - cat.segments: - help: true - - - match: - $body: | - /^ index .+ \n - shard .+ \n - prirep .+ \n - ip .+ \n - id .+ \n - segment .+ \n - generation .+ \n - docs.count .+ \n - docs.deleted .+ \n - size .+ \n - size.memory .+ \n - committed .+ \n - searchable .+ \n - version .+ \n - compound .+ \n - $/ ---- -"Test cat segments output": - - - do: - cat.segments: {} - - - match: - $body: | - /^$/ - - - do: - indices.create: - index: index1 - body: - settings: - number_of_shards: "3" - number_of_replicas: "0" - - do: - index: - index: index1 - body: { foo: bar } - refresh: true - - do: - cat.segments: {} - - match: - $body: | - /^(index1 \s+ \d \s+ (p|r) \s+ \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} \s+ _\d (\s\d){3} \s+ - (\d+|\d+[.]\d+)(kb|b) \s+ \d+ (\s+ (false|true)){2} \s+ \d+\.\d+(\.\d+)? \s+ (false|true) \s? \n?)$/ - - - do: - indices.create: - index: index2 - body: - settings: - number_of_shards: "3" - number_of_replicas: "0" - - do: - index: - index: index2 - body: { foo: bar } - refresh: true - - do: - cluster.health: - wait_for_status: green - - - - do: - cat.segments: {} - - match: - $body: | - /^(index(1|2) .+ \n?){2}$/ - - - do: - cat.segments: - index: index2 - - match: - $body: | - /^(index2 .+ \n?)$/ - ---- -"Test cat segments on closed index behaviour": - - - do: - indices.create: - index: index1 - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - indices.close: - index: index1 - - - do: - catch: bad_request - cat.segments: - index: index1 - ---- -"Test cat segments using wildcards": - - - do: - indices.create: - index: foo - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - index: - index: foo - body: { test: foo } - refresh: true - - - do: - indices.create: - index: bar - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - index: - index: bar - body: { test: bar } - refresh: true - - - do: - indices.create: - index: baz - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - index: - index: baz - body: { test: baz } - refresh: true - - - do: - cat.segments: - index: f* - v: false - h: i - - - match: - $body: | - /^(foo \n?)$/ - - - do: - cat.segments: - index: ba* - v: false - h: i - - - match: - $body: | - /^(ba(r|z) \n?){2}$/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.shards/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.shards/10_basic.yml deleted file mode 100644 index aa4abc7a11eae..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.shards/10_basic.yml +++ /dev/null @@ -1,209 +0,0 @@ ---- -"Help": - - skip: - version: " - 7.99.99" - reason: shard path stats were added in 8.0.0 - - do: - cat.shards: - help: true - - - match: - $body: | - /^ index .+ \n - shard .+ \n - prirep .+ \n - state .+ \n - docs .+ \n - store .+ \n - ip .+ \n - id .+ \n - node .+ \n - sync_id .+ \n - unassigned.reason .+ \n - unassigned.at .+ \n - unassigned.for .+ \n - unassigned.details .+ \n - recoverysource.type .+ \n - completion.size .+ \n - fielddata.memory_size .+ \n - fielddata.evictions .+ \n - query_cache.memory_size .+ \n - query_cache.evictions .+ \n - flush.total .+ \n - flush.total_time .+ \n - get.current .+ \n - get.time .+ \n - get.total .+ \n - get.exists_time .+ \n - get.exists_total .+ \n - get.missing_time .+ \n - get.missing_total .+ \n - indexing.delete_current .+ \n - indexing.delete_time .+ \n - indexing.delete_total .+ \n - indexing.index_current .+ \n - indexing.index_time .+ \n - indexing.index_total .+ \n - indexing.index_failed .+ \n - merges.current .+ \n - merges.current_docs .+ \n - merges.current_size .+ \n - merges.total .+ \n - merges.total_docs .+ \n - merges.total_size .+ \n - merges.total_time .+ \n - refresh.total .+ \n - refresh.time .+ \n - refresh.external_total .+ \n - refresh.external_time .+ \n - refresh.listeners .+ \n - search.fetch_current .+ \n - search.fetch_time .+ \n - search.fetch_total .+ \n - search.open_contexts .+ \n - search.query_current .+ \n - search.query_time .+ \n - search.query_total .+ \n - search.scroll_current .+ \n - search.scroll_time .+ \n - search.scroll_total .+ \n - segments.count .+ \n - segments.memory .+ \n - segments.index_writer_memory .+ \n - segments.version_map_memory .+ \n - segments.fixed_bitset_memory .+ \n - seq_no.max .+ \n - seq_no.local_checkpoint .+ \n - seq_no.global_checkpoint .+ \n - warmer.current .+ \n - warmer.total .+ \n - warmer.total_time .+ \n - path.data .+ \n - path.state .+ \n - $/ ---- -"Test cat shards output": - - - do: - cat.shards: {} - - - match: - $body: | - /^$/ - - do: - indices.create: - index: index1 - body: - settings: - number_of_shards: "5" - number_of_replicas: "1" - - do: - cat.shards: {} - - - match: - $body: | - /^(index1 \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING|RELOCATING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){10}$/ - - - do: - indices.create: - index: index2 - body: - settings: - number_of_shards: "5" - number_of_replicas: "0" - - - do: - cat.shards: {} - - match: - $body: | - /^(index(1|2) \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING|RELOCATING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){15}$/ - - - do: - cat.shards: - index: index2 - - match: - $body: | - /^(index2 \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING|RELOCATING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){5}$/ - ---- -"Test cat shards using wildcards": - - - do: - indices.create: - index: foo - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - indices.create: - index: bar - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - indices.create: - index: baz - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - cat.shards: - index: f* - v: false - h: i - - - match: - $body: | - /^(foo \n?)$/ - - - do: - cat.shards: - index: ba* - v: false - h: i - - - match: - $body: | - /^(ba(r|z) \n?){2}$/ - ---- -"Test cat shards sort": - - do: - indices.create: - index: foo - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - indices.create: - index: bar - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - index: - index: bar - body: { test: bar } - refresh: true - - - do: - cat.shards: - h: [index, docs] - s: [docs] - -# don't use the store here it's cached and might be stale - - match: - $body: | - /^ foo \s+ 0\n - bar \s+ 1\n - $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.snapshots/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.snapshots/10_basic.yml deleted file mode 100644 index 6e03ceb98c716..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.snapshots/10_basic.yml +++ /dev/null @@ -1,79 +0,0 @@ ---- -"Help": - - do: - cat.snapshots: - help: true - - - match: - $body: | - /^ id .+ \n - status .+ \n - start_epoch .+ \n - start_time .+ \n - end_epoch .+ \n - end_time .+ \n - duration .+ \n - indices .+ \n - successful_shards .+ \n - failed_shards .+ \n - total_shards .+ \n - reason .+ \n - $/ ---- -"Test cat snapshots output": - - - do: - snapshot.create_repository: - repository: test_cat_snapshots_1 - body: - type: fs - settings: - location: "test_cat_snapshots_1_loc" - - - do: - cat.snapshots: - repository: test_cat_snapshots_1 - - - match: - $body: | - /^$/ - - - do: - indices.create: - index: index1 - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - do: - indices.create: - index: index2 - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - do: - cluster.health: - wait_for_status: green - - - do: - snapshot.create: - repository: test_cat_snapshots_1 - snapshot: snap1 - wait_for_completion: true - - - do: - snapshot.create: - repository: test_cat_snapshots_1 - snapshot: snap2 - wait_for_completion: true - - - do: - cat.snapshots: - repository: test_cat_snapshots_1 - - - match: - $body: | - /^ snap1\s+ SUCCESS\s+ \d+\s+ \d\d\:\d\d\:\d\d\s+ \d+\s+ \d\d\:\d\d\:\d\d\s+ \S+\s+ 2\s+ 2\s+ 0\s+ 2\s*\n - snap2\s+ SUCCESS\s+ \d+\s+ \d\d\:\d\d\:\d\d\s+ \d+\s+ \d\d\:\d\d\:\d\d\s+ \S+\s+ 2\s+ 2\s+ 0\s+ 2\s*\n - $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.tasks/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.tasks/10_basic.yml deleted file mode 100644 index c7a38bfb44adc..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.tasks/10_basic.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -"Test cat tasks output": - - - do: - cat.tasks: {} - - - match: - $body: | - / # action task_id parent_task_id type start_time timestamp running_time ip node - ^( \S+\s+ \S+\:\d+\s+ (?:\-|\S+\:\d+)\s+ \S+\s+ \d+\s+ \d\d\:\d\d\:\d\d\s+ \S+\s+ \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\s+ \S+\n)+$/ - - - do: - cat.tasks: - detailed: true - - - match: - $body: | - / # action task_id parent_task_id type start_time timestamp running_time ip node description - ^( \S+\s+ \S+\:\d+\s+ (?:\-|\S+\:\d+)\s+ \S+\s+ \d+\s+ \d\d\:\d\d\:\d\d\s+ \S+\s+ \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\s+ \S+\s+ .*\n)+$/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.templates/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.templates/10_basic.yml deleted file mode 100644 index fe0d7ee30730f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.templates/10_basic.yml +++ /dev/null @@ -1,257 +0,0 @@ ---- -"Help": - - do: - cat.templates: - help: true - - - match: - $body: | - /^ name .+ \n - index_patterns .+ \n - order .+ \n - version .+ \n - $/ - ---- -"No templates": - - skip: - features: default_shards, no_xpack - - do: - cat.templates: {} - - - match: - $body: | - /^ - $/ - ---- -"Normal templates": - - - do: - indices.put_template: - name: test - body: - order: 0 - version: 1 - index_patterns: test-* - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - indices.put_template: - name: test_2 - body: - order: 1 - version: 2 - index_patterns: test-2* - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - cat.templates: {} - - - match: - $body: > - / - (^|\n)test \s+ - \[test-\*\] \s+ - 0 \s+ - 1 - (\n|$) - / - - - match: - $body: > - / - (^|\n)test_2 \s+ - \[test-2\*\] \s+ - 1 \s+ - 2 - (\n|$) - / - ---- -"Filtered templates": - - - do: - indices.put_template: - name: test - body: - order: 0 - version: 1 - index_patterns: t* - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - indices.put_template: - name: nomatch - body: - order: 2 - version: 1 - index_patterns: tea* - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - cat.templates: - name: test* - - - match: - $body: | - /^ - test \s+ - \[t\*\] \s+ - 0 \s+ - 1 - \n - $/ - ---- -"Column headers": - - do: - indices.put_template: - name: test - body: - order: 0 - version: 1 - index_patterns: t* - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - cat.templates: - v: true - name: test - - - match: - $body: | - /^ - name \s+ - index_patterns \s+ - order \s+ - version - \n - test \s+ - \[t\*\] \s+ - 0 \s+ - 1 - \n - $/ - ---- -"Select columns": - - do: - indices.put_template: - name: test - body: - order: 0 - version: 1 - index_patterns: t* - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - cat.templates: - h: [name, index_patterns] - v: true - name: test* - - - match: - $body: | - /^ - name \s+ - index_patterns - \n - test \s+ - \[t\*\] - \n - $/ - ---- -"Sort templates": - - skip: - features: default_shards, no_xpack - - do: - indices.put_template: - name: test - body: - order: 0 - index_patterns: t* - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - indices.put_template: - name: test_1 - body: - order: 0 - version: 1 - index_patterns: te* - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - cat.templates: - h: [name, index_patterns, version] - s: [version] - - - match: - $body: | - /^ - test \s+ \[t\*\] \s+ \n - test_1 \s+ \[te\*\] \s+ 1 \n - $/ - - - do: - cat.templates: - h: [name, index_patterns, version] - s: ["version:desc"] - - - match: - $body: | - /^ - test_1 \s+ \[te\*\] \s+ 1\n - test \s+ \[t\*\] \s+ \n - - $/ - ---- -"Multiple template": - - skip: - features: default_shards, no_xpack - - do: - indices.put_template: - name: test_1 - body: - order: 0 - version: 1 - index_patterns: [t*, te*] - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - cat.templates: - h: [name, index_patterns] - v: true - - - - match: - $body: | - /^ - name \s+ - index_patterns - \n - test_1 \s+ - \[t\*,\ te\*\] - \n - $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.thread_pool/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cat.thread_pool/10_basic.yml deleted file mode 100644 index 1ce8468cb51f9..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cat.thread_pool/10_basic.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -"Test cat thread_pool output": - - skip: - version: " - 6.99.99" - reason: this API was changed in a backwards-incompatible fashion in 7.0.0 so we need to skip in a mixed cluster - - - do: - cat.thread_pool: {} - - - match: - $body: | - / #node_name name active queue rejected - ^ (\S+ \s+ \S+ \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/ - - - do: - cat.thread_pool: - v: true - - - match: - $body: | - /^ node_name \s+ name \s+ active \s+ queue \s+ rejected \n - (\S+ \s+ \S+ \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/ - - - do: - cat.thread_pool: - h: pid,id,h,i,po - - - match: - $body: | - / #pid id host ip port - (\d+ \s+ \S+ \s+ \S+ \s+ (\d{1,3}\.){3}\d{1,3} \s+ (\d+|-) \n)+ $/ - - - do: - cat.thread_pool: - thread_pool_patterns: write,management,flush,generic,force_merge - h: id,name,active - v: true - - - match: - $body: | - /^ id \s+ name \s+ active \n - (\S+\s+ flush \s+ \d+ \n - \S+\s+ force_merge \s+ \d+ \n - \S+\s+ generic \s+ \d+ \n - \S+\s+ management \s+ \d+ \n - \S+\s+ write \s+ \d+ \n)+ $/ - - - do: - cat.thread_pool: - thread_pool_patterns: write - h: id,name,type,active,size,queue,queue_size,rejected,largest,completed,min,max,keep_alive - v: true - - - match: - $body: | - /^ id \s+ name \s+ type \s+ active \s+ size \s+ queue \s+ queue_size \s+ rejected \s+ largest \s+ completed \s+ max \s+ keep_alive \n - (\S+ \s+ write \s+ fixed \s+ \d+ \s+ \d+ \s+ \d+ \s+ (-1|\d+) \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \S* \n)+ $/ - - - do: - cat.thread_pool: - thread_pool_patterns: fetch* - h: id,name,type,active,pool_size,queue,queue_size,rejected,largest,completed,core,max,size,keep_alive - v: true - - - match: - $body: | - /^ id \s+ name \s+ type \s+ active \s+ pool_size \s+ queue \s+ queue_size \s+ rejected \s+ largest \s+ completed \s+ core \s+ max \s+ size \s+ keep_alive \n - (\S+ \s+ fetch_shard_started \s+ scaling \s+ \d+ \s+ \d+ \s+ \d+ \s+ (-1|\d+) \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \d* \s+ \S* \n - \S+ \s+ fetch_shard_store \s+ scaling \s+ \d+ \s+ \d+ \s+ \d+ \s+ (-1|\d+) \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \d* \s+ \S* \n)+ $/ - - - do: - cat.thread_pool: - thread_pool_patterns: write,search - size: "" - - - match: - $body: | - / #node_name name active queue rejected - ^ (\S+ \s+ search \s+ \d+ \s+ \d+ \s+ \d+ \n - \S+ \s+ write \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/ diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.allocation_explain/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.allocation_explain/10_basic.yml deleted file mode 100644 index f0fdca695b829..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.allocation_explain/10_basic.yml +++ /dev/null @@ -1,91 +0,0 @@ -"bad cluster shard allocation explanation request": - - do: - # there aren't any unassigned shards to explain - catch: /illegal_argument_exception/ - cluster.allocation_explain: {} - ---- -"cluster shard allocation explanation test": - - do: - indices.create: - index: test - - - match: { acknowledged: true } - - - do: - cluster.allocation_explain: - body: { "index": "test", "shard": 0, "primary": true } - - - match: { current_state: "started" } - - is_true: current_node.id - - match: { index: "test" } - - match: { shard: 0 } - - match: { primary: true } - - is_true: can_remain_on_current_node - - is_true: can_rebalance_cluster - - is_true: can_rebalance_to_other_node - - is_true: rebalance_explanation - ---- -"cluster shard allocation explanation test with empty request": - - do: - indices.create: - index: test - body: { "settings": { "index.number_of_shards": 1, "index.number_of_replicas": 9 } } - - - do: - cluster.allocation_explain: - include_disk_info: true - - - match: { current_state: "unassigned" } - - match: { unassigned_info.reason: "INDEX_CREATED" } - - is_true: unassigned_info.at - - match: { index: "test" } - - match: { shard: 0 } - - match: { primary: false } - - is_true: cluster_info - - is_true: can_allocate - - ---- -"Cluster shard allocation explanation test with a closed index": - - skip: - version: " - 7.1.99" - reason: closed indices are replicated starting version 7.2.0 - - - do: - indices.create: - index: test_closed - body: { "settings": { "index.number_of_shards": 1, "index.number_of_replicas": 0 } } - - - match: { acknowledged: true } - - - do: - cluster.health: - index: test_closed - wait_for_status: green - - - do: - indices.close: - index: test_closed - - - match: { acknowledged: true } - - - do: - cluster.health: - index: test_closed - wait_for_status: green - - - do: - cluster.allocation_explain: - body: { "index": "test_closed", "shard": 0, "primary": true } - - - match: { current_state: "started" } - - is_true: current_node.id - - match: { index: "test_closed" } - - match: { shard: 0 } - - match: { primary: true } - - is_true: can_remain_on_current_node - - is_true: can_rebalance_cluster - - is_true: can_rebalance_to_other_node - - is_true: rebalance_explanation diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.component_template/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.component_template/10_basic.yml deleted file mode 100644 index f4f705d00d81e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.component_template/10_basic.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -"Basic CRUD": - - skip: - version: " - 7.6.99" - reason: only available in 7.7+ - - - do: - cluster.put_component_template: - name: test - body: - template: - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - properties: - field: - type: keyword - aliases: - aliasname: {} - version: 2 - _meta: - foo: bar - baz: - eggplant: true - - - do: - cluster.get_component_template: - name: test - - - match: {component_templates.0.name: test} - - match: {component_templates.0.component_template.version: 2} - - match: {component_templates.0.component_template._meta: {foo: bar, baz: {eggplant: true}}} - - match: {component_templates.0.component_template.template.settings: {index: {number_of_shards: '1', number_of_replicas: '0'}}} - - match: {component_templates.0.component_template.template.mappings: {properties: {field: {type: keyword}}}} - - match: {component_templates.0.component_template.template.aliases: {aliasname: {}}} - - - do: - cluster.delete_component_template: - name: test - - - do: - catch: missing - cluster.get_component_template: - name: test - - - is_false: test diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/10_basic.yml deleted file mode 100644 index aa6c96202eaf4..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/10_basic.yml +++ /dev/null @@ -1,281 +0,0 @@ ---- -"cluster health basic test": - - do: - cluster.health: {} - - - is_true: cluster_name - - is_false: timed_out - - gte: { number_of_nodes: 1 } - - gte: { number_of_data_nodes: 1 } - - match: { active_primary_shards: 0 } - - match: { active_shards: 0 } - - match: { relocating_shards: 0 } - - match: { initializing_shards: 0 } - - match: { unassigned_shards: 0 } - - gte: { number_of_pending_tasks: 0 } - ---- -"cluster health basic test, one index": - - do: - indices.create: - index: test_index - body: - settings: - index: - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - wait_for_no_relocating_shards: true - - - is_true: cluster_name - - is_false: timed_out - - gte: { number_of_nodes: 1 } - - gte: { number_of_data_nodes: 1 } - - gt: { active_primary_shards: 0 } - - gt: { active_shards: 0 } - - gte: { relocating_shards: 0 } - - match: { initializing_shards: 0 } - - match: { unassigned_shards: 0 } - - gte: { number_of_pending_tasks: 0 } - ---- -"cluster health basic test, one index with wait for active shards": - - do: - indices.create: - index: test_index - body: - settings: - index: - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_active_shards: 1 - wait_for_no_relocating_shards: true - - - is_true: cluster_name - - is_false: timed_out - - gte: { number_of_nodes: 1 } - - gte: { number_of_data_nodes: 1 } - - gt: { active_primary_shards: 0 } - - gt: { active_shards: 0 } - - gte: { relocating_shards: 0 } - - match: { initializing_shards: 0 } - - match: { unassigned_shards: 0 } - - gte: { number_of_pending_tasks: 0 } - ---- -"cluster health basic test, one index with wait for all active shards": - - do: - indices.create: - index: test_index - body: - settings: - index: - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_active_shards: all - wait_for_no_relocating_shards: true - - - is_true: cluster_name - - is_false: timed_out - - gte: { number_of_nodes: 1 } - - gte: { number_of_data_nodes: 1 } - - gt: { active_primary_shards: 0 } - - gt: { active_shards: 0 } - - gte: { relocating_shards: 0 } - - match: { initializing_shards: 0 } - - match: { unassigned_shards: 0 } - - gte: { number_of_pending_tasks: 0 } - ---- -"cluster health basic test, one index with wait for no initializing shards": - - skip: - version: " - 6.1.99" - reason: "wait_for_no_initializing_shards is introduced in 6.2.0" - - - do: - indices.create: - index: test_index - wait_for_active_shards: 0 - body: - settings: - index: - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_no_initializing_shards: true - - - match: { initializing_shards: 0 } - ---- -"cluster health levels": - - do: - indices.create: - index: test_index - - do: - cluster.health: - level: indices - - - is_true: indices - - is_false: indices.test_index.shards - - - do: - cluster.health: - level: shards - - - is_true: indices - - is_true: indices.test_index.shards - ---- -"cluster health with closed index (pre 7.2.0)": - - skip: - version: "7.2.0 - " - reason: "closed indices are replicated starting version 7.2.0" - - - do: - indices.create: - index: index-1 - body: - settings: - index: - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - match: { status: green } - - - do: - indices.create: - index: index-2 - body: - settings: - index: - number_of_replicas: 50 - - - do: - cluster.health: - wait_for_status: yellow - wait_for_no_relocating_shards: true - - match: { status: yellow } - - - do: - cluster.health: - index: index-* - - match: { status: yellow } - - - do: - cluster.health: - index: index-1 - - match: { status: green } - - - do: - cluster.health: - index: index-2 - - match: { status: yellow } - - - do: - indices.close: - index: index-2 - - is_true: acknowledged - - # closing the index-2 turns the cluster health back to green - - do: - cluster.health: - wait_for_status: green - - match: { status: green } - - - do: - cluster.health: - index: index-* - - match: { status: green } - - - do: - cluster.health: - index: index-1 - - match: { status: green } - - - do: - cluster.health: - index: index-2 - - match: { status: green } - ---- -"cluster health with closed index": - - skip: - version: " - 7.1.99" - reason: "closed indices are replicated starting version 7.2.0" - - - do: - indices.create: - index: index-1 - body: - settings: - index: - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - match: { status: green } - - - do: - indices.create: - index: index-2 - body: - settings: - index: - number_of_replicas: 50 - - - do: - cluster.health: - wait_for_status: yellow - wait_for_no_relocating_shards: true - - match: { status: yellow } - - - do: - cluster.health: - index: index-* - - match: { status: yellow } - - - do: - cluster.health: - index: index-1 - - match: { status: green } - - - do: - cluster.health: - index: index-2 - - match: { status: yellow } - - # closing the index-2 does not change the cluster health with replicated closed indices - - do: - indices.close: - index: index-2 - - is_true: acknowledged - - - do: - cluster.health: - wait_for_status: yellow - - match: { status: yellow } - - - do: - cluster.health: - index: index-* - - match: { status: yellow } - - - do: - cluster.health: - index: index-1 - - match: { status: green } - - - do: - cluster.health: - index: index-2 - - match: { status: yellow } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/20_request_timeout.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/20_request_timeout.yml deleted file mode 100644 index 66a7cb2b48dbd..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/20_request_timeout.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -"cluster health request timeout on waiting for nodes": - - do: - catch: request_timeout - cluster.health: - wait_for_nodes: 10 - timeout: 1ms - - - is_true: cluster_name - - is_true: timed_out - - gte: { number_of_nodes: 1 } - - gte: { number_of_data_nodes: 1 } - - match: { active_primary_shards: 0 } - - match: { active_shards: 0 } - - match: { relocating_shards: 0 } - - match: { initializing_shards: 0 } - - match: { unassigned_shards: 0 } - - gte: { number_of_pending_tasks: 0 } - ---- -"cluster health request timeout waiting for active shards": - - do: - catch: request_timeout - cluster.health: - timeout: 1ms - wait_for_active_shards: 5 - - - is_true: cluster_name - - is_true: timed_out - - gte: { number_of_nodes: 1 } - - gte: { number_of_data_nodes: 1 } - - match: { active_primary_shards: 0 } - - match: { active_shards: 0 } - - match: { relocating_shards: 0 } - - match: { initializing_shards: 0 } - - match: { unassigned_shards: 0 } - - gte: { number_of_pending_tasks: 0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/30_indices_options.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/30_indices_options.yml deleted file mode 100644 index 93ca5da19d2ff..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.health/30_indices_options.yml +++ /dev/null @@ -1,79 +0,0 @@ -setup: - - - do: - indices.create: - index: index-1 - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - indices.create: - index: index-2 - body: - settings: - number_of_shards: 2 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - indices.close: - index: index-2 - - - do: - cluster.health: - wait_for_status: green - ---- -"cluster health with expand_wildcards": - - skip: - version: " - 7.1.99" - reason: "indices options has been introduced in cluster health request starting version 7.2.0" - - - do: - cluster.health: - index: "index-*" - level: indices - expand_wildcards: open - - match: { status: green } - - match: { active_shards: 1 } - - match: { indices.index-1.status: green } - - match: { indices.index-1.active_shards: 1 } - - is_false: indices.index-2 - - - do: - cluster.health: - index: "index-*" - level: indices - expand_wildcards: closed - - match: { status: green } - - match: { active_shards: 2 } - - is_false: indices.index-1 - - match: { indices.index-2.status: green } - - match: { indices.index-2.active_shards: 2 } - - - do: - cluster.health: - index: "index-*" - level: indices - expand_wildcards: all - - match: { status: green } - - match: { active_shards: 3 } - - match: { indices.index-1.status: green } - - match: { indices.index-1.active_shards: 1 } - - match: { indices.index-2.status: green } - - match: { indices.index-2.active_shards: 2 } - - - do: - cluster.health: - index: "index-*" - level: indices - expand_wildcards: none - - match: { status: green } - - match: { active_shards: 0 } - - is_false: indices.index-1 - - is_false: indices.index-2 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.pending_tasks/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.pending_tasks/10_basic.yml deleted file mode 100644 index f8fd8ebef170d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.pending_tasks/10_basic.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -"Test pending tasks": - - do: - cluster.pending_tasks: {} - - - is_true: tasks ---- -"Test pending tasks with local flag": - - do: - cluster.pending_tasks: - local: true - - - is_true: tasks - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.put_settings/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.put_settings/10_basic.yml deleted file mode 100644 index 825bac9f91649..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.put_settings/10_basic.yml +++ /dev/null @@ -1,71 +0,0 @@ ---- -"Test put and reset transient settings": - - do: - cluster.put_settings: - body: - transient: - cluster.routing.allocation.enable: "none" - flat_settings: true - - - match: {transient: {cluster.routing.allocation.enable: "none"}} - - - do: - cluster.get_settings: - flat_settings: true - - - match: {transient: {cluster.routing.allocation.enable: "none"}} - - - do: - cluster.put_settings: - body: - transient: - cluster.routing.allocation.enable: null - flat_settings: true - - - match: {transient: {}} - - - do: - cluster.get_settings: - flat_settings: true - - - match: {transient: {}} ---- -"Test put and reset persistent settings": - - do: - cluster.put_settings: - body: - persistent: - cluster.routing.allocation.enable: "none" - flat_settings: true - - - match: {persistent: {cluster.routing.allocation.enable: "none"}} - - - do: - cluster.get_settings: - flat_settings: true - - - match: {persistent: {cluster.routing.allocation.enable: "none"}} - - - do: - cluster.put_settings: - body: - persistent: - cluster.routing.allocation.enable: null - flat_settings: true - - - match: {persistent: {}} - - - do: - cluster.get_settings: - flat_settings: true - - - match: {persistent: {}} - ---- -"Test get a default settings": - - - do: - cluster.get_settings: - include_defaults: true - - - match: {defaults.node.attr.testattr: "test"} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.remote_info/10_info.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.remote_info/10_info.yml deleted file mode 100644 index e11eff2b78a3c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.remote_info/10_info.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -"Get an empty remote info": - - do: - cluster.remote_info: {} - - is_true: '' - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/10_basic.yml deleted file mode 100644 index 771f647a952c7..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/10_basic.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -"Basic sanity check": - - do: - cluster.reroute: {} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/11_explain.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/11_explain.yml deleted file mode 100644 index 248b47d07a71e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/11_explain.yml +++ /dev/null @@ -1,57 +0,0 @@ -setup: - - do: - indices.create: - index: test_index - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - cluster.health: - wait_for_status: green - ---- -"Explain API with empty command list": - - - do: - cluster.reroute: - explain: true - dry_run: true - body: - commands: [] - - - match: {explanations: []} - ---- -"Explain API for non-existent node & shard": - - skip: - features: [arbitrary_key] - - - do: - nodes.info: - node_id: data:true - - set: - nodes._arbitrary_key_: node_id - - - do: - cluster.reroute: - explain: true - dry_run: true - body: - commands: - - cancel: - index: test_index - shard: 9 - node: $node_id - - - match: {explanations.0.command: cancel} - - match: - explanations.0.parameters: - index: test_index - shard: 9 - node: $node_id - allow_primary: false - - match: {explanations.0.decisions.0.decider: cancel_allocation_command} - - match: {explanations.0.decisions.0.decision: "NO"} - - is_true: explanations.0.decisions.0.explanation diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/20_response_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/20_response_filtering.yml deleted file mode 100644 index 437b78e6119a7..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.reroute/20_response_filtering.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -"Do not return metadata by default": - - do: - cluster.reroute: {} - - is_false: state.metadata ---- -"return metadata if requested": - - do: - cluster.reroute: - metric: metadata - - - is_true: state.metadata - - is_false: state.nodes - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/10_basic.yml deleted file mode 100644 index b443e322f80f6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/10_basic.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -"get cluster state": - - do: - cluster.state: {} - - - is_true: master_node - ---- -"get cluster state returns cluster_uuid at the top level": - - skip: - version: " - 6.3.99" - reason: "cluster state including cluster_uuid at the top level is new in v6.4.0 and higher" - - - do: - cluster.state: - human: true - - - is_true: cluster_uuid - - is_true: master_node diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/20_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/20_filtering.yml deleted file mode 100644 index 88da42ee876be..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/20_filtering.yml +++ /dev/null @@ -1,182 +0,0 @@ -setup: - - do: - index: - index: testidx - id: testing_document - body: - "text" : "The quick brown fox is brown." - ---- -"Filtering the cluster state by blocks should return the blocks field even if the response is empty": - - do: - cluster.state: - metric: [ blocks ] - - - is_true: blocks - - is_false: nodes - - is_false: metadata - - is_false: routing_table - - is_false: routing_nodes - - length: { blocks: 0 } - ---- -"Filtering the cluster state by blocks should return the blocks": - - do: - indices.put_settings: - index: testidx - body: - index.blocks.read_only: true - - do: - cluster.state: - metric: [ blocks ] - - - is_true: blocks - - is_false: nodes - - is_false: metadata - - is_false: routing_table - - is_false: routing_nodes - - length: { blocks: 1 } - - - do: - indices.put_settings: - index: testidx - body: - index.blocks.read_only: false - ---- -"Filtering the cluster state by nodes only should work": - - do: - cluster.state: - metric: [ nodes ] - - - is_false: blocks - - is_true: nodes - - is_false: metadata - - is_false: routing_table - - is_false: routing_nodes - ---- -"Filtering the cluster state by metadata only should work": - - do: - cluster.state: - metric: [ metadata ] - - - is_false: blocks - - is_false: nodes - - is_true: metadata - - is_false: routing_table - - is_false: routing_nodes - - ---- -"Filtering the cluster state by routing table only should work": - - do: - cluster.state: - metric: [ routing_table ] - - - is_false: blocks - - is_false: nodes - - is_false: metadata - - is_true: routing_table - - is_false: routing_nodes - ---- -"Filtering the cluster state by routing nodes only should work": - - do: - cluster.state: - metric: [ routing_nodes ] - - - is_false: blocks - - is_false: nodes - - is_false: metadata - - is_false: routing_table - - is_true: routing_nodes - ---- -"Filtering the cluster state by indices should work in routing table and metadata": - - do: - index: - index: another - id: testing_document - body: - "text" : "The quick brown fox is brown." - - - do: - cluster.state: - metric: [ routing_table, metadata ] - index: [ testidx ] - - - is_false: metadata.indices.another - - is_false: routing_table.indices.another - - is_true: metadata.indices.testidx - - is_true: routing_table.indices.testidx - ---- -"Filtering the cluster state using _all for indices and metrics should work": - - do: - cluster.state: - metric: [ '_all' ] - index: [ '_all' ] - - - is_true: blocks - - is_true: nodes - - is_true: metadata - - is_true: routing_table - - is_true: routing_nodes - ---- -"Filtering the cluster state by indices using wildcards should work in routing table and metadata": - - do: - index: - index: index1 - id: testing_document - body: - "text" : "The quick brown fox is brown." - - - do: - index: - index: index2 - id: testing_document - body: - "text" : "The quick brown fox is brown." - - - do: - cluster.state: - metric: [ routing_table, metadata ] - index: [ index* ] - - - is_false: metadata.indices.testidx - - is_false: routing_table.indices.testidx - - - is_true: metadata.indices.index1 - - is_true: routing_table.indices.index1 - - is_true: metadata.indices.index2 - - is_true: routing_table.indices.index2 - ---- -"Filtering the cluster state returns cluster_uuid at the top level regardless of metric filters": - - skip: - version: " - 6.3.99" - reason: "cluster state including cluster_uuid at the top level is new in v6.4.0 and higher" - - # Get the current cluster_uuid - - do: - cluster.state: {} - - set: { metadata.cluster_uuid : cluster_uuid } - - - do: - cluster.state: - metric: [ master_node, version ] - - - match: { cluster_uuid: $cluster_uuid } - - is_true: master_node - - is_true: version - - is_true: state_uuid - - - do: - cluster.state: - metric: [ routing_table ] - index: testidx - - - match: { cluster_uuid: $cluster_uuid } - - is_true: routing_table diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/30_expand_wildcards.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/30_expand_wildcards.yml deleted file mode 100644 index 414620d13586d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.state/30_expand_wildcards.yml +++ /dev/null @@ -1,92 +0,0 @@ -setup: - - - do: - indices.create: - index: test_close_index - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - indices.create: - index: test_open_index - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - cluster.health: - wait_for_status: green - -# close one index, keep other open for later test - - - do: - indices.close: - index: test_close_index - ---- -"Test expand_wildcards parameter on closed, open indices and both": - - - do: - cluster.state: - metric: [ metadata ] - index: test* - expand_wildcards: [ closed ] - - - is_false: metadata.indices.test_open_index - - match: {metadata.indices.test_close_index.state: "close"} - - - do: - cluster.state: - metric: [ metadata ] - index: test* - expand_wildcards: [ open ] - - - match: {metadata.indices.test_open_index.state: "open"} - - is_false: metadata.indices.test_close_index - - - do: - cluster.state: - metric: [ metadata ] - index: test* - expand_wildcards: [ open,closed ] - - - match: {metadata.indices.test_open_index.state: "open"} - - match: {metadata.indices.test_close_index.state: "close"} - ---- -"Test ignore_unavailable parameter": - - - do: - cluster.state: - metric: [ metadata ] - index: foobla - ignore_unavailable: true - - - match: {metadata.indices: {}} - - - do: - catch: missing - cluster.state: - metric: [ metadata ] - index: foobla - ignore_unavailable: false - ---- -"Test allow_no_indices parameter": - - - do: - cluster.state: - metric: [ metadata ] - index: not_there* - - - match: {metadata.indices: {}} - - - do: - catch: missing - cluster.state: - metric: [ metadata ] - index: not_there* - allow_no_indices: false diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.stats/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.stats/10_basic.yml deleted file mode 100644 index 84bce35a07327..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/cluster.stats/10_basic.yml +++ /dev/null @@ -1,145 +0,0 @@ ---- -"cluster stats test": - - do: - cluster.stats: {} - - - is_true: timestamp - - is_true: cluster_name - - match: {status: green} - - gte: { indices.count: 0} - - is_true: indices.docs - - is_true: indices.store - - is_true: indices.fielddata - - is_true: indices.query_cache - - is_true: indices.completion - - is_true: indices.segments - - gte: { nodes.count.total: 1} - - gte: { nodes.count.master: 1} - - gte: { nodes.count.data: 1} - - gte: { nodes.count.ingest: 0} - - gte: { nodes.count.coordinating_only: 0} - - is_true: nodes.os - - is_true: nodes.os.mem.total_in_bytes - - is_true: nodes.os.mem.free_in_bytes - - is_true: nodes.os.mem.used_in_bytes - - gte: { nodes.os.mem.free_percent: 0 } - - gte: { nodes.os.mem.used_percent: 0 } - - is_true: nodes.process - - is_true: nodes.jvm - - is_true: nodes.fs - - is_true: nodes.plugins - - is_true: nodes.network_types - ---- -"get cluster stats returns cluster_uuid at the top level": - - skip: - version: " - 6.99.99" - reason: "cluster stats including cluster_uuid at the top level is new in v6.5.0 and higher" - - - do: - cluster.stats: {} - - - is_true: cluster_uuid - - is_true: timestamp - - is_true: cluster_name - - match: {status: green} - - gte: { indices.count: 0} - - is_true: indices.docs - - is_true: indices.store - - is_true: indices.fielddata - - is_true: indices.query_cache - - is_true: indices.completion - - is_true: indices.segments - - gte: { nodes.count.total: 1} - - gte: { nodes.count.master: 1} - - gte: { nodes.count.data: 1} - - gte: { nodes.count.ingest: 0} - - gte: { nodes.count.coordinating_only: 0} - - is_true: nodes.os - - is_true: nodes.os.mem.total_in_bytes - - is_true: nodes.os.mem.free_in_bytes - - is_true: nodes.os.mem.used_in_bytes - - gte: { nodes.os.mem.free_percent: 0 } - - gte: { nodes.os.mem.used_percent: 0 } - - is_true: nodes.process - - is_true: nodes.jvm - - is_true: nodes.fs - - is_true: nodes.plugins - - is_true: nodes.network_types - ---- -"get cluster stats returns discovery types": - - skip: - version: " - 6.99.99" - reason: "discovery types are added for v7.0.0" - - - do: - cluster.stats: {} - - - is_true: nodes.discovery_types - ---- -"get cluster stats returns packaging types": - - - skip: - version: " - 7.1.99" - reason: "packaging types are added for v7.2.0" - - - do: - cluster.stats: {} - - - is_true: nodes.packaging_types - ---- -"get cluster stats returns mapping stats": - - - skip: - version: " - 7.6.99" - reason: "mapping stats are added for v7.7.0" - - - do: - cluster.stats: {} - - - length: { indices.mappings.field_types: 0 } - - - do: - indices.create: - index: test-index1 - body: - mappings: - properties: - foo: - type: keyword - - - do: - indices.create: - index: test-index2 - body: - mappings: - properties: - foo: - type: keyword - bar: - properties: - quux: - type: integer - baz: - type: keyword - - - do: - cluster.stats: {} - - - length: { indices.mappings.field_types: 3 } - - - match: { indices.mappings.field_types.0.name: integer } - - match: { indices.mappings.field_types.0.count: 1 } - - match: { indices.mappings.field_types.0.index_count: 1 } - - - match: { indices.mappings.field_types.1.name: keyword } - - match: { indices.mappings.field_types.1.count: 3 } - - match: { indices.mappings.field_types.1.index_count: 2 } - - - match: { indices.mappings.field_types.2.name: object } - - match: { indices.mappings.field_types.2.count: 1 } - - match: { indices.mappings.field_types.2.index_count: 1 } - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/count/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/count/10_basic.yml deleted file mode 100644 index 09d96670f688e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/count/10_basic.yml +++ /dev/null @@ -1,61 +0,0 @@ -setup: - - do: - indices.create: - index: test - - do: - index: - index: test - id: 1 - body: { foo: bar } - - - do: - indices.refresh: - index: [test] - ---- -"count with body": - - do: - count: - index: test - body: - query: - match: - foo: bar - - - match: {count : 1} - - - do: - count: - index: test - body: - query: - match: - foo: test - - - match: {count : 0} - ---- -"count with empty body": -# empty body should default to match_all query - - do: - count: - index: test - body: { } - - - match: {count : 1} - - - do: - count: - index: test - - - match: {count : 1} - ---- -"count body without query element": - - do: - catch: bad_request - count: - index: test - body: - match: - foo: bar diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/count/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/count/11_basic_with_types.yml deleted file mode 100644 index 48cfc610b435e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/count/11_basic_with_types.yml +++ /dev/null @@ -1,66 +0,0 @@ -setup: - - do: - indices.create: - index: test - - do: - index: - index: test - type: test - id: 1 - body: { foo: bar } - - - do: - indices.refresh: - index: [test] - ---- -"count with body": - - do: - count: - index: test - type: test - body: - query: - match: - foo: bar - - - match: {count : 1} - - - do: - count: - index: test - body: - query: - match: - foo: test - - - match: {count : 0} - ---- -"count with empty body": -# empty body should default to match_all query - - do: - count: - index: test - type: test - body: { } - - - match: {count : 1} - - - do: - count: - index: test - type: test - - - match: {count : 1} - ---- -"count body without query element": - - do: - catch: bad_request - count: - index: test - type: test - body: - match: - foo: bar diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/count/20_query_string.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/count/20_query_string.yml deleted file mode 100644 index 66b0699a184d2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/count/20_query_string.yml +++ /dev/null @@ -1,58 +0,0 @@ ---- -"count with query_string parameters": - - do: - indices.create: - index: test - body: - mappings: - properties: - number: - type: integer - - - do: - index: - index: test - id: 1 - body: { field: foo bar} - - - do: - indices.refresh: - index: [test] - - - do: - count: - index: test - q: bar - df: field - - - match: {count : 1} - - - do: - count: - index: test - q: field:foo field:xyz - - - match: {count : 1} - - - do: - count: - index: test - q: field:foo field:xyz - default_operator: AND - - - match: {count : 0} - - - do: - count: - index: test - q: field:BA* - - - match: {count : 1} - - - do: - count: - index: test - q: number:foo - lenient: true - - - match: {count : 0} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/10_with_id.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/10_with_id.yml deleted file mode 100644 index 410b31acb7138..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/create/10_with_id.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -"Create with ID": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - create: - index: test_1 - id: 1 - body: { foo: bar } - - - match: { _index: test_1 } - - match: { _id: "1"} - - match: { _version: 1} - - - do: - get: - index: test_1 - id: 1 - - - match: { _index: test_1 } - - match: { _id: "1"} - - match: { _version: 1} - - match: { _source: { foo: bar }} - - - do: - catch: conflict - create: - index: test_1 - id: 1 - body: { foo: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/11_with_id_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/11_with_id_with_types.yml deleted file mode 100644 index 1e58c38c7b589..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/create/11_with_id_with_types.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -"Create with ID": - - do: - create: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: "1"} - - match: { _version: 1} - - - do: - get: - index: test_1 - type: test - id: 1 - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: "1"} - - match: { _version: 1} - - match: { _source: { foo: bar }} - - - do: - catch: conflict - create: - index: test_1 - type: test - id: 1 - body: { foo: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id.yml deleted file mode 100644 index 5280c5bb9946d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -"Create without ID": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - catch: param - create: - index: test_1 - body: { foo: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id_with_types.yml deleted file mode 100644 index ab9932819381f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/create/15_without_id_with_types.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -"Create without ID": - - do: - catch: param - create: - index: test_1 - type: test - body: { foo: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/35_external_version.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/35_external_version.yml deleted file mode 100644 index 47dc5b6059609..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/create/35_external_version.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -"External version": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - catch: bad_request - create: - index: test - id: 1 - body: { foo: bar } - version_type: external - version: 0 - - - match: { status: 400 } - - match: { error.type: action_request_validation_exception } - - match: { error.reason: "Validation Failed: 1: create operations only support internal versioning. use index instead;" } - - - do: - catch: bad_request - create: - index: test - id: 2 - body: { foo: bar } - version_type: external - version: 5 - - - match: { status: 400 } - - match: { error.type: action_request_validation_exception } - - match: { error.reason: "Validation Failed: 1: create operations only support internal versioning. use index instead;" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/36_external_version_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/36_external_version_with_types.yml deleted file mode 100644 index cb8c041d7102c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/create/36_external_version_with_types.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -"External version": - - - do: - catch: bad_request - create: - index: test - type: test - id: 1 - body: { foo: bar } - version_type: external - version: 0 - - - match: { status: 400 } - - match: { error.type: action_request_validation_exception } - - match: { error.reason: "Validation Failed: 1: create operations only support internal versioning. use index instead;" } - - - do: - catch: bad_request - create: - index: test - type: test - id: 2 - body: { foo: bar } - version_type: external - version: 5 - - - match: { status: 400 } - - match: { error.type: action_request_validation_exception } - - match: { error.reason: "Validation Failed: 1: create operations only support internal versioning. use index instead;" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/40_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/40_routing.yml deleted file mode 100644 index 9c048c361bd5c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/create/40_routing.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -"Routing": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - create: - index: test_1 - id: 1 - routing: 5 - body: { foo: bar } - - - do: - get: - index: test_1 - id: 1 - routing: 5 - stored_fields: [_routing] - - - match: { _id: "1"} - - match: { _routing: "5"} - - - do: - catch: missing - get: - index: test_1 - id: 1 - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/41_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/41_routing_with_types.yml deleted file mode 100644 index 752489f722c9e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/create/41_routing_with_types.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -"Routing": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - create: - index: test_1 - type: test - id: 1 - routing: 5 - body: { foo: bar } - - - do: - get: - index: test_1 - type: test - id: 1 - routing: 5 - stored_fields: [_routing] - - - match: { _id: "1"} - - match: { _routing: "5"} - - - do: - catch: missing - get: - index: test_1 - type: test - id: 1 - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/60_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/60_refresh.yml deleted file mode 100644 index dd8acd9f99f4f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/create/60_refresh.yml +++ /dev/null @@ -1,86 +0,0 @@ ---- -"Refresh": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - indices.create: - index: test_1 - body: - settings: - index.refresh_interval: -1 - number_of_replicas: 0 - - do: - create: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - - match: { hits.total: 0 } - - - do: - create: - index: test_1 - id: 2 - refresh: true - body: { foo: bar } - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 2 }} - - - match: { hits.total: 1 } - ---- -"When refresh url parameter is an empty string that means \"refresh immediately\"": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - create: - index: test_1 - id: 1 - refresh: "" - body: { foo: bar } - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - - match: { hits.total: 1 } - ---- -"refresh=wait_for waits until changes are visible in search": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - index: - index: create_60_refresh_1 - id: create_60_refresh_id1 - body: { foo: bar } - refresh: wait_for - - is_false: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: create_60_refresh_1 - body: - query: { term: { _id: create_60_refresh_id1 }} - - match: { hits.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/61_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/61_refresh_with_types.yml deleted file mode 100644 index e24bdf4260340..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/create/61_refresh_with_types.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -"Refresh": - - - do: - indices.create: - index: test_1 - body: - settings: - index.refresh_interval: -1 - number_of_replicas: 0 - - do: - create: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - - match: { hits.total: 0 } - - - do: - create: - index: test_1 - type: test - id: 2 - refresh: true - body: { foo: bar } - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 2 }} - - - match: { hits.total: 1 } - ---- -"When refresh url parameter is an empty string that means \"refresh immediately\"": - - do: - create: - index: test_1 - type: test - id: 1 - refresh: "" - body: { foo: bar } - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - - match: { hits.total: 1 } - ---- -"refresh=wait_for waits until changes are visible in search": - - do: - index: - index: create_60_refresh_1 - type: test - id: create_60_refresh_id1 - body: { foo: bar } - refresh: wait_for - - is_false: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: create_60_refresh_1 - body: - query: { term: { _id: create_60_refresh_id1 }} - - match: { hits.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/70_nested.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/70_nested.yml deleted file mode 100644 index e6d2413f16788..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/create/70_nested.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -setup: - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - indices.create: - index: test_1 - body: - settings: - index.mapping.nested_objects.limit: 2 - mappings: - properties: - nested1: - type: nested - ---- -"Indexing a doc with No. nested objects less or equal to index.mapping.nested_objects.limit should succeed": - - skip: - version: " - 6.99.99" - reason: index.mapping.nested_objects setting has been added in 7.0.0 - - do: - create: - index: test_1 - id: 1 - body: - "nested1" : [ { "foo": "bar" }, { "foo": "bar2" } ] - - match: { _version: 1} - ---- -"Indexing a doc with No. nested objects more than index.mapping.nested_objects.limit should fail": - - skip: - version: " - 6.99.99" - reason: index.mapping.nested_objects setting has been added in 7.0.0 - - do: - catch: /The number of nested documents has exceeded the allowed limit of \[2\]. This limit can be set by changing the \[index.mapping.nested_objects.limit\] index level setting\./ - create: - index: test_1 - id: 1 - body: - "nested1" : [ { "foo": "bar" }, { "foo": "bar2" }, { "foo": "bar3" } ] diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/71_nested_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/create/71_nested_with_types.yml deleted file mode 100644 index 755aaca448b0b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/create/71_nested_with_types.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -setup: - - do: - indices.create: - include_type_name: true - index: test_1 - body: - settings: - index.mapping.nested_objects.limit: 2 - mappings: - test_type: - properties: - nested1: - type: nested - ---- -"Indexing a doc with No. nested objects less or equal to index.mapping.nested_objects.limit should succeed": - - skip: - version: " - 6.99.99" - reason: index.mapping.nested_objects setting has been added in 7.0.0 - - do: - create: - index: test_1 - type: test_type - id: 1 - body: - "nested1" : [ { "foo": "bar" }, { "foo": "bar2" } ] - - match: { _version: 1} - ---- -"Indexing a doc with No. nested objects more than index.mapping.nested_objects.limit should fail": - - skip: - version: " - 6.99.99" - reason: index.mapping.nested_objects setting has been added in 7.0.0 - - do: - catch: /The number of nested documents has exceeded the allowed limit of \[2\]. This limit can be set by changing the \[index.mapping.nested_objects.limit\] index level setting\./ - create: - index: test_1 - type: test_type - id: 1 - body: - "nested1" : [ { "foo": "bar" }, { "foo": "bar2" }, { "foo": "bar3" } ] diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/create/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/create/TODO.txt deleted file mode 100644 index 389a47c7b7a2c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/create/TODO.txt +++ /dev/null @@ -1,3 +0,0 @@ -Tests missing for: - -# consistency diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/10_basic.yml deleted file mode 100644 index 842d749d7b14d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/10_basic.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -"Basic": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - match: { _version: 1 } - - - do: - delete: - index: test_1 - id: 1 - - - match: { _version: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/11_shard_header.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/11_shard_header.yml deleted file mode 100644 index 3fc10bc8db12d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/11_shard_header.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -"Delete check shard header": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: foobar - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: foobar - id: 1 - body: { foo: bar } - - - do: - delete: - index: foobar - id: 1 - - - match: { _index: foobar } - - match: { _type: _doc } - - match: { _id: "1"} - - match: { _version: 2} - - match: { _shards.total: 1} - - match: { _shards.successful: 1} - - match: { _shards.failed: 0} - - is_false: _shards.pending diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/12_result.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/12_result.yml deleted file mode 100644 index 13356cd938c48..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/12_result.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -"Delete result field": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - delete: - index: test_1 - id: 1 - - - match: { result: deleted } - - - do: - catch: missing - delete: - index: test_1 - id: 1 - - - match: { result: not_found } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/13_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/13_basic_with_types.yml deleted file mode 100644 index a3671d5ac24b0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/13_basic_with_types.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -"Basic": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - match: { _version: 1 } - - - do: - delete: - index: test_1 - type: test - id: 1 - - - match: { _version: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/14_shard_header_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/14_shard_header_with_types.yml deleted file mode 100644 index d1bb4c0df347d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/14_shard_header_with_types.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -"Delete check shard header": - - - do: - indices.create: - index: foobar - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: foobar - type: baz - id: 1 - body: { foo: bar } - - - do: - delete: - index: foobar - type: baz - id: 1 - - - match: { _index: foobar } - - match: { _type: baz } - - match: { _id: "1"} - - match: { _version: 2} - - match: { _shards.total: 1} - - match: { _shards.successful: 1} - - match: { _shards.failed: 0} - - is_false: _shards.pending diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/15_result_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/15_result_with_types.yml deleted file mode 100644 index d01e88be8ad0b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/15_result_with_types.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -"Delete result field": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - delete: - index: test_1 - type: test - id: 1 - - - match: { result: deleted } - - - do: - catch: missing - delete: - index: test_1 - type: test - id: 1 - - - match: { result: not_found } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/20_cas.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/20_cas.yml deleted file mode 100644 index f3c7b0acbcccd..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/20_cas.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -"Internal version": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - match: { _seq_no: 0 } - - - do: - catch: conflict - delete: - index: test_1 - id: 1 - if_seq_no: 2 - if_primary_term: 1 - - - do: - delete: - index: test_1 - id: 1 - if_seq_no: 0 - if_primary_term: 1 - - - match: { _seq_no: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/21_cas_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/21_cas_with_types.yml deleted file mode 100644 index ef352a9bad6b1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/21_cas_with_types.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -"Internal version": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - match: { _seq_no: 0 } - - - do: - catch: conflict - delete: - index: test_1 - type: test - id: 1 - if_seq_no: 2 - if_primary_term: 1 - - - do: - delete: - index: test_1 - type: test - id: 1 - if_seq_no: 0 - if_primary_term: 1 - - - match: { _seq_no: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/25_external_version.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/25_external_version.yml deleted file mode 100644 index d7cc4fce0eda5..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/25_external_version.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -"External version": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - version_type: external - version: 5 - - - match: { _version: 5} - - - do: - catch: conflict - delete: - index: test_1 - id: 1 - version_type: external - version: 4 - - - do: - delete: - index: test_1 - id: 1 - version_type: external - version: 6 - - - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/26_external_gte_version.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/26_external_gte_version.yml deleted file mode 100644 index ebe1680551c96..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/26_external_gte_version.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -"External GTE version": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - version_type: external_gte - version: 5 - - - match: { _version: 5} - - - do: - catch: conflict - delete: - index: test_1 - id: 1 - version_type: external_gte - version: 4 - - - do: - delete: - index: test_1 - id: 1 - version_type: external_gte - version: 6 - - - match: { _version: 6} - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - version_type: external_gte - version: 6 - - - match: { _version: 6} - - - do: - delete: - index: test_1 - id: 1 - version_type: external_gte - version: 6 - - - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/27_external_version_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/27_external_version_with_types.yml deleted file mode 100644 index 453d64d85bbc1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/27_external_version_with_types.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -"External version": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external - version: 5 - - - match: { _version: 5} - - - do: - catch: conflict - delete: - index: test_1 - type: test - id: 1 - version_type: external - version: 4 - - - do: - delete: - index: test_1 - type: test - id: 1 - version_type: external - version: 6 - - - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/28_external_gte_version_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/28_external_gte_version_with_types.yml deleted file mode 100644 index 70f78c17faa63..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/28_external_gte_version_with_types.yml +++ /dev/null @@ -1,53 +0,0 @@ ---- -"External GTE version": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external_gte - version: 5 - - - match: { _version: 5} - - - do: - catch: conflict - delete: - index: test_1 - type: test - id: 1 - version_type: external_gte - version: 4 - - - do: - delete: - index: test_1 - type: test - id: 1 - version_type: external_gte - version: 6 - - - match: { _version: 6} - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external_gte - version: 6 - - - match: { _version: 6} - - - do: - delete: - index: test_1 - type: test - id: 1 - version_type: external_gte - version: 6 - - - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/30_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/30_routing.yml deleted file mode 100644 index 27e9350caed70..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/30_routing.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -"Routing": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - settings: - number_of_shards: 5 - - do: - index: - index: test_1 - id: 1 - routing: 5 - body: { foo: bar } - - - do: - catch: missing - delete: - index: test_1 - id: 1 - routing: 4 - - - do: - delete: - index: test_1 - id: 1 - routing: 5 - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/31_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/31_routing_with_types.yml deleted file mode 100644 index 6f67b3a03f401..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/31_routing_with_types.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -"Routing": - - - do: - indices.create: - index: test_1 - body: - settings: - number_of_shards: 5 - - do: - index: - index: test_1 - type: test - id: 1 - routing: 5 - body: { foo: bar } - - - do: - catch: missing - delete: - index: test_1 - type: test - id: 1 - routing: 4 - - - do: - delete: - index: test_1 - type: test - id: 1 - routing: 5 - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/50_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/50_refresh.yml deleted file mode 100644 index 935e0946f100b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/50_refresh.yml +++ /dev/null @@ -1,154 +0,0 @@ ---- -"Refresh": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - settings: - refresh_interval: -1 - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - refresh: true - -# If you wonder why this document get 3 as an id instead of 2, it is because the -# current routing algorithm would route 1 and 2 to the same shard while we need -# them to be different for this test to pass - - do: - index: - index: test_1 - id: 3 - body: { foo: bar } - refresh: true - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { terms: { _id: [1,3] }} - - - match: { hits.total: 2 } - - - do: - delete: - index: test_1 - id: 1 - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { terms: { _id: [1,3] }} - - - match: { hits.total: 2 } - - - do: - delete: - index: test_1 - id: 3 - refresh: true - -# If a replica shard where doc 1 is located gets initialized at this point, doc 1 -# won't be found by the following search as the shard gets automatically refreshed -# right before getting started. This is why this test only works with 0 replicas. - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { terms: { _id: [1,3] }} - - - match: { hits.total: 1 } - ---- -"When refresh url parameter is an empty string that means \"refresh immediately\"": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - refresh: true - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - match: { hits.total: 1 } - - - do: - delete: - index: test_1 - id: 1 - refresh: "" - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - match: { hits.total: 0 } - ---- -"refresh=wait_for waits until changes are visible in search": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: delete_50_refresh_1 - id: delete_50_refresh_id1 - body: { foo: bar } - refresh: true - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: delete_50_refresh_1 - body: - query: { term: { _id: delete_50_refresh_id1 }} - - match: { hits.total: 1 } - - - do: - delete: - index: delete_50_refresh_1 - id: delete_50_refresh_id1 - refresh: wait_for - - is_false: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: delete_50_refresh_1 - body: - query: { term: { _id: delete_50_refresh_id1 }} - - match: { hits.total: 0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/51_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/51_refresh_with_types.yml deleted file mode 100644 index a901c1033f7c0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/51_refresh_with_types.yml +++ /dev/null @@ -1,148 +0,0 @@ ---- -"Refresh": - - - do: - indices.create: - index: test_1 - body: - settings: - refresh_interval: -1 - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - refresh: true - -# If you wonder why this document get 3 as an id instead of 2, it is because the -# current routing algorithm would route 1 and 2 to the same shard while we need -# them to be different for this test to pass - - do: - index: - index: test_1 - type: test - id: 3 - body: { foo: bar } - refresh: true - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { terms: { _id: [1,3] }} - - - match: { hits.total: 2 } - - - do: - delete: - index: test_1 - type: test - id: 1 - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { terms: { _id: [1,3] }} - - - match: { hits.total: 2 } - - - do: - delete: - index: test_1 - type: test - id: 3 - refresh: true - -# If a replica shard where doc 1 is located gets initialized at this point, doc 1 -# won't be found by the following search as the shard gets automatically refreshed -# right before getting started. This is why this test only works with 0 replicas. - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { terms: { _id: [1,3] }} - - - match: { hits.total: 1 } - ---- -"When refresh url parameter is an empty string that means \"refresh immediately\"": - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - refresh: true - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - match: { hits.total: 1 } - - - do: - delete: - index: test_1 - type: test - id: 1 - refresh: "" - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - match: { hits.total: 0 } - ---- -"refresh=wait_for waits until changes are visible in search": - - do: - index: - index: delete_50_refresh_1 - type: test - id: delete_50_refresh_id1 - body: { foo: bar } - refresh: true - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: delete_50_refresh_1 - body: - query: { term: { _id: delete_50_refresh_id1 }} - - match: { hits.total: 1 } - - - do: - delete: - index: delete_50_refresh_1 - type: test - id: delete_50_refresh_id1 - refresh: wait_for - - is_false: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: delete_50_refresh_1 - body: - query: { term: { _id: delete_50_refresh_id1 }} - - match: { hits.total: 0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/60_missing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/60_missing.yml deleted file mode 100644 index b8f81080f3ee8..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/60_missing.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -"Missing document with catch": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - catch: missing - delete: - index: test_1 - id: 1 - ---- -"Missing document with ignore": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - delete: - index: test_1 - id: 1 - ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/61_missing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/61_missing_with_types.yml deleted file mode 100644 index 9cfdb48ae20aa..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/61_missing_with_types.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -"Missing document with catch": - - - do: - catch: missing - delete: - index: test_1 - type: test - id: 1 - ---- -"Missing document with ignore": - - - do: - delete: - index: test_1 - type: test - id: 1 - ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/70_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/70_mix_typeless_typeful.yml deleted file mode 100644 index e0f20795e41ca..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/70_mix_typeless_typeful.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -"DELETE with typeless API on an index that has types": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - - do: - index: - index: index - type: not_doc - id: 1 - body: { foo: bar } - - - do: - catch: bad_request - delete: - index: index - type: some_random_type - id: 1 - - - match: { error.root_cause.0.reason: "/Rejecting.mapping.update.to.\\[index\\].as.the.final.mapping.would.have.more.than.1.type.*/" } - - - do: - delete: - index: index - id: 1 - - - match: { _index: "index" } - - match: { _type: "_doc" } - - match: { _id: "1"} - - match: { _version: 2} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/delete/TODO.txt deleted file mode 100644 index 3124bcf6f437f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/delete/TODO.txt +++ /dev/null @@ -1,5 +0,0 @@ -Tests missing for: - -# consistency -# timeout - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/10_basic.yml deleted file mode 100644 index 1ab90e3efa83f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/10_basic.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -"Basic": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - exists: - index: test_1 - id: 1 - - - is_false: '' - - - do: - index: - index: test_1 - id: 1 - body: { "foo": "bar" } - - - is_true: '' - - - do: - exists: - index: test_1 - id: 1 - - - is_true: '' - - - do: - exists: - index: test_1 - id: 1 - version: 1 - - - is_true: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/11_basic_with_types.yml deleted file mode 100644 index 7e4e26b6b1c1c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/11_basic_with_types.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -"Basic": - - - do: - exists: - index: test_1 - type: test - id: 1 - - - is_false: '' - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "foo": "bar" } - - - is_true: '' - - - do: - exists: - index: test_1 - type: test - id: 1 - - - is_true: '' - - - do: - exists: - index: test_1 - type: test - id: 1 - version: 1 - - - is_true: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/40_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/40_routing.yml deleted file mode 100644 index 8d59c8a0535f5..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/40_routing.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -"Routing": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - id: 1 - routing: 5 - body: { foo: bar } - - - do: - exists: - index: test_1 - id: 1 - routing: 5 - - - is_true: '' - - - do: - exists: - index: test_1 - id: 1 - - - is_false: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/41_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/41_routing_with_types.yml deleted file mode 100644 index 25315628d7ece..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/41_routing_with_types.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -"Routing": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - routing: 5 - body: { foo: bar } - - - do: - exists: - index: test_1 - type: test - id: 1 - routing: 5 - - - is_true: '' - - - do: - exists: - index: test_1 - type: test - id: 1 - - - is_false: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/60_realtime_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/60_realtime_refresh.yml deleted file mode 100644 index e12a504349c4d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/60_realtime_refresh.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -"Realtime Refresh": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - settings: - index: - refresh_interval: -1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - exists: - index: test_1 - id: 1 - realtime: false - - - is_false: '' - - - do: - exists: - index: test_1 - id: 1 - realtime: true - - - is_true: '' - - - do: - exists: - index: test_1 - id: 1 - realtime: false - refresh: true - - - is_true: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/61_realtime_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/61_realtime_refresh_with_types.yml deleted file mode 100644 index df8c697e4a1fb..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/61_realtime_refresh_with_types.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -"Realtime Refresh": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - refresh_interval: -1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - exists: - index: test_1 - type: test - id: 1 - realtime: false - - - is_false: '' - - - do: - exists: - index: test_1 - type: test - id: 1 - realtime: true - - - is_true: '' - - - do: - exists: - index: test_1 - type: test - id: 1 - realtime: false - refresh: true - - - is_true: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/70_defaults.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/70_defaults.yml deleted file mode 100644 index 6fabdd59820cf..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/70_defaults.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -"Client-side default type": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { "foo": "bar" } - - - do: - exists: - index: test_1 - id: 1 - - - is_true: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/71_defaults_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/71_defaults_with_types.yml deleted file mode 100644 index 2db28f6634bd6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/71_defaults_with_types.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -"Client-side default type": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "foo": "bar" } - - - do: - exists: - index: test_1 - type: _all - id: 1 - - - is_true: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/exists/TODO.txt deleted file mode 100644 index 340ff579b41e0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/exists/TODO.txt +++ /dev/null @@ -1,3 +0,0 @@ -Tests missing for: - -# preference diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/10_basic.yml deleted file mode 100644 index bfe8da8d91519..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/10_basic.yml +++ /dev/null @@ -1,65 +0,0 @@ -setup: - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - aliases: - alias_1: - "filter" : { "term" : { "foo" : "bar"} } - - - do: - index: - index: test_1 - id: id_1 - body: { foo: bar, title: howdy } - - - do: - indices.refresh: {} - ---- -"Basic explain": - - - do: - explain: - index: test_1 - id: id_1 - body: - query: - match_all: {} - - - is_true: matched - - match: { explanation.value: 1 } - - match: { _index: test_1 } - - match: { _type: _doc } - - match: { _id: id_1 } - ---- -"Basic explain with alias": - - - do: - explain: - index: alias_1 - id: id_1 - body: - query: - match_all: {} - - - is_true: matched - - match: { explanation.value: 1 } - - match: { _index: test_1 } - - match: { _type: _doc } - - match: { _id: id_1 } - ---- -"Explain body without query element": - - do: - catch: bad_request - explain: - index: test_1 - id: id_1 - body: - match_all: {} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/11_basic_with_types.yml deleted file mode 100644 index 5f211435ae976..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/11_basic_with_types.yml +++ /dev/null @@ -1,66 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - aliases: - alias_1: - "filter" : { "term" : { "foo" : "bar"} } - - - do: - index: - index: test_1 - type: test - id: id_1 - body: { foo: bar, title: howdy } - - - do: - indices.refresh: {} - ---- -"Basic explain": - - - do: - explain: - index: test_1 - type: test - id: id_1 - body: - query: - match_all: {} - - - is_true: matched - - match: { explanation.value: 1 } - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: id_1 } - ---- -"Basic explain with alias": - - - do: - explain: - index: alias_1 - type: test - id: id_1 - body: - query: - match_all: {} - - - is_true: matched - - match: { explanation.value: 1 } - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: id_1 } - ---- -"Explain body without query element": - - do: - catch: bad_request - explain: - index: test_1 - type: test - id: id_1 - body: - match_all: {} - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/20_source_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/20_source_filtering.yml deleted file mode 100644 index ad596f980807b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/20_source_filtering.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -"Source filtering": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - - do: - indices.refresh: - index: test_1 - - - do: - explain: { index: test_1, id: 1, _source: false, body: { query: { match_all: {}} } } - - match: { _index: test_1 } - - match: { _type: _doc } - - match: { _id: "1" } - - is_false: get._source - - - do: - explain: { index: test_1, id: 1, _source: true, body: { query: { match_all: {}} } } - - match: { get._source.include.field1: v1 } - - - do: - explain: { index: test_1, id: 1, _source: include.field1, body: { query: { match_all: {}} } } - - match: { get._source.include.field1: v1 } - - is_false: get._source.include.field2 - - - do: - explain: { index: test_1, id: 1, _source_includes: include.field1, body: { query: { match_all: {}} } } - - match: { get._source.include.field1: v1 } - - is_false: get._source.include.field2 - - - do: - explain: { index: test_1, id: 1, _source_includes: "include.field1,include.field2", body: { query: { match_all: {}} } } - - match: { get._source.include.field1: v1 } - - match: { get._source.include.field2: v2 } - - is_false: get._source.count - - - do: - explain: { index: test_1, id: 1, _source_includes: include, _source_excludes: "*.field2", body: { query: { match_all: {}} } } - - match: { get._source.include.field1: v1 } - - is_false: get._source.include.field2 - - is_false: get._source.count diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/21_source_filtering_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/21_source_filtering_with_types.yml deleted file mode 100644 index e13edf7be5046..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/21_source_filtering_with_types.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -"Source filtering": - - do: - index: - index: test_1 - type: test - id: 1 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - - do: - indices.refresh: - index: test_1 - - - do: - explain: { index: test_1, type: test, id: 1, _source: false, body: { query: { match_all: {}} } } - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: "1" } - - is_false: get._source - - - do: - explain: { index: test_1, type: test, id: 1, _source: true, body: { query: { match_all: {}} } } - - match: { get._source.include.field1: v1 } - - - do: - explain: { index: test_1, type: test, id: 1, _source: include.field1, body: { query: { match_all: {}} } } - - match: { get._source.include.field1: v1 } - - is_false: get._source.include.field2 - - - do: - explain: { index: test_1, type: test, id: 1, _source_includes: include.field1, body: { query: { match_all: {}} } } - - match: { get._source.include.field1: v1 } - - is_false: get._source.include.field2 - - - do: - explain: { index: test_1, type: test, id: 1, _source_includes: "include.field1,include.field2", body: { query: { match_all: {}} } } - - match: { get._source.include.field1: v1 } - - match: { get._source.include.field2: v2 } - - is_false: get._source.count - - - do: - explain: { index: test_1, type: test, id: 1, _source_includes: include, _source_excludes: "*.field2", body: { query: { match_all: {}} } } - - match: { get._source.include.field1: v1 } - - is_false: get._source.include.field2 - - is_false: get._source.count diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/30_query_string.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/30_query_string.yml deleted file mode 100644 index ac34d4c2495f2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/30_query_string.yml +++ /dev/null @@ -1,67 +0,0 @@ ---- -"explain with query_string parameters": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test - body: - mappings: - properties: - number: - type: integer - - - do: - index: - index: test - id: 1 - body: { field: foo bar} - - - do: - indices.refresh: - index: [test] - - - do: - explain: - index: test - id: 1 - q: bar - df: field - - - is_true: matched - - - do: - explain: - index: test - id: 1 - q: field:foo field:xyz - - - is_true: matched - - - do: - explain: - index: test - id: 1 - q: field:foo field:xyz - default_operator: AND - - - is_false: matched - - - do: - explain: - index: test - id: 1 - q: field:BA* - - - is_true: matched - - - do: - explain: - index: test - id: 1 - q: number:foo - lenient: true - - - is_false: matched diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/31_query_string_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/31_query_string_with_types.yml deleted file mode 100644 index b6930688acf2d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/31_query_string_with_types.yml +++ /dev/null @@ -1,71 +0,0 @@ ---- -"explain with query_string parameters": - - do: - indices.create: - include_type_name: true - index: test - body: - mappings: - test: - properties: - number: - type: integer - - - do: - index: - index: test - type: test - id: 1 - body: { field: foo bar} - - - do: - indices.refresh: - index: [test] - - - do: - explain: - index: test - type: test - id: 1 - q: bar - df: field - - - is_true: matched - - - do: - explain: - index: test - type: test - id: 1 - q: field:foo field:xyz - - - is_true: matched - - - do: - explain: - index: test - type: test - id: 1 - q: field:foo field:xyz - default_operator: AND - - - is_false: matched - - - do: - explain: - index: test - type: test - id: 1 - q: field:BA* - - - is_true: matched - - - do: - explain: - index: test - type: test - id: 1 - q: number:foo - lenient: true - - - is_false: matched diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/40_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/40_mix_typeless_typeful.yml deleted file mode 100644 index 36fdbaa6b6f78..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/40_mix_typeless_typeful.yml +++ /dev/null @@ -1,57 +0,0 @@ ---- -"Explain with typeless API on an index that has types": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - - do: - index: - index: index - type: not_doc - id: 1 - body: { foo: bar } - - - do: - indices.refresh: {} - - - do: - catch: missing - explain: - index: index - type: some_random_type - id: 1 - body: - query: - match_all: {} - - - match: { _index: "index" } - - match: { _type: "some_random_type" } - - match: { _id: "1"} - - match: { matched: false} - - - do: - explain: - index: index - type: _doc #todo: make _explain typeless and remove this - id: 1 - body: - query: - match_all: {} - - - match: { _index: "index" } - - match: { _type: "_doc" } - - match: { _id: "1"} - - is_true: matched - - match: { explanation.value: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/explain/TODO.txt deleted file mode 100644 index 2362d9df8d4ad..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/explain/TODO.txt +++ /dev/null @@ -1,6 +0,0 @@ -Tests missing for: - -- everything :) - - -# preference diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/10_basic.yml deleted file mode 100644 index d125efa73011c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/10_basic.yml +++ /dev/null @@ -1,325 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test1 - body: - mappings: - properties: - text: - type: text - keyword: - type: keyword - number: - type: double - geo: - type: geo_point - misc: - type: text - object: - type: object - properties: - nested1 : - type : text - index: false - nested2: - type: float - doc_values: false - level1: - type: nested - properties: - level2: - type: object - properties: - leaf1: - type: text - index: false - - - do: - indices.create: - index: test2 - body: - mappings: - properties: - text: - type: text - keyword: - type: keyword - number: - type: double - date: - type: date - geo: - type: geo_point - object: - type: object - properties: - nested1 : - type : text - index: true - nested2: - type: float - doc_values: true - level1: - type: nested - properties: - level2: - type: object - properties: - leaf1: - type: text - index: false - - do: - indices.create: - index: test3 - body: - mappings: - properties: - text: - type: text - keyword: - type: keyword - number: - type: long - date: - type: date - geo: - type: keyword - object: - type: nested - properties: - nested1 : - type : long - index: false - nested2: - type: keyword - doc_values: false - level1: - type: object - properties: - level2: - type: object - properties: - leaf1: - type: text - index: false - ---- -"Get simple field caps": - - - do: - field_caps: - index: 'test1,test2,test3' - fields: [text, keyword, number, date, geo] - - - match: {fields.text.text.searchable: true} - - match: {fields.text.text.aggregatable: false} - - is_false: fields.text.text.indices - - is_false: fields.text.text.non_searchable_indices - - is_false: fields.text.text.non_aggregatable_indices - - match: {fields.keyword.keyword.searchable: true} - - match: {fields.keyword.keyword.aggregatable: true} - - is_false: fields.text.keyword.indices - - is_false: fields.text.keyword.non_searchable_indices - - is_false: fields.text.keyword.non_aggregatable_indices - - match: {fields.number.double.searchable: true} - - match: {fields.number.double.aggregatable: true} - - match: {fields.number.double.indices: ["test1", "test2"]} - - is_false: fields.number.double.non_searchable_indices - - is_false: fields.number.double.non_aggregatable_indices - - match: {fields.number.long.searchable: true} - - match: {fields.number.long.aggregatable: true} - - match: {fields.number.long.indices: ["test3"]} - - is_false: fields.number.long.non_searchable_indices - - is_false: fields.number.long.non_aggregatable_indices - - match: {fields.date.date.searchable: true} - - match: {fields.date.date.aggregatable: true} - - is_false: fields.date.date.indices - - is_false: fields.date.date.non_searchable_indices - - is_false: fields.date.date.non_aggregatable_indices - - match: {fields.geo.geo_point.searchable: true} - - match: {fields.geo.geo_point.aggregatable: true} - - match: {fields.geo.geo_point.indices: ["test1", "test2"]} - - is_false: fields.geo.geo_point.non_searchable_indices - - is_false: fields.geo.geo_point.non_aggregatable_indices - - match: {fields.geo.keyword.searchable: true} - - match: {fields.geo.keyword.aggregatable: true} - - match: {fields.geo.keyword.indices: ["test3"]} - - is_false: fields.geo.keyword.non_searchable_indices - - is_false: fields.geo.keyword.on_aggregatable_indices ---- -"Get date_nanos field caps": - - skip: - version: " - 6.99.99" - reason: date_nanos field mapping type has been introcued in 7.0 - - - do: - indices.create: - include_type_name: false - index: test_nanos - body: - mappings: - properties: - date_nanos: - type: date_nanos - - - do: - field_caps: - index: 'test_nanos' - fields: [date_nanos] - - - match: {fields.date_nanos.date_nanos.searchable: true} - - match: {fields.date_nanos.date_nanos.aggregatable: true} - - is_false: fields.date_nanos.date_nanos.indices - - is_false: fields.date_nanos.date_nanos.non_searchable_indices - - is_false: fields.date_nanos.date_nanos.non_aggregatable_indices - ---- -"Get leaves field caps": - - - do: - field_caps: - index: 'test1,test2,test3' - fields: object* - - - match: {fields.object\.nested1.long.searchable: false} - - match: {fields.object\.nested1.long.aggregatable: true} - - match: {fields.object\.nested1.long.indices: ["test3"]} - - is_false: fields.object\.nested1.long.non_searchable_indices - - is_false: fields.object\.nested1.long.non_aggregatable_indices - - match: {fields.object\.nested1.text.searchable: false} - - match: {fields.object\.nested1.text.aggregatable: false} - - match: {fields.object\.nested1.text.indices: ["test1", "test2"]} - - match: {fields.object\.nested1.text.non_searchable_indices: ["test1"]} - - is_false: fields.object\.nested1.text.non_aggregatable_indices - - match: {fields.object\.nested2.float.searchable: true} - - match: {fields.object\.nested2.float.aggregatable: false} - - match: {fields.object\.nested2.float.indices: ["test1", "test2"]} - - match: {fields.object\.nested2.float.non_aggregatable_indices: ["test1"]} - - is_false: fields.object\.nested2.float.non_searchable_indices - - match: {fields.object\.nested2.keyword.searchable: true} - - match: {fields.object\.nested2.keyword.aggregatable: false} - - match: {fields.object\.nested2.keyword.indices: ["test3"]} - - is_false: fields.object\.nested2.keyword.non_aggregatable_indices - - is_false: fields.object\.nested2.keyword.non_searchable_indices ---- -"Get object and nested field caps": - - skip: - version: " - 6.99.99" - reason: object and nested fields are returned since 7.0 - - - do: - field_caps: - index: 'test1,test2,test3' - fields: object*,level1* - - - match: {fields.object.object.indices: ["test1", "test2"]} - - match: {fields.object.object.searchable: false} - - match: {fields.object.object.aggregatable: false} - - is_false: fields.object.object.non_aggregatable_indices - - is_false: fields.object.object.non_searchable_indices - - match: {fields.object.nested.indices: ["test3"]} - - match: {fields.object.nested.searchable: false} - - match: {fields.object.nested.aggregatable: false} - - is_false: fields.object.nested.non_aggregatable_indices - - is_false: fields.object.nested.non_searchable_indices - - match: {fields.level1.nested.indices: ["test1", "test2"]} - - match: {fields.level1.nested.searchable: false} - - match: {fields.level1.nested.aggregatable: false} - - is_false: fields.level1.nested.non_aggregatable_indices - - is_false: fields.level1.nested.non_searchable_indices - - match: {fields.level1.object.indices: ["test3"]} - - match: {fields.level1.object.searchable: false} - - match: {fields.level1.object.aggregatable: false} - - is_false: fields.level1.object.non_aggregatable_indices - - is_false: fields.level1.object.non_searchable_indices - - match: {fields.level1\.level2.object.searchable: false} - - match: {fields.level1\.level2.object.aggregatable: false} - - is_false: fields.level1\.level2.object.indices - - is_false: fields.level1\.level2.object.non_aggregatable_indices - - is_false: fields.level1\.level2.object.non_searchable_indices - - match: {fields.level1\.level2\.leaf1.text.searchable: false} - - match: {fields.level1\.level2\.leaf1.text.aggregatable: false} - - is_false: fields.level1\.level2\.leaf1.text.indices - - is_false: fields.level1\.level2\.leaf1.text.non_aggregatable_indices - - is_false: fields.level1\.level2\.leaf1.text..non_searchable_indices ---- -"Get prefix field caps": - - - do: - field_caps: - index: _all - fields: "n*" - - match: {fields.number.double.searchable: true} - - match: {fields.number.double.aggregatable: true} - - match: {fields.number.double.indices: ["test1", "test2"]} - - is_false: fields.number.double.non_searchable_indices - - is_false: fields.number.double.non_aggregatable_indices - - match: {fields.number.long.searchable: true} - - match: {fields.number.long.aggregatable: true} - - match: {fields.number.long.indices: ["test3"]} - - is_false: fields.number.long.non_searchable_indices - - is_false: fields.number.long.non_aggregatable_indices - ---- -"Mix in non-existing field field caps": - - - do: - field_caps: - index: 'test1,test2,test3' - fields: [text, keyword, no_such_field, number, geo] - - - match: {fields.text.text.searchable: true} - - match: {fields.text.text.aggregatable: false} - - is_false: fields.text.text.indices - - is_false: fields.text.text.non_searchable_indices - - is_false: fields.text.text.non_aggregatable_indices - - match: {fields.keyword.keyword.searchable: true} - - match: {fields.keyword.keyword.aggregatable: true} - - is_false: fields.text.keyword.indices - - is_false: fields.text.keyword.non_searchable_indices - - is_false: fields.text.keyword.non_aggregatable_indices - - match: {fields.number.double.searchable: true} - - match: {fields.number.double.aggregatable: true} - - match: {fields.number.double.indices: ["test1", "test2"]} - - is_false: fields.number.double.non_searchable_indices - - is_false: fields.number.double.non_aggregatable_indices - - match: {fields.number.long.searchable: true} - - match: {fields.number.long.aggregatable: true} - - match: {fields.number.long.indices: ["test3"]} - - is_false: fields.number.long.non_searchable_indices - - is_false: fields.number.long.non_aggregatable_indices - - match: {fields.geo.geo_point.searchable: true} - - match: {fields.geo.geo_point.aggregatable: true} - - match: {fields.geo.geo_point.indices: ["test1", "test2"]} - - is_false: fields.geo.geo_point.non_searchable_indices - - is_false: fields.geo.geo_point.non_aggregatable_indices - - match: {fields.geo.keyword.searchable: true} - - match: {fields.geo.keyword.aggregatable: true} - - match: {fields.geo.keyword.indices: ["test3"]} - - is_false: fields.geo.keyword.non_searchable_indices - - is_false: fields.geo.keyword.on_aggregatable_indices - ---- -"Field caps with include_unmapped": - - skip: - version: " - 7.1.99" - reason: include_unmapped has been added in 7.2.0 - - - do: - field_caps: - include_unmapped: true - index: 'test1,test2,test3' - fields: [text, misc] - - - match: {fields.text.text.searchable: true} - - match: {fields.text.text.aggregatable: false} - - is_false: fields.text.text.indices - - is_false: fields.text.text.non_searchable_indices - - is_false: fields.text.text.non_aggregatable_indices - - match: {fields.misc.text.searchable: true} - - match: {fields.misc.text.aggregatable: false} - - match: {fields.misc.text.indices: ["test1"]} - - match: {fields.misc.unmapped.searchable: false} - - match: {fields.misc.unmapped.aggregatable: false} - - match: {fields.misc.unmapped.indices: ["test2", "test3"]} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/20_meta.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/20_meta.yml deleted file mode 100644 index f299e72d00d0e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/field_caps/20_meta.yml +++ /dev/null @@ -1,65 +0,0 @@ ---- -"Merge metadata across multiple indices": - - - skip: - version: " - 7.5.99" - reason: Metadata support was added in 7.6 - - - do: - indices.create: - index: test1 - body: - mappings: - properties: - latency: - type: long - meta: - unit: ms - metric_type: gauge - - - do: - indices.create: - index: test2 - body: - mappings: - properties: - latency: - type: long - meta: - unit: ns - metric_type: gauge - - - do: - indices.create: - index: test3 - - - do: - field_caps: - index: test3 - fields: [latency] - - - is_false: fields.latency.long.meta.unit - - - do: - field_caps: - index: test1 - fields: [latency] - - - match: {fields.latency.long.meta.unit: ["ms"]} - - match: {fields.latency.long.meta.metric_type: ["gauge"]} - - - do: - field_caps: - index: test1,test3 - fields: [latency] - - - match: {fields.latency.long.meta.unit: ["ms"]} - - match: {fields.latency.long.meta.metric_type: ["gauge"]} - - - do: - field_caps: - index: test1,test2,test3 - fields: [latency] - - - match: {fields.latency.long.meta.unit: ["ms", "ns"]} - - match: {fields.latency.long.meta.metric_type: ["gauge"]} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/100_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/100_mix_typeless_typeful.yml deleted file mode 100644 index d13229dbffbc6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/100_mix_typeless_typeful.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -"GET with typeless API on an index that has types": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - - do: - index: - index: index - type: not_doc - id: 1 - body: { foo: bar } - - - do: - catch: missing - get: - index: index - type: some_random_type - id: 1 - - - match: { _index: "index" } - - match: { _type: "some_random_type" } - - match: { _id: "1"} - - match: { found: false} - - - do: - get: - index: index - id: 1 - - - match: { _index: "index" } - - match: { _type: "_doc" } - - match: { _id: "1"} - - match: { _version: 1} - - match: { _source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/10_basic.yml deleted file mode 100644 index 9183c70c29bce..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/10_basic.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -"Basic": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 中文 - body: { "foo": "Hello: 中文" } - - - do: - get: - index: test_1 - id: 中文 - - - match: { _index: test_1 } - - match: { _type: _doc } - - match: { _id: 中文 } - - match: { _source: { foo: "Hello: 中文" } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/11_basic_with_types.yml deleted file mode 100644 index 0689f714d6416..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/11_basic_with_types.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -"Basic": - - - do: - index: - index: test_1 - type: test - id: 中文 - body: { "foo": "Hello: 中文" } - - - do: - get: - index: test_1 - type: test - id: 中文 - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: 中文 } - - match: { _source: { foo: "Hello: 中文" } } - - - do: - get: - index: test_1 - type: _all - id: 中文 - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: 中文 } - - match: { _source: { foo: "Hello: 中文" } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/15_default_values.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/15_default_values.yml deleted file mode 100644 index 67065270665cf..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/15_default_values.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -"Default values": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - index: - index: test_1 - id: 1 - body: { "foo": "bar" } - - - do: - get: - index: test_1 - id: 1 - - - match: { _index: test_1 } - - match: { _type: _doc } - - match: { _id: '1' } - - match: { _source: { foo: "bar" } } - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/16_default_values_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/16_default_values_with_types.yml deleted file mode 100644 index 5e08112253ef0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/16_default_values_with_types.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -"Default values": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "foo": "bar" } - - - do: - get: - index: test_1 - type: _all - id: 1 - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: '1' } - - match: { _source: { foo: "bar" } } - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/20_stored_fields.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/20_stored_fields.yml deleted file mode 100644 index ab27842e4516e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/20_stored_fields.yml +++ /dev/null @@ -1,57 +0,0 @@ ---- -"Stored fields": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - indices.create: - index: test_1 - body: - mappings: - properties: - foo: - type: keyword - store: true - count: - type: integer - store: true - - - do: - index: - index: test_1 - id: 1 - body: { "foo": "bar", "count": 1 } - - do: - get: - index: test_1 - id: 1 - stored_fields: foo - - - match: { _index: test_1 } - - match: { _type: _doc } - - match: { _id: '1' } - - match: { fields.foo: [bar] } - - is_false: _source - - - do: - get: - index: test_1 - id: 1 - stored_fields: [foo, count] - - - match: { fields.foo: [bar] } - - match: { fields.count: [1] } - - is_false: _source - - - do: - get: - index: test_1 - id: 1 - stored_fields: [foo, count, _source] - - - match: { fields.foo: [bar] } - - match: { fields.count: [1] } - - match: { _source.foo: bar } - - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/21_stored_fields_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/21_stored_fields_with_types.yml deleted file mode 100644 index d1862fc0340d8..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/21_stored_fields_with_types.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -"Stored fields": - - - do: - indices.create: - include_type_name: true - index: test_1 - body: - mappings: - test: - properties: - foo: - type: keyword - store: true - count: - type: integer - store: true - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "foo": "bar", "count": 1 } - - do: - get: - index: test_1 - type: test - id: 1 - stored_fields: foo - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: '1' } - - match: { fields.foo: [bar] } - - is_false: _source - - - do: - get: - index: test_1 - type: test - id: 1 - stored_fields: [foo, count] - - - match: { fields.foo: [bar] } - - match: { fields.count: [1] } - - is_false: _source - - - do: - get: - index: test_1 - type: test - id: 1 - stored_fields: [foo, count, _source] - - - match: { fields.foo: [bar] } - - match: { fields.count: [1] } - - match: { _source.foo: bar } - - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/40_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/40_routing.yml deleted file mode 100644 index 9ba546d6ef942..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/40_routing.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -"Routing": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - id: 1 - routing: 5 - body: { foo: bar } - - - do: - get: - index: test_1 - id: 1 - routing: 5 - stored_fields: [_routing] - - - match: { _id: "1"} - - match: { _routing: "5"} - - - do: - catch: missing - get: - index: test_1 - id: 1 - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/41_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/41_routing_with_types.yml deleted file mode 100644 index 276346cda4f98..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/41_routing_with_types.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -"Routing": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - routing: 5 - body: { foo: bar } - - - do: - get: - index: test_1 - type: test - id: 1 - routing: 5 - stored_fields: [_routing] - - - match: { _id: "1"} - - match: { _routing: "5"} - - - do: - catch: missing - get: - index: test_1 - type: test - id: 1 - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/50_with_headers.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/50_with_headers.yml deleted file mode 100644 index 38130cee59810..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/50_with_headers.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -"REST test with headers": - - skip: - features: ["headers", "yaml"] - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - index: - index: test_1 - id: 1 - body: { "body": "foo" } - - - do: - headers: - Accept: application/yaml - get: - index: test_1 - id: 1 - - - match: {_index: "test_1"} - - match: { _type: _doc } - - match: {_id: "1"} - - match: {_version: 1} - - match: {found: true} - - match: { _source: { body: foo }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/51_with_headers_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/51_with_headers_with_types.yml deleted file mode 100644 index b88dbaafc4fb2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/51_with_headers_with_types.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -"REST test with headers": - - skip: - features: ["headers", "yaml"] - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "body": "foo" } - - - do: - headers: - Accept: application/yaml - get: - index: test_1 - type: _all - id: 1 - - - match: {_index: "test_1"} - - match: {_type: "test"} - - match: {_id: "1"} - - match: {_version: 1} - - match: {found: true} - - match: { _source: { body: foo }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/60_realtime_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/60_realtime_refresh.yml deleted file mode 100644 index ef4fa60bf1b0e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/60_realtime_refresh.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -"Realtime Refresh": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - settings: - index: - refresh_interval: -1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - catch: missing - get: - index: test_1 - id: 1 - realtime: false - - - do: - get: - index: test_1 - id: 1 - realtime: true - - - is_true: found - - - do: - get: - index: test_1 - id: 1 - realtime: false - refresh: true - - - is_true: found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/61_realtime_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/61_realtime_refresh_with_types.yml deleted file mode 100644 index 7d02b4667efe7..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/61_realtime_refresh_with_types.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -"Realtime Refresh": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - refresh_interval: -1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - catch: missing - get: - index: test_1 - type: test - id: 1 - realtime: false - - - do: - get: - index: test_1 - type: test - id: 1 - realtime: true - - - is_true: found - - - do: - get: - index: test_1 - type: test - id: 1 - realtime: false - refresh: true - - - is_true: found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/70_source_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/70_source_filtering.yml deleted file mode 100644 index f4a5ba39be3b8..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/70_source_filtering.yml +++ /dev/null @@ -1,68 +0,0 @@ ---- -"Source filtering": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - indices.create: - index: test_1 - body: - mappings: - properties: - count: - type: integer - store: true - - - do: - index: - index: test_1 - id: 1 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - - do: - get: { index: test_1, id: 1, _source: false } - - - match: { _index: test_1 } - - match: { _type: _doc } - - match: { _id: "1" } - - is_false: _source - - - do: - get: { index: test_1, id: 1, _source: true } - - match: { _source.include.field1: v1 } - - - do: - get: { index: test_1, id: 1, _source: include.field1 } - - match: { _source.include.field1: v1 } - - is_false: _source.include.field2 - - - do: - get: { index: test_1, id: 1, _source_includes: include.field1 } - - match: { _source.include.field1: v1 } - - is_false: _source.include.field2 - - - do: - get: { index: test_1, id: 1, _source_includes: "include.field1,include.field2" } - - match: { _source.include.field1: v1 } - - match: { _source.include.field2: v2 } - - is_false: _source.count - - - do: - get: { index: test_1, id: 1, _source_includes: include, _source_excludes: "*.field2" } - - match: { _source.include.field1: v1 } - - is_false: _source.include.field2 - - is_false: _source.count - - - - do: - get: - index: test_1 - id: 1 - stored_fields: count - _source: true - - - match: { _index: test_1 } - - match: { _type: _doc } - - match: { _id: "1" } - - match: { fields.count: [1] } - - match: { _source.include.field1: v1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/71_source_filtering_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/71_source_filtering_with_types.yml deleted file mode 100644 index 3ac493c629f20..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/71_source_filtering_with_types.yml +++ /dev/null @@ -1,69 +0,0 @@ ---- -"Source filtering": - - - do: - indices.create: - include_type_name: true - index: test_1 - body: - mappings: - test: - properties: - count: - type: integer - store: true - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - - do: - get: { index: test_1, type: test, id: 1, _source: false } - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: "1" } - - is_false: _source - - - do: - get: { index: test_1, type: test, id: 1, _source: true } - - match: { _source.include.field1: v1 } - - - do: - get: { index: test_1, type: test, id: 1, _source: include.field1 } - - match: { _source.include.field1: v1 } - - is_false: _source.include.field2 - - - do: - get: { index: test_1, type: test, id: 1, _source_includes: include.field1 } - - match: { _source.include.field1: v1 } - - is_false: _source.include.field2 - - - do: - get: { index: test_1, type: test, id: 1, _source_includes: "include.field1,include.field2" } - - match: { _source.include.field1: v1 } - - match: { _source.include.field2: v2 } - - is_false: _source.count - - - do: - get: { index: test_1, type: test, id: 1, _source_includes: include, _source_excludes: "*.field2" } - - match: { _source.include.field1: v1 } - - is_false: _source.include.field2 - - is_false: _source.count - - - - do: - get: - index: test_1 - type: test - id: 1 - stored_fields: count - _source: true - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: "1" } - - match: { fields.count: [1] } - - match: { _source.include.field1: v1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/80_missing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/80_missing.yml deleted file mode 100644 index d7d8edfc65dcb..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/80_missing.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -"Missing document with catch": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - catch: missing - get: - index: test_1 - id: 1 - ---- -"Missing document with ignore": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - get: - index: test_1 - id: 1 - ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/81_missing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/81_missing_with_types.yml deleted file mode 100644 index a60d11388566d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/81_missing_with_types.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -"Missing document with catch": - - - do: - catch: missing - get: - index: test_1 - type: test - id: 1 - ---- -"Missing document with ignore": - - - do: - get: - index: test_1 - type: test - id: 1 - ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/90_versions.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/90_versions.yml deleted file mode 100644 index 9037a9113e937..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/90_versions.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -"Versions": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - match: { _version: 1} - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - match: { _version: 2} - - - do: - get: - index: test_1 - id: 1 - version: 2 - - match: { _id: "1" } - - - do: - catch: conflict - get: - index: test_1 - id: 1 - version: 1 - - - do: - get: - index: test_1 - id: 1 - version: 2 - version_type: external - - match: { _id: "1" } - - - do: - catch: conflict - get: - index: test_1 - id: 1 - version: 10 - version_type: external - - - do: - catch: conflict - get: - index: test_1 - id: 1 - version: 1 - version_type: external - - - do: - get: - index: test_1 - id: 1 - version: 2 - version_type: external_gte - - match: { _id: "1" } - - - do: - catch: conflict - get: - index: test_1 - id: 1 - version: 10 - version_type: external_gte - - - do: - catch: conflict - get: - index: test_1 - id: 1 - version: 1 - version_type: external_gte - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/91_versions_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get/91_versions_with_types.yml deleted file mode 100644 index c6631b83b1867..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/91_versions_with_types.yml +++ /dev/null @@ -1,89 +0,0 @@ ---- -"Versions": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - match: { _version: 1} - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - match: { _version: 2} - - - do: - get: - index: test_1 - type: test - id: 1 - version: 2 - - match: { _id: "1" } - - - do: - catch: conflict - get: - index: test_1 - type: test - id: 1 - version: 1 - - - do: - get: - index: test_1 - type: test - id: 1 - version: 2 - version_type: external - - match: { _id: "1" } - - - do: - catch: conflict - get: - index: test_1 - type: test - id: 1 - version: 10 - version_type: external - - - do: - catch: conflict - get: - index: test_1 - type: test - id: 1 - version: 1 - version_type: external - - - do: - get: - index: test_1 - type: test - id: 1 - version: 2 - version_type: external_gte - - match: { _id: "1" } - - - do: - catch: conflict - get: - index: test_1 - type: test - id: 1 - version: 10 - version_type: external_gte - - - do: - catch: conflict - get: - index: test_1 - type: test - id: 1 - version: 1 - version_type: external_gte - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/get/TODO.txt deleted file mode 100644 index 340ff579b41e0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get/TODO.txt +++ /dev/null @@ -1,3 +0,0 @@ -Tests missing for: - -# preference diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/10_basic.yml deleted file mode 100644 index 6f81c430c883a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/10_basic.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -"Basic": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { "foo": "bar" } - - - do: - get_source: - index: test_1 - id: 1 - - - match: { '': { foo: bar } } - - - do: - get_source: - index: test_1 - id: 1 - - - match: { '': { foo: bar } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/11_basic_with_types.yml deleted file mode 100644 index 1446f569e86d8..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/11_basic_with_types.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -"Basic with types": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "foo": "bar" } - - - do: - get_source: - index: test_1 - type: test - id: 1 - - - match: { '': { foo: bar } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/15_default_values.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/15_default_values.yml deleted file mode 100644 index 57c11a1ca10e2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/15_default_values.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -"Default values": - - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { "foo": "bar" } - - - do: - get_source: - index: test_1 - id: 1 - - - match: { '': { foo: bar } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/16_default_values_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/16_default_values_with_types.yml deleted file mode 100644 index e2de7a9f0007c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/16_default_values_with_types.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -"Default values": - - do: - index: - index: test_1 - type: test - id: 1 - body: { "foo": "bar" } - - - do: - get_source: - index: test_1 - type: test - id: 1 - - - match: { '': { foo: bar } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/40_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/40_routing.yml deleted file mode 100644 index 6425f70f26aad..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/40_routing.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -"Routing": - - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - id: 1 - routing: 5 - body: { foo: bar } - - - do: - get_source: - index: test_1 - id: 1 - routing: 5 - - - match: { '': {foo: bar}} - - - do: - catch: missing - get_source: - index: test_1 - id: 1 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/41_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/41_routing_with_types.yml deleted file mode 100644 index db53a33ba597e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/41_routing_with_types.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -"Routing": - - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - routing: 5 - body: { foo: bar } - - - do: - get_source: - index: test_1 - type: test - id: 1 - routing: 5 - - - match: { '': {foo: bar}} - - - do: - catch: missing - get_source: - index: test_1 - type: test - id: 1 - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/60_realtime_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/60_realtime_refresh.yml deleted file mode 100644 index d39b07a6ce5f7..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/60_realtime_refresh.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -"Realtime": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - settings: - refresh_interval: -1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - catch: missing - get_source: - index: test_1 - id: 1 - realtime: false - - - do: - get_source: - index: test_1 - id: 1 - realtime: true - - - match: { '': {foo: bar}} - - - do: - get_source: - index: test_1 - id: 1 - realtime: false - refresh: true - - - match: { '': {foo: bar}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/61_realtime_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/61_realtime_refresh_with_types.yml deleted file mode 100644 index f5b406de28b4a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/61_realtime_refresh_with_types.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -"Realtime": - - - do: - indices.create: - index: test_1 - body: - settings: - refresh_interval: -1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - catch: missing - get_source: - index: test_1 - type: test - id: 1 - realtime: false - - - do: - get_source: - index: test_1 - type: test - id: 1 - realtime: true - - - match: { '': {foo: bar}} - - - do: - get_source: - index: test_1 - type: test - id: 1 - realtime: false - refresh: true - - - match: { '': {foo: bar}} - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/70_source_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/70_source_filtering.yml deleted file mode 100644 index 2665458cea95d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/70_source_filtering.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -"Source filtering": - - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - - - do: - get_source: { index: test_1, id: 1, _source_includes: include.field1 } - - match: { include.field1: v1 } - - is_false: include.field2 - - - do: - get_source: { index: test_1, id: 1, _source_includes: "include.field1,include.field2" } - - match: { include.field1: v1 } - - match: { include.field2: v2 } - - is_false: count - - - do: - get_source: { index: test_1, id: 1, _source_includes: include, _source_excludes: "*.field2" } - - match: { include.field1: v1 } - - is_false: include.field2 - - is_false: count diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/71_source_filtering_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/71_source_filtering_with_types.yml deleted file mode 100644 index b4f20fee53be2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/71_source_filtering_with_types.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -"Source filtering": - - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - - - do: - get_source: { index: test_1, type: test, id: 1, _source_includes: include.field1 } - - match: { include.field1: v1 } - - is_false: include.field2 - - - do: - get_source: { index: test_1, type: test, id: 1, _source_includes: "include.field1,include.field2" } - - match: { include.field1: v1 } - - match: { include.field2: v2 } - - is_false: count - - - do: - get_source: { index: test_1, type: test, id: 1, _source_includes: include, _source_excludes: "*.field2" } - - match: { include.field1: v1 } - - is_false: include.field2 - - is_false: count diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/80_missing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/80_missing.yml deleted file mode 100644 index b704fc2612007..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/80_missing.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -"Missing document with catch": - - - skip: - features: warnings - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - catch: missing - get_source: - index: test_1 - id: 1 - ---- -"Missing document with ignore": - - - skip: - features: warnings - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - get_source: - index: test_1 - id: 1 - ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/81_missing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/81_missing_with_types.yml deleted file mode 100644 index 16eb5ea51e898..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/81_missing_with_types.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -"Missing document with catch": - - - do: - catch: missing - get_source: - index: test_1 - type: test - id: 1 - ---- -"Missing document with ignore": - - - do: - get_source: - index: test_1 - type: test - id: 1 - ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/85_source_missing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/85_source_missing.yml deleted file mode 100644 index c214bf87d3997..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/85_source_missing.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -setup: - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - mappings: - _source: { enabled: false } - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - ---- -"Missing document source with catch": - - - do: - catch: missing - get_source: - index: test_1 - id: 1 - ---- -"Missing document source with ignore": - - - do: - get_source: - index: test_1 - id: 1 - ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/86_source_missing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/86_source_missing_with_types.yml deleted file mode 100644 index d7cfced5164ec..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/86_source_missing_with_types.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -setup: - - - do: - indices.create: - include_type_name: true - index: test_1 - body: - mappings: - test: - _source: { enabled: false } - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - ---- -"Missing document source with catch": - - - do: - catch: missing - get_source: - index: test_1 - type: test - id: 1 - ---- -"Missing document source with ignore": - - - do: - get_source: - index: test_1 - type: test - id: 1 - ignore: 404 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/TODO.txt deleted file mode 100644 index 340ff579b41e0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/get_source/TODO.txt +++ /dev/null @@ -1,3 +0,0 @@ -Tests missing for: - -# preference diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/10_with_id.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/10_with_id.yml deleted file mode 100644 index a129dcab80d9a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/10_with_id.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -"Index with ID": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test-weird-index-中文 - id: 1 - body: { foo: bar } - - - match: { _index: test-weird-index-中文 } - - match: { _type: _doc } - - match: { _id: "1"} - - match: { _version: 1} - - - do: - get: - index: test-weird-index-中文 - id: 1 - - - match: { _index: test-weird-index-中文 } - - match: { _type: _doc } - - match: { _id: "1"} - - match: { _version: 1} - - match: { _source: { foo: bar }} - - - do: - catch: bad_request - index: - index: idx - id: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - body: { foo: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/11_with_id_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/11_with_id_with_types.yml deleted file mode 100644 index daac81849fb5e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/11_with_id_with_types.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -"Index with ID": - - - do: - index: - index: test-weird-index-中文 - type: weird.type - id: 1 - body: { foo: bar } - - - match: { _index: test-weird-index-中文 } - - match: { _type: weird.type } - - match: { _id: "1"} - - match: { _version: 1} - - - do: - get: - index: test-weird-index-中文 - type: weird.type - id: 1 - - - match: { _index: test-weird-index-中文 } - - match: { _type: weird.type } - - match: { _id: "1"} - - match: { _version: 1} - - match: { _source: { foo: bar }} - - - do: - catch: bad_request - index: - index: idx - type: type - id: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - body: { foo: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/12_result.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/12_result.yml deleted file mode 100644 index f8a50415a95ef..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/12_result.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -"Index result field": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - index: - index: test_index - id: 1 - body: { foo: bar } - - - match: { result: created } - - - do: - index: - index: test_index - id: 1 - body: { foo: bar } - op_type: index - - - match: { result: updated } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/13_result_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/13_result_with_types.yml deleted file mode 100644 index 45ebe0bbd3dc1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/13_result_with_types.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -"Index result field": - - - do: - index: - index: test_index - type: test - id: 1 - body: { foo: bar } - - - match: { result: created } - - - do: - index: - index: test_index - type: test - id: 1 - body: { foo: bar } - op_type: index - - - match: { result: updated } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/15_without_id.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/15_without_id.yml deleted file mode 100644 index 073a4704b4ef8..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/15_without_id.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -"Index without ID": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - body: { foo: bar } - - - is_true: _id - - match: { _index: test_1 } - - match: { _type: _doc } - - match: { _version: 1 } - - set: { _id: id } - - - do: - get: - index: test_1 - id: '$id' - - - match: { _index: test_1 } - - match: { _type: _doc } - - match: { _id: $id } - - match: { _version: 1 } - - match: { _source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/16_without_id_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/16_without_id_with_types.yml deleted file mode 100644 index 3fff0512b9602..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/16_without_id_with_types.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -"Index without ID": - - - do: - index: - index: test_1 - type: test - body: { foo: bar } - - - is_true: _id - - match: { _index: test_1 } - - match: { _type: test } - - match: { _version: 1 } - - set: { _id: id } - - - do: - get: - index: test_1 - type: test - id: '$id' - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: $id } - - match: { _version: 1 } - - match: { _source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/20_optype.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/20_optype.yml deleted file mode 100644 index c33a86093acab..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/20_optype.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -"Optype": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - op_type: create - body: { foo: bar } - - - do: - catch: conflict - index: - index: test_1 - id: 1 - op_type: create - body: { foo: bar } - - - do: - index: - index: test_1 - id: 1 - op_type: index - body: { foo: bar } - - - match: { _version: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/21_optype_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/21_optype_with_types.yml deleted file mode 100644 index 60ae26d46d07d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/21_optype_with_types.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -"Optype": - - - do: - index: - index: test_1 - type: test - id: 1 - op_type: create - body: { foo: bar } - - - do: - catch: conflict - index: - index: test_1 - type: test - id: 1 - op_type: create - body: { foo: bar } - - - do: - index: - index: test_1 - type: test - id: 1 - op_type: index - body: { foo: bar } - - - match: { _version: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/30_cas.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/30_cas.yml deleted file mode 100644 index 550582e9816eb..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/30_cas.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -"Compare And Swap Sequence Numbers": - - - skip: - version: " - 6.99.99" - reason: typesless api was introduces in 7.0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - match: { _version: 1} - - set: { _seq_no: seqno } - - set: { _primary_term: primary_term } - - - do: - get: - index: test_1 - id: 1 - - match: { _seq_no: $seqno } - - match: { _primary_term: $primary_term } - - - do: - catch: conflict - index: - index: test_1 - id: 1 - if_seq_no: 10000 - if_primary_term: $primary_term - body: { foo: bar2 } - - - do: - catch: conflict - index: - index: test_1 - id: 1 - if_seq_no: $seqno - if_primary_term: 1000 - body: { foo: bar2 } - - - do: - index: - index: test_1 - id: 1 - if_seq_no: $seqno - if_primary_term: $primary_term - body: { foo: bar2 } - - - match: { _version: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/35_external_version.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/35_external_version.yml deleted file mode 100644 index 89aaa190af384..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/35_external_version.yml +++ /dev/null @@ -1,54 +0,0 @@ ---- -"External version": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - version_type: external - version: 0 - - - match: { _version: 0 } - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - version_type: external - version: 5 - - - match: { _version: 5 } - - - do: - catch: conflict - index: - index: test_1 - id: 1 - body: { foo: bar } - version_type: external - version: 5 - - - do: - catch: conflict - index: - index: test_1 - id: 1 - body: { foo: bar } - version_type: external - version: 0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - version_type: external - version: 6 - - - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/36_external_gte_version.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/36_external_gte_version.yml deleted file mode 100644 index 82421227adb7f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/36_external_gte_version.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -"External GTE version": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - version_type: external_gte - version: 0 - - - match: { _version: 0} - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - version_type: external_gte - version: 5 - - - match: { _version: 5} - - - do: - catch: conflict - index: - index: test_1 - id: 1 - body: { foo: bar } - version_type: external_gte - version: 0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar2 } - version_type: external_gte - version: 5 - - - match: { _version: 5} - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar2 } - version_type: external_gte - version: 6 - - - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/37_external_version_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/37_external_version_with_types.yml deleted file mode 100644 index f17e6b749319d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/37_external_version_with_types.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -"External version": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external - version: 0 - - - match: { _version: 0 } - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external - version: 5 - - - match: { _version: 5 } - - - do: - catch: conflict - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external - version: 5 - - - do: - catch: conflict - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external - version: 0 - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external - version: 6 - - - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/38_external_gte_version_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/38_external_gte_version_with_types.yml deleted file mode 100644 index dccbe02ea1400..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/38_external_gte_version_with_types.yml +++ /dev/null @@ -1,56 +0,0 @@ ---- -"External GTE version": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external_gte - version: 0 - - - match: { _version: 0} - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external_gte - version: 5 - - - match: { _version: 5} - - - do: - catch: conflict - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external_gte - version: 0 - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar2 } - version_type: external_gte - version: 5 - - - match: { _version: 5} - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar2 } - version_type: external_gte - version: 6 - - - match: { _version: 6} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/40_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/40_routing.yml deleted file mode 100644 index 630cf39dbe65c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/40_routing.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -"Routing": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - id: 1 - routing: 5 - body: { foo: bar } - - - do: - get: - index: test_1 - id: 1 - routing: 5 - stored_fields: [_routing] - - - match: { _id: "1"} - - match: { _routing: "5"} - - - do: - catch: missing - get: - index: test_1 - id: 1 - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/41_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/41_routing_with_types.yml deleted file mode 100644 index 5b0cf94f4236b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/41_routing_with_types.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -"Routing": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - routing: 5 - body: { foo: bar } - - - do: - get: - index: test_1 - type: test - id: 1 - routing: 5 - stored_fields: [_routing] - - - match: { _id: "1"} - - match: { _routing: "5"} - - - do: - catch: missing - get: - index: test_1 - type: test - id: 1 - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/60_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/60_refresh.yml deleted file mode 100644 index e16602d7ac8b6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/60_refresh.yml +++ /dev/null @@ -1,93 +0,0 @@ ---- -"Refresh": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - settings: - index.refresh_interval: -1 - number_of_replicas: 0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - - match: { hits.total: 0 } - - - do: - index: - index: test_1 - id: 2 - refresh: true - body: { foo: bar } - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 2 }} - - - match: { hits.total: 1 } - ---- -"When refresh url parameter is an empty string that means \"refresh immediately\"": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - refresh: "" - body: { foo: bar } - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - - match: { hits.total: 1 } - ---- -"refresh=wait_for waits until changes are visible in search": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: index_60_refresh_1 - id: index_60_refresh_id1 - body: { foo: bar } - refresh: wait_for - - is_false: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: index_60_refresh_1 - body: - query: { term: { _id: index_60_refresh_id1 }} - - match: { hits.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/61_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/61_refresh_with_types.yml deleted file mode 100644 index be44cafd43020..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/61_refresh_with_types.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -"Refresh": - - - do: - indices.create: - index: test_1 - body: - settings: - index.refresh_interval: -1 - number_of_replicas: 0 - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - - match: { hits.total: 0 } - - - do: - index: - index: test_1 - type: test - id: 2 - refresh: true - body: { foo: bar } - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 2 }} - - - match: { hits.total: 1 } - ---- -"When refresh url parameter is an empty string that means \"refresh immediately\"": - - do: - index: - index: test_1 - type: test - id: 1 - refresh: "" - body: { foo: bar } - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - - match: { hits.total: 1 } - ---- -"refresh=wait_for waits until changes are visible in search": - - do: - index: - index: index_60_refresh_1 - type: test - id: index_60_refresh_id1 - body: { foo: bar } - refresh: wait_for - - is_false: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: index_60_refresh_1 - body: - query: { term: { _id: index_60_refresh_id1 }} - - match: { hits.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/70_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/index/70_mix_typeless_typeful.yml deleted file mode 100644 index f3629fbb7cc18..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/70_mix_typeless_typeful.yml +++ /dev/null @@ -1,102 +0,0 @@ ---- -"Index with typeless API on an index that has types": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - - do: - index: - index: index - id: 1 - body: { foo: bar } - - - match: { _index: "index" } - - match: { _type: "_doc" } - - match: { _id: "1"} - - match: { _version: 1} - - - do: - get: # not using typeless API on purpose - index: index - type: not_doc - id: 1 - - - match: { _index: "index" } - - match: { _type: "not_doc" } # the important bit to check - - match: { _id: "1"} - - match: { _version: 1} - - match: { _source: { foo: bar }} - - - - do: - index: - index: index - body: { foo: bar } - - - match: { _index: "index" } - - match: { _type: "_doc" } - - match: { _version: 1} - - set: { _id: id } - - - do: - get: # using typeful API on purpose - index: index - type: not_doc - id: '$id' - - - match: { _index: "index" } - - match: { _type: "not_doc" } # the important bit to check - - match: { _id: $id} - - match: { _version: 1} - - match: { _source: { foo: bar }} - ---- -"Index call that introduces new field mappings": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - do: - index: - index: index - id: 2 - body: { new_field: value } - - - match: { _index: "index" } - - match: { _type: "_doc" } - - match: { _id: "2" } - - match: { _version: 1 } - - - do: - get: # using typeful API on purpose - index: index - type: not_doc - id: 2 - - - match: { _index: "index" } - - match: { _type: "not_doc" } - - match: { _id: "2" } - - match: { _version: 1} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/index/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/index/TODO.txt deleted file mode 100644 index 389a47c7b7a2c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/index/TODO.txt +++ /dev/null @@ -1,3 +0,0 @@ -Tests missing for: - -# consistency diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/10_analyze.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/10_analyze.yml deleted file mode 100644 index a852e6d3beef1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/10_analyze.yml +++ /dev/null @@ -1,75 +0,0 @@ -"Basic test": - - do: - indices.analyze: - body: - text: Foo Bar - - length: { tokens: 2 } - - match: { tokens.0.token: foo } - - match: { tokens.1.token: bar } - ---- -"Index and field": - - do: - indices.create: - index: test - body: - mappings: - properties: - text: - type: text - analyzer: standard - - - do: - indices.analyze: - index: test - body: - field: text - text: Foo Bar! - - length: { tokens: 2 } - - match: { tokens.0.token: foo } - - match: { tokens.1.token: bar } - ---- -"Array text": - - do: - indices.analyze: - body: - text: ["Foo Bar", "Baz"] - tokenizer: standard - - length: { tokens: 3 } - - match: { tokens.0.token: Foo } - - match: { tokens.1.token: Bar } - - match: { tokens.2.token: Baz } - ---- -"Detail response with Analyzer": - - do: - indices.analyze: - body: - text: This is troubled - analyzer: standard - explain: true - - length: { detail.analyzer.tokens: 3 } - - match: { detail.analyzer.name: standard } - - match: { detail.analyzer.tokens.0.token: this } - - match: { detail.analyzer.tokens.1.token: is } - - match: { detail.analyzer.tokens.2.token: troubled } - ---- -"Custom filter in request": - - do: - indices.analyze: - body: - text: foo bar buzz - tokenizer: standard - explain: true - filter: - - type: stop - stopwords: ["foo", "buzz"] - - length: { detail.tokenizer.tokens: 3 } - - length: { detail.tokenfilters.0.tokens: 1 } - - match: { detail.tokenizer.name: standard } - - match: { detail.tokenizer.tokens.0.token: foo } - - match: { detail.tokenizer.tokens.1.token: bar } - - match: { detail.tokenizer.tokens.2.token: buzz } - - match: { detail.tokenfilters.0.tokens.0.token: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/20_analyze_limit.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/20_analyze_limit.yml deleted file mode 100644 index 87d3b77aee329..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.analyze/20_analyze_limit.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test_1 - body: - settings: - index.analyze.max_token_count: 3 - ---- -"_analyze with No. generated tokens less than or equal to index.analyze.max_token_count should succeed": - - skip: - version: " - 6.99.99" - reason: index.analyze.max_token_count setting has been added in 7.0.0 - - do: - indices.analyze: - index: test_1 - body: - text: This should succeed - analyzer: standard - - length: { tokens: 3 } - - match: { tokens.0.token: this } - - match: { tokens.1.token: should } - - match: { tokens.2.token: succeed } - ---- -"_analyze with No. generated tokens more than index.analyze.max_token_count should fail": - - skip: - version: " - 6.99.99" - reason: index.analyze.max_token_count setting has been added in 7.0.0 - - do: - catch: /The number of tokens produced by calling _analyze has exceeded the allowed maximum of \[3\]. This limit can be set by changing the \[index.analyze.max_token_count\] index level setting\./ - indices.analyze: - index: test_1 - body: - text: This should fail as it exceeds limit - analyzer: standard - - ---- -"_analyze with explain with No. generated tokens more than index.analyze.max_token_count should fail": - - skip: - version: " - 6.99.99" - reason: index.analyze.max_token_count setting has been added in 7.0.0 - - do: - catch: /The number of tokens produced by calling _analyze has exceeded the allowed maximum of \[3\]. This limit can be set by changing the \[index.analyze.max_token_count\] index level setting\./ - indices.analyze: - index: test_1 - body: - text: This should fail as it exceeds limit - analyzer: standard - explain: true diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clear_cache/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clear_cache/10_basic.yml deleted file mode 100644 index 099226e41e6d3..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clear_cache/10_basic.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -"clear_cache test": - - do: - indices.clear_cache: {} - ---- -"clear_cache with request set to false": - - do: - indices.clear_cache: - request: false - ---- -"clear_cache with fielddata set to true": - - skip: - version: " - 6.2.99" - reason: fielddata was deprecated before 6.3.0 - - - do: - indices.clear_cache: - fielddata: true diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/10_basic.yml deleted file mode 100644 index 412d29905ffc2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/10_basic.yml +++ /dev/null @@ -1,111 +0,0 @@ ---- -setup: - - do: - indices.create: - index: source - wait_for_active_shards: 1 - body: - settings: - index.number_of_shards: 2 - index.number_of_replicas: 0 - - do: - index: - index: source - id: "1" - body: { "foo": "hello world" } - - - do: - index: - index: source - id: "2" - body: { "foo": "hello world 2" } - - - do: - index: - index: source - id: "3" - body: { "foo": "hello world 3" } - ---- -"Clone index via API": - - skip: - version: " - 7.3.99" - reason: index cloning was added in 7.4.0 - # make it read-only - - do: - indices.put_settings: - index: source - body: - index.blocks.write: true - index.number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - index: source - - # now we do the actual clone - - do: - indices.clone: - index: "source" - target: "target" - wait_for_active_shards: 1 - master_timeout: 10s - body: - settings: - index.number_of_replicas: 0 - index.number_of_shards: 2 - - - do: - cluster.health: - wait_for_status: green - - - do: - get: - index: target - id: "1" - - - match: { _index: target } - - match: { _type: _doc } - - match: { _id: "1" } - - match: { _source: { foo: "hello world" } } - - - - do: - get: - index: target - id: "2" - - - match: { _index: target } - - match: { _type: _doc } - - match: { _id: "2" } - - match: { _source: { foo: "hello world 2" } } - - - - do: - get: - index: target - id: "3" - - - match: { _index: target } - - match: { _type: _doc } - - match: { _id: "3" } - - match: { _source: { foo: "hello world 3" } } - ---- -"Create illegal clone indices": - - skip: - version: " - 7.3.99" - reason: index cloning was added in 7.4.0 - # try to do an illegal clone with illegal number_of_shards - - do: - catch: /illegal_argument_exception/ - indices.clone: - index: "source" - target: "target" - wait_for_active_shards: 1 - master_timeout: 10s - body: - settings: - index.number_of_replicas: 0 - index.number_of_shards: 6 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml deleted file mode 100644 index 625f574fa73de..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml +++ /dev/null @@ -1,65 +0,0 @@ ---- -"Clone index ignores target template mapping": - - skip: - version: " - 7.3.99" - reason: index cloning was added in 7.4.0 - # create index - - do: - indices.create: - index: source - wait_for_active_shards: 1 - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - properties: - count: - type: text - - # index document - - do: - index: - index: source - id: "1" - body: { "count": "1" } - - # create template matching shrink target - - do: - indices.put_template: - name: tpl1 - body: - index_patterns: targ* - mappings: - properties: - count: - type: integer - - # make it read-only - - do: - indices.put_settings: - index: source - body: - index.blocks.write: true - index.number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - index: source - - # now we do the actual clone - - do: - indices.clone: - index: "source" - target: "target" - wait_for_active_shards: 1 - master_timeout: 10s - body: - settings: - index.number_of_shards: 1 - index.number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml deleted file mode 100644 index 503cc15609072..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml +++ /dev/null @@ -1,61 +0,0 @@ ---- -"Copy settings during clone index": - - skip: - version: " - 7.3.99" - reason: index cloning was added in 7.4.0 - features: [arbitrary_key] - - - do: - nodes.info: - node_id: data:true - - set: - nodes._arbitrary_key_: node_id - - - do: - indices.create: - index: source - wait_for_active_shards: 1 - body: - settings: - index.number_of_replicas: 0 - index.number_of_shards: 1 - index.merge.scheduler.max_merge_count: 4 - - # make it read-only - - do: - indices.put_settings: - index: source - body: - index.blocks.write: true - index.number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - index: source - - # now we do an actual clone and copy settings - - do: - indices.clone: - index: "source" - target: "copy-settings-target" - wait_for_active_shards: 1 - master_timeout: 10s - body: - settings: - index.number_of_replicas: 0 - index.number_of_shards: 1 - index.merge.scheduler.max_thread_count: 2 - - - do: - cluster.health: - wait_for_status: green - - - do: - indices.get_settings: - index: "copy-settings-target" - - # settings should be copied - - match: { copy-settings-target.settings.index.merge.scheduler.max_merge_count: "4" } - - match: { copy-settings-target.settings.index.merge.scheduler.max_thread_count: "2" } - - match: { copy-settings-target.settings.index.blocks.write: "true" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/10_basic.yml deleted file mode 100644 index cab825734f68e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/10_basic.yml +++ /dev/null @@ -1,173 +0,0 @@ ---- -"Create index with mappings": - - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0.0 - - do: - indices.create: - index: test_index - body: - mappings: - {} - - - do: - indices.get_mapping: - index: test_index - - - is_true: test_index.mappings - ---- -"Create index with settings": - - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0.0 - - do: - indices.create: - index: test_index - body: - settings: - number_of_replicas: "0" - - - do: - indices.get_settings: - index: test_index - - - match: { test_index.settings.index.number_of_replicas: "0"} - ---- -"Create index": - - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0.0 - - do: - indices.create: - index: test_index - - - match: { acknowledged: true } - - match: { index: "test_index"} - ---- -"Create index with wait_for_active_shards set to all": - - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0.0 - - do: - indices.create: - index: test_index - wait_for_active_shards: all - body: - settings: - number_of_replicas: "0" - - - match: { acknowledged: true } - - match: { shards_acknowledged: true } - ---- -"Create index with aliases": - - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0.0 - - do: - indices.create: - index: test_index - body: - mappings: - properties: - field: - type: text - aliases: - test_alias: {} - test_blias: - routing: b - test_clias: - filter: - term: - field : value - - - do: - indices.get_alias: - index: test_index - - - match: {test_index.aliases.test_blias.search_routing: b} - - match: {test_index.aliases.test_blias.index_routing: b} - - is_false: test_index.aliases.test_blias.filter - - match: {test_index.aliases.test_clias.filter.term.field: value} - - is_false: test_index.aliases.test_clias.index_routing - - is_false: test_index.aliases.test_clias.search_routing - ---- -"Create index with write aliases": - - skip: - version: " - 6.99.99" - reason: is_write_index is not implemented in ES <= 6.x - - do: - indices.create: - index: test_index - body: - aliases: - test_alias: {} - test_blias: - is_write_index: false - test_clias: - is_write_index: true - - - do: - indices.get_alias: - index: test_index - - - is_false: test_index.aliases.test_alias.is_write_index - - is_false: test_index.aliases.test_blias.is_write_index - - is_true: test_index.aliases.test_clias.is_write_index - ---- -"Create index with invalid mappings": - - do: - catch: /illegal_argument_exception/ - indices.create: - index: test_index - body: - mappings: - properties: - "": - type: keyword - ---- -"Create index with explicit _doc type": - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0 - - do: - catch: bad_request - indices.create: - index: test_index - body: - mappings: - _doc: - properties: - field: - type: keyword - - - match: { error.type: "illegal_argument_exception" } - - match: { error.reason: "The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true." } - ---- -"Create index without soft deletes": - - skip: - version: " - 7.5.99" - reason: "indices without soft deletes are deprecated in 7.6" - features: "warnings" - - - do: - warnings: - - Creating indices with soft-deletes disabled is deprecated and will be removed in future Elasticsearch versions. - Please do not specify value for setting [index.soft_deletes.enabled] of index [test_index]. - indices.create: - index: test_index - body: - settings: - soft_deletes.enabled: false diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/11_basic_with_types.yml deleted file mode 100644 index f5aeb53751119..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/11_basic_with_types.yml +++ /dev/null @@ -1,143 +0,0 @@ ---- -"Create index with mappings": - - - do: - indices.create: - include_type_name: true - index: test_index - body: - mappings: - type_1: {} - - - do: - indices.get_mapping: - include_type_name: true - index: test_index - - - is_true: test_index.mappings.type_1 - ---- -"Create index with settings": - - - do: - indices.create: - include_type_name: true - index: test_index - body: - settings: - number_of_replicas: "0" - - - do: - indices.get_settings: - index: test_index - - - match: { test_index.settings.index.number_of_replicas: "0"} - ---- -"Create index": - - - do: - indices.create: - include_type_name: true - index: test_index - - - match: { acknowledged: true } - - match: { index: "test_index"} - ---- -"Create index with wait_for_active_shards set to all": - - - do: - indices.create: - include_type_name: true - index: test_index - wait_for_active_shards: all - body: - settings: - number_of_replicas: "0" - - - match: { acknowledged: true } - - match: { shards_acknowledged: true } - ---- -"Create index with aliases": - - - do: - indices.create: - include_type_name: true - index: test_index - body: - mappings: - type_1: - properties: - field: - type: text - aliases: - test_alias: {} - test_blias: - routing: b - test_clias: - filter: - term: - field : value - - - do: - indices.get_alias: - index: test_index - - - match: {test_index.aliases.test_blias.search_routing: b} - - match: {test_index.aliases.test_blias.index_routing: b} - - is_false: test_index.aliases.test_blias.filter - - match: {test_index.aliases.test_clias.filter.term.field: value} - - is_false: test_index.aliases.test_clias.index_routing - - is_false: test_index.aliases.test_clias.search_routing - ---- -"Create index with write aliases": - - skip: - version: " - 6.99.99" - reason: is_write_index is not implemented in ES <= 6.x - - do: - indices.create: - include_type_name: true - index: test_index - body: - aliases: - test_alias: {} - test_blias: - is_write_index: false - test_clias: - is_write_index: true - - - do: - indices.get_alias: - index: test_index - - - is_false: test_index.aliases.test_alias.is_write_index - - is_false: test_index.aliases.test_blias.is_write_index - - is_true: test_index.aliases.test_clias.is_write_index - ---- -"Create index with no type mappings": - - do: - catch: /illegal_argument_exception/ - indices.create: - include_type_name: true - index: test_index - body: - mappings: - "" : {} - ---- -"Create index with invalid mappings": - - do: - catch: /illegal_argument_exception/ - indices.create: - include_type_name: true - index: test_index - body: - mappings: - test_type: - properties: - "": - type: keyword diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/20_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/20_mix_typeless_typeful.yml deleted file mode 100644 index a05134866628b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.create/20_mix_typeless_typeful.yml +++ /dev/null @@ -1,140 +0,0 @@ ---- -"Create a typeless index while there is a typed template": - - - skip: - version: " - 6.6.99" - reason: Merging typeless/typed mappings/templates was added in 6.7 - - - do: - indices.put_template: - include_type_name: true - name: test_template - body: - index_patterns: test-* - mappings: - my_type: - properties: - foo: - type: keyword - - - do: - indices.create: - index: test-1 - body: - mappings: - properties: - bar: - type: "long" - - - do: - indices.get_mapping: - include_type_name: true - index: test-1 - - - is_true: test-1.mappings._doc # the index creation call won - - is_false: test-1.mappings.my_type - - is_true: test-1.mappings._doc.properties.foo - - is_true: test-1.mappings._doc.properties.bar - ---- -"Create a typed index while there is a typeless template": - - - skip: - version: " - 6.6.99" - reason: Merging typeless/typed mappings/templates was added in 6.7 - - - do: - indices.put_template: - include_type_name: false - name: test_template - body: - index_patterns: test-* - mappings: - properties: - foo: - type: keyword - - - do: - indices.create: - include_type_name: true - index: test-1 - body: - mappings: - my_type: - properties: - bar: - type: "long" - - - do: - indices.get_mapping: - include_type_name: true - index: test-1 - - - is_true: test-1.mappings.my_type # the index creation call won - - is_false: test-1.mappings._doc - - is_true: test-1.mappings.my_type.properties.foo - - is_true: test-1.mappings.my_type.properties.bar - ---- -"Implicitly create a typed index while there is a typeless template": - - - skip: - version: " - 6.99.99" - reason: include_type_name only supported as of 6.7 - - - do: - indices.put_template: - include_type_name: false - name: test_template - body: - index_patterns: test-* - mappings: - properties: - foo: - type: keyword - - - do: - catch: /the final mapping would have more than 1 type/ - index: - index: test-1 - type: my_type - body: { bar: 42 } - ---- -"Implicitly create a typeless index while there is a typed template": - - - skip: - version: " - 6.99.99" - reason: needs typeless index operations to work on typed indices - - - do: - indices.put_template: - include_type_name: true - name: test_template - body: - index_patterns: test-* - mappings: - my_type: - properties: - foo: - type: keyword - - - do: - index: - index: test-1 - body: { bar: 42 } - -# ensures dynamic mapping update is visible to get_mapping - - do: - cluster.health: - wait_for_events: normal - - - do: - indices.get_mapping: - include_type_name: true - index: test-1 - - - is_true: test-1.mappings.my_type # the template is honored - - is_false: test-1.mappings._doc - - is_true: test-1.mappings.my_type.properties.foo - - is_true: test-1.mappings.my_type.properties.bar diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.data_stream/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.data_stream/10_basic.yml deleted file mode 100644 index 2861c443bfa8e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.data_stream/10_basic.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -"Create data stream": - - skip: - version: " - 7.6.99" - reason: available only in 7.7+ - - - do: - indices.create_data_stream: - name: simple-data-stream1 - body: - timestamp_field: "@timestamp" - - is_true: acknowledged - - - do: - indices.create_data_stream: - name: simple-data-stream2 - body: - timestamp_field: "@timestamp2" - - is_true: acknowledged - - - do: - indices.get_data_streams: {} - - match: { 0.name: simple-data-stream1 } - - match: { 0.timestamp_field: '@timestamp' } - - match: { 0.indices: [] } - - match: { 1.name: simple-data-stream2 } - - match: { 1.timestamp_field: '@timestamp2' } - - match: { 1.indices: [] } - - - do: - indices.delete_data_stream: - name: simple-data-stream2 - - is_true: acknowledged diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete/10_basic.yml deleted file mode 100644 index e43c835ae96f2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete/10_basic.yml +++ /dev/null @@ -1,100 +0,0 @@ -setup: - - do: - indices.create: - index: index - body: - aliases: - alias: {} - - do: - indices.create: - index: index2 ---- -"Delete index against alias": - - do: - catch: bad_request - indices.delete: - index: alias - - do: - indices.get: - index: index,index2 - - is_true: index - - is_true: index2 ---- -"Delete index against alias - ignore unavailable": - - do: - indices.delete: - index: alias - ignore_unavailable: true - - do: - indices.get: - index: index,index2 - - is_true: index - - is_true: index2 ---- -"Delete index against alias - multiple indices": - - do: - catch: bad_request - indices.delete: - index: alias,index2 - - do: - indices.get: - index: index,index2 - - is_true: index - - is_true: index2 ---- -"Delete index against alias - ignore unavailable - multiple indices": - - do: - indices.delete: - index: alias,index2 - ignore_unavailable: true - - do: - indices.get: - index: index,index2 - ignore_unavailable: true - - is_true: index - - is_false: index2 ---- -"Delete index against wildcard matching alias": - - do: - indices.delete: - index: alia* - - do: - indices.get: - index: index,index2 - - is_true: index - - is_true: index2 ---- -"Delete index against wildcard matching alias - disallow no indices": - - do: - catch: missing - indices.delete: - index: alia* - allow_no_indices: false - - do: - indices.get: - index: index,index2 - - is_true: index - - is_true: index2 ---- -"Delete index against wildcard matching alias - multiple indices": - - do: - indices.delete: - index: alia*,index2 - - do: - indices.get: - index: index,index2 - ignore_unavailable: true - - is_true: index - - is_false: index2 ---- -"Delete index against wildcard matching alias - disallow no indices - multiple indices": - - do: - catch: missing - indices.delete: - index: index2,alia* - allow_no_indices: false - - do: - indices.get: - index: index,index2 - - is_true: index - - is_true: index2 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/10_basic.yml deleted file mode 100644 index 74684901579a4..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/10_basic.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -"Basic test for delete alias": - - do: - indices.create: - index: testind - - - do: - indices.put_alias: - index: testind - name: testali - body: - routing: "routing value" - - - do: - indices.get_alias: - name: testali - - - match: {testind.aliases.testali.search_routing: "routing value"} - - match: {testind.aliases.testali.index_routing: "routing value"} - - - do: - indices.delete_alias: - index: testind - name: testali - - - do: - catch: missing - indices.get_alias: - index: testind - name: testali - - - match: { 'status': 404 } - - match: { 'error': 'alias [testali] missing' } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml deleted file mode 100644 index d1d01cbaaa7e6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml +++ /dev/null @@ -1,224 +0,0 @@ ---- -setup: - - - do: - indices.create: - index: test_index1 - - - do: - indices.create: - index: test_index2 - - - do: - indices.create: - index: foo - - - do: - indices.put_alias: - name: alias1 - index: - - test_index1 - - foo - body: - routing: "routing value" - - do: - indices.put_alias: - name: alias2 - index: - - test_index2 - - foo - body: - routing: "routing value" - ---- -"check setup": - - do: - indices.get_alias: - name: alias1 - - - match: {test_index1.aliases.alias1.search_routing: "routing value"} - - match: {foo.aliases.alias1.search_routing: "routing value"} - - - do: - indices.get_alias: - name: alias2 - - - match: {test_index2.aliases.alias2.search_routing: "routing value"} - - match: {foo.aliases.alias2.search_routing: "routing value"} - ---- -"check delete with _all index": - - do: - indices.delete_alias: - index: _all - name: alias1 - - - do: - catch: missing - indices.get_alias: - name: alias1 - - do: - indices.get_alias: - name: alias2 - - - match: {test_index2.aliases.alias2.search_routing: "routing value"} - - match: {foo.aliases.alias2.search_routing: "routing value"} - ---- -"check delete with * index": - - do: - indices.delete_alias: - index: "*" - name: alias1 - - - do: - catch: missing - indices.get_alias: - name: alias1 - - do: - indices.get_alias: - name: alias2 - - - match: {test_index2.aliases.alias2.search_routing: "routing value"} - - match: {foo.aliases.alias2.search_routing: "routing value"} - ---- -"check delete with index list": - - do: - indices.delete_alias: - index: "test_index1,test_index2" - name: alias1 - - - do: - indices.get_alias: - name: alias1 - - - match: {foo.aliases.alias1.search_routing: "routing value"} - - is_false: test_index1 - - is_false: test_index2 - - - do: - indices.get_alias: - name: alias2 - - - match: {test_index2.aliases.alias2.search_routing: "routing value"} - - match: {foo.aliases.alias2.search_routing: "routing value"} - ---- -"check delete with prefix* index": - - do: - indices.delete_alias: - index: "test_*" - name: alias1 - - - do: - indices.get_alias: - name: alias1 - - - match: {foo.aliases.alias1.search_routing: "routing value"} - - is_false: test_index1 - - is_false: test_index2 - - - do: - indices.get_alias: - name: alias2 - - - match: {test_index2.aliases.alias2.search_routing: "routing value"} - - match: {foo.aliases.alias2.search_routing: "routing value"} - - ---- -"check delete with index list and * aliases": - - do: - indices.delete_alias: - index: "test_index1,test_index2" - name: "*" - - - do: - indices.get_alias: - name: alias1 - - - match: {foo.aliases.alias1.search_routing: "routing value"} - - is_false: test_index1 - - is_false: test_index2 - - - do: - indices.get_alias: - name: alias2 - - - match: {foo.aliases.alias2.search_routing: "routing value"} - - is_false: test_index1 - - is_false: test_index2 - ---- -"check delete with index list and _all aliases": - - do: - indices.delete_alias: - index: "test_index1,test_index2" - name: _all - - - do: - indices.get_alias: - name: alias1 - - - match: {foo.aliases.alias1.search_routing: "routing value"} - - is_false: test_index1 - - is_false: test_index2 - - - do: - indices.get_alias: - name: alias2 - - - match: {foo.aliases.alias2.search_routing: "routing value"} - - is_false: test_index1 - - is_false: test_index2 - ---- -"check delete with index list and wildcard aliases": - - do: - indices.delete_alias: - index: "test_index1,test_index2" - name: "*1" - - - do: - indices.get_alias: - name: alias1 - - - match: {foo.aliases.alias1.search_routing: "routing value"} - - is_false: test_index1 - - is_false: test_index2 - - - do: - indices.get_alias: - name: alias2 - - - match: {test_index2.aliases.alias2.search_routing: "routing value"} - - match: {foo.aliases.alias2.search_routing: "routing value"} - ---- -"check 404 on no matching alias": - - do: - catch: missing - indices.delete_alias: - index: "*" - name: "non_existent" - - - do: - catch: missing - indices.delete_alias: - index: "non_existent" - name: "alias1" - - ---- -"check delete with blank index and blank alias": - - do: - catch: param - indices.delete_alias: - name: "alias1" - - - do: - catch: param - indices.delete_alias: - index: "test_index1" - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/10_basic.yml deleted file mode 100644 index e8bbb806d1d10..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/10_basic.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -"Test indices.exists": - - do: - indices.exists: - index: test_index - - - is_false: '' - - - do: - indices.create: - index: test_index - - - do: - indices.exists: - index: test_index - - - is_true: '' ---- -"Test indices.exists with local flag": - - do: - indices.exists: - index: test_index - local: true - - - is_false: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/20_read_only_index.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/20_read_only_index.yml deleted file mode 100644 index 24d2dcdc08f84..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists/20_read_only_index.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -"Test indices.exists on a read only index": - - - do: - indices.create: - index: test_index_ro - - - do: - indices.put_settings: - index: test_index_ro - body: - index.blocks.read_only: true - - - do: - indices.exists: - index: test_index_ro - - - is_true: '' - - - do: - indices.put_settings: - index: test_index_ro - body: - index.blocks.read_only: false - - - do: - indices.exists: - index: test_index_ro - - - is_true: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_alias/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_alias/10_basic.yml deleted file mode 100644 index fba0512ca372f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_alias/10_basic.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -"Test indices.exists_alias": - - do: - indices.exists_alias: - name: test_alias - - - is_false: '' - - - do: - indices.create: - index: test_index - - - do: - indices.put_alias: - index: test_index - name: test_alias - - - do: - indices.exists_alias: - name: test_alias - - - is_true: '' - - - do: - indices.exists_alias: - index: test_index - name: test_alias - - - is_true: '' - - - do: - indices.exists_alias: - index: test_index1 - name: test_alias - - - is_false: '' - ---- -"Test indices.exists_alias with local flag": - - do: - indices.exists_alias: - name: test_alias - local: true - - - is_false: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_template/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_template/10_basic.yml deleted file mode 100644 index 67592a013e8f1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.exists_template/10_basic.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -setup: - - do: - indices.delete_template: - name: test - ignore: [404] ---- -"Test indices.exists_template": - - - do: - indices.exists_template: - name: test - - - is_false: '' - - - do: - indices.put_template: - name: test - body: - index_patterns: ['test-*'] - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - indices.exists_template: - name: test - master_timeout: 1m - - - is_true: '' - ---- -"Test indices.exists_template with local flag": - - do: - indices.exists_template: - name: test - local: true - - - is_false: '' - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.flush/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.flush/10_basic.yml deleted file mode 100644 index 79e8197f41542..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.flush/10_basic.yml +++ /dev/null @@ -1,89 +0,0 @@ ---- -"Index synced flush rest test": - - skip: - version: " - 7.5.99" - reason: "synced flush is deprecated in 7.6" - features: "warnings" - - do: - indices.create: - index: testing - body: - settings: - index: - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - do: - warnings: - - Synced flush is deprecated and will be removed in 8.0. Use flush at _/flush or /{index}/_flush instead. - indices.flush_synced: - index: testing - - - is_false: _shards.failed - - - do: - indices.stats: {level: shards} - - - is_true: indices.testing.shards.0.0.commit.user_data.sync_id - ---- -"Flush stats": - - skip: - version: " - 6.2.99" - reason: periodic flush stats is introduced in 6.3.0 - - do: - indices.create: - index: test - body: - settings: - number_of_shards: 1 - index.translog.flush_threshold_size: 160b - - do: - indices.flush: - index: test - - do: - indices.stats: { index: test } - - match: { indices.test.primaries.flush.periodic: 0 } - - match: { indices.test.primaries.flush.total: 1 } - - do: - index: - index: test - type: doc - id: 1 - body: { "message": "a long message to make a periodic flush happen after this index operation" } - - do: - indices.stats: { index: test } - # periodic flush is async - - gte: { indices.test.primaries.flush.periodic: 0 } - - gte: { indices.test.primaries.flush.total: 1 } - ---- -"Flush parameters validation": - - skip: - version: " - 7.1.99" - reason: flush parameters validation is introduced in 7.2.0 - - do: - indices.create: - index: test - body: - settings: - number_of_shards: 1 - - do: - catch: /action_request_validation_exception.+ wait_if_ongoing must be true for a force flush/ - indices.flush: - index: test - force: true - wait_if_ongoing: false - - do: - indices.stats: { index: test } - - match: { indices.test.primaries.flush.total: 0 } - - do: - indices.flush: - index: test - force: true - wait_if_ongoing: true - - do: - indices.stats: { index: test } - - match: { indices.test.primaries.flush.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.forcemerge/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.forcemerge/10_basic.yml deleted file mode 100644 index c71a2e5e43429..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.forcemerge/10_basic.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -"Force merge index tests": - - do: - indices.create: - index: testing - - - do: - indices.forcemerge: - index: testing - max_num_segments: 1 - ---- -"Check deprecation warning when incompatible only_expunge_deletes and max_num_segments values are both set": - - skip: - version: " - 7.3.99" - reason: "deprecation warning about only_expunge_deletes and max_num_segments added in 7.4" - features: "warnings" - - - do: - indices.create: - index: test - - - do: - warnings: - - 'setting only_expunge_deletes and max_num_segments at the same time is deprecated and will be rejected in a future version' - indices.forcemerge: - index: test - max_num_segments: 10 - only_expunge_deletes: true - - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/10_basic.yml deleted file mode 100644 index b70bc8ebeb469..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/10_basic.yml +++ /dev/null @@ -1,167 +0,0 @@ ---- -setup: - - - do: - indices.create: - index: test_index - body: - aliases: - test_alias: {} - test_blias: {} - mappings: - properties: - foo: - type: keyword - settings: - number_of_shards: 1 - number_of_replicas: 1 - - - do: - indices.create: - index: test_index_2 - body: - settings: - number_of_shards: 1 - number_of_replicas: 2 - aliases: - test_alias: {} - test_blias: {} - - - do: - indices.create: - index: test_index_3 - body: - aliases: - test_alias: {} - test_blias: {} - - - do: - indices.close: - index: test_index_3 - - - do: - cluster.health: - wait_for_status: yellow - ---- -"Get index infos": - - - do: - indices.get: - index: test_index - - - is_true: test_index.aliases - - is_true: test_index.settings - - is_true: test_index.mappings - ---- -"Get index infos should work for wildcards": - - - do: - indices.get: - index: test_* - - - is_true: test_index.mappings - - is_true: test_index.aliases - - is_true: test_index.settings - - is_true: test_index_2.settings - - is_true: test_index_2.mappings - - is_true: test_index_2.aliases - ---- -"Get index infos with human settings should return index creation date and version in readable format": - - - do: - indices.get: - index: test_index - human: true - - - is_true: test_index.settings.index.creation_date_string - - is_true: test_index.settings.index.version.created_string - ---- -"Get index infos by default shouldn't return index creation date and version in readable format": - - - do: - indices.get: - index: test_index - - - is_false: test_index.settings.index.creation_date_string - - is_false: test_index.settings.index.version.created_string - ---- -"Missing index should throw an Error": - - - do: - catch: missing - indices.get: - index: test_not_found - ---- -"Missing index should return empty object if ignore_unavailable": - - - do: - indices.get: - index: test_not_found - ignore_unavailable: true - - - match: { $body: {} } - ---- -"Should return empty object if allow_no_indices": - - - do: - indices.get: - index: test_not* - - - match: { $body: {} } - ---- -"Should throw error if allow_no_indices=false": - - - do: - catch: missing - indices.get: - index: test_not* - allow_no_indices: false - ---- -"Should return test_index_2 if expand_wildcards=open": - - - do: - indices.get: - index: test_index_* - expand_wildcards: open - - - is_true: test_index_2.settings - - is_false: test_index_3.settings - ---- -"Should return test_index_3 if expand_wildcards=closed": - - - do: - indices.get: - index: test_index_* - expand_wildcards: closed - - - is_false: test_index_2.settings - - is_true: test_index_3.settings - ---- -"Should return test_index_2 and test_index_3 if expand_wildcards=open,closed": - - - do: - indices.get: - index: test_index_* - expand_wildcards: open,closed - - - is_true: test_index_2.settings - - is_true: test_index_3.settings - ---- -"Should return an exception when querying invalid indices": - - - do: - catch: bad_request - indices.get: - index: _foo diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/11_basic_with_types.yml deleted file mode 100644 index 413c4bcb8d28c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get/11_basic_with_types.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -setup: - - - do: - indices.create: - include_type_name: true - index: test_index - body: - aliases: - test_alias: {} - test_blias: {} - mappings: - type_1: {} - settings: - number_of_shards: 1 - number_of_replicas: 1 - - - do: - indices.create: - index: test_index_2 - body: - settings: - number_of_shards: 1 - number_of_replicas: 2 - aliases: - test_alias: {} - test_blias: {} - - - do: - indices.create: - index: test_index_3 - body: - aliases: - test_alias: {} - test_blias: {} - - - do: - indices.close: - index: test_index_3 - - - do: - cluster.health: - wait_for_status: yellow - ---- -"Test include_type_name": - - skip: - version: " - 6.6.99" - reason: the include_type_name parameter is not supported before 6.7 - - - do: - indices.get: - include_type_name: true - index: test_index - - - is_true: test_index.mappings - - is_true: test_index.mappings.type_1 - - - do: - indices.get: - include_type_name: false - index: test_index - - - is_true: test_index.mappings - - is_false: test_index.mappings.type_1 - ---- -"Test include_type_name dafaults to false": - - skip: - version: " - 6.99.99" - reason: the include_type_name parameter default is different on 6.x and 7.0, so only test this on 7.0 clusters - - - do: - indices.get: - index: test_index - - - is_true: test_index.mappings - - is_false: test_index.mappings.type_1 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/10_basic.yml deleted file mode 100644 index f3dc3ac86bc9f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/10_basic.yml +++ /dev/null @@ -1,324 +0,0 @@ ---- -setup: - - - do: - indices.create: - index: test_index - body: - aliases: - test_alias: {} - test_blias: {} - - - do: - indices.create: - index: test_index_2 - body: - aliases: - test_alias: {} - test_blias: {} - ---- -"Get all aliases via /_alias": - - - do: - indices.create: - index: test_index_3 - - - do: - indices.get_alias: {} - - - match: {test_index.aliases.test_alias: {}} - - match: {test_index.aliases.test_blias: {}} - - match: {test_index_2.aliases.test_alias: {}} - - match: {test_index_2.aliases.test_blias: {}} - - match: {test_index_3.aliases: {}} - ---- -"Get aliases via /_alias/_all": - - - do: - indices.create: - index: test_index_3 - - - do: - indices.get_alias: - name: _all - - - match: {test_index.aliases.test_alias: {}} - - match: {test_index.aliases.test_blias: {}} - - match: {test_index_2.aliases.test_alias: {}} - - match: {test_index_2.aliases.test_blias: {}} - - is_false: test_index_3 - ---- -"Get aliases via /_alias/*": - - - do: - indices.create: - index: test_index_3 - - - do: - indices.get_alias: - name: '*' - - - match: {test_index.aliases.test_alias: {}} - - match: {test_index.aliases.test_blias: {}} - - match: {test_index_2.aliases.test_alias: {}} - - match: {test_index_2.aliases.test_blias: {}} - - is_false: test_index_3 - ---- -"Get all aliases via /{index}/_alias/": - - - do: - indices.get_alias: - index: test_index - - - match: {test_index.aliases.test_alias: {}} - - match: {test_index.aliases.test_blias: {}} - - is_false: test_index_2 - ---- -"Get aliases via /_all/_alias/": - - do: - indices.create: - index: myindex - - - do: - indices.get_alias: - index: _all - - - match: {test_index.aliases.test_alias: {}} - - match: {test_index.aliases.test_blias: {}} - - match: {test_index_2.aliases.test_alias: {}} - - match: {test_index_2.aliases.test_blias: {}} - - match: {myindex.aliases: {}} - ---- -"Get aliases via /*/_alias/": - - do: - indices.create: - index: myindex - - - do: - indices.get_alias: - index: "*" - - - match: {test_index.aliases.test_alias: {}} - - match: {test_index.aliases.test_blias: {}} - - match: {test_index_2.aliases.test_alias: {}} - - match: {test_index_2.aliases.test_blias: {}} - - match: {myindex.aliases: {}} - ---- -"Get and index with no aliases via /{index}/_alias/": - - do: - indices.create: - index: myindex - - - do: - indices.get_alias: - index: myindex - - - match: {myindex.aliases: {}} - ---- -"Get specific alias via /{index}/_alias/{name}": - - - do: - indices.get_alias: - index: test_index - name: test_alias - - - match: {test_index.aliases.test_alias: {}} - - is_false: test_index.aliases.test_blias - - is_false: test_index_2 - ---- -"Get aliases via /{index}/_alias/_all": - - - do: - indices.get_alias: - index: test_index - name: _all - - - match: {test_index.aliases.test_alias: {}} - - match: {test_index.aliases.test_blias: {}} - - is_false: test_index_2 - ---- -"Get aliases via /{index}/_alias/*": - - - do: - indices.get_alias: - index: test_index - name: '*' - - - match: {test_index.aliases.test_alias: {}} - - match: {test_index.aliases.test_blias: {}} - - is_false: test_index_2 - ---- -"Get aliases via /{index}/_alias/prefix*": - - do: - indices.get_alias: - index: test_index - name: 'test_a*' - - - match: {test_index.aliases.test_alias: {}} - - is_false: test_index.aliases.test_blias - - is_false: test_index_2 - ---- -"Get aliases via /{index}/_alias/name,name": - - - do: - indices.get_alias: - index: test_index - name: 'test_alias,test_blias' - - - match: {test_index.aliases.test_alias: {}} - - match: {test_index.aliases.test_blias: {}} - - is_false: test_index_2 - ---- -"Get aliases via /_alias/{name}": - - - do: - indices.get_alias: - name: test_alias - - - match: {test_index.aliases.test_alias: {}} - - match: {test_index_2.aliases.test_alias: {}} - - is_false: test_index.aliases.test_blias - - is_false: test_index_2.aliases.test_blias - ---- -"Get aliases via /_all/_alias/{name}": - - - do: - indices.get_alias: - index: _all - name: test_alias - - - match: {test_index.aliases.test_alias: {}} - - match: {test_index_2.aliases.test_alias: {}} - - is_false: test_index.aliases.test_blias - - is_false: test_index_2.aliases.test_blias - ---- -"Get aliases via /*/_alias/{name}": - - - do: - indices.get_alias: - index: '*' - name: test_alias - - - match: {test_index.aliases.test_alias: {}} - - match: {test_index_2.aliases.test_alias: {}} - - is_false: test_index.aliases.test_blias - - is_false: test_index_2.aliases.test_blias - ---- -"Get aliases via /*suf/_alias/{name}": - - - do: - indices.get_alias: - index: '*2' - name: test_alias - - - match: {test_index_2.aliases.test_alias: {}} - - is_false: test_index.aliases.test_alias - - is_false: test_index.aliases.test_blias - - is_false: test_index_2.aliases.test_blias - ---- -"Get aliases via /name,name/_alias/{name}": - - - do: - indices.get_alias: - index: test_index,test_index_2 - name: test_alias - - - match: {test_index.aliases.test_alias: {}} - - match: {test_index_2.aliases.test_alias: {}} - - is_false: test_index.aliases.test_blias - - is_false: test_index_2.aliases.test_blias - - ---- -"Non-existent alias on an existing index returns 404": - - do: - catch: missing - indices.get_alias: - index: test_index - name: non-existent - - - match: { 'status': 404} - - match: { 'error': 'alias [non-existent] missing' } - ---- -"Existent and non-existent alias returns 404 and the existing alias": - - do: - catch: missing - indices.get_alias: - index: test_index - name: test_alias,non-existent - - - match: { 'status': 404 } - - match: { 'error': 'alias [non-existent] missing' } - - match: { test_index.aliases.test_alias: { } } - ---- -"Existent and non-existent aliases returns 404 and the existing alias": - - do: - catch: missing - indices.get_alias: - index: test_index - name: test_alias,non-existent,another-non-existent - - - match: { 'status': 404 } - - match: { 'error': 'aliases [another-non-existent,non-existent] missing' } - - match: { test_index.aliases.test_alias: { } } - ---- -"Getting alias on an non-existent index should return 404": - - - do: - catch: missing - indices.get_alias: - index: non-existent - name: foo - ---- -"Get alias with local flag": - - - do: - indices.get_alias: - local: true - - - is_true: test_index - - - is_true: test_index_2 - ---- -"Get alias against closed indices": - - - do: - indices.close: - index: test_index_2 - - - do: - indices.get_alias: - name: test_alias - - - is_true: test_index - - is_true: test_index_2 - - - do: - indices.get_alias: - name: test_alias - expand_wildcards: open - - - is_true: test_index - - is_false: test_index_2 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/20_empty.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/20_empty.yml deleted file mode 100644 index 7405d99441b39..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/20_empty.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -setup: - - - do: - indices.create: - index: test_index - - - do: - indices.create: - index: test_index_2 - ---- -"Check empty aliases when getting all aliases via /_alias": - - - do: - indices.get_alias: {} - - - match: {test_index.aliases: {}} - - match: {test_index_2.aliases: {}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/30_wildcards.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/30_wildcards.yml deleted file mode 100644 index 08b3009be0e88..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_alias/30_wildcards.yml +++ /dev/null @@ -1,140 +0,0 @@ ---- -setup: - - - do: - indices.create: - index: test_index - body: - aliases: - test_alias_1: {} - test_alias_2: {} - test_blias_1: {} - test_blias_2: {} - test: {} - ---- -"Get aliases wildcard and inclusion": - - do: - indices.get_alias: - name: test_alias*,test_blias_1 - - - match: {test_index.aliases.test_alias_1: {}} - - match: {test_index.aliases.test_alias_2: {}} - - match: {test_index.aliases.test_blias_1: {}} - - is_false: test_index.aliases.test_blias_2 - - is_false: test_index.aliases.test - ---- -"Get aliases wildcard and simple exclusion": - - skip: - version: " - 6.99.99" - reason: Exclusions in the alias expression are not handled - - do: - indices.get_alias: - name: test_blias_2,test_alias*,-test_alias_1 - - - is_false: test_index.aliases.test_alias_1 - - match: {test_index.aliases.test_alias_2: {}} - - is_false: test_index.aliases.test_blias_1 - - match: {test_index.aliases.test_blias_2: {}} - - is_false: test_index.aliases.test - ---- -"Get aliases and wildcard exclusion": - - skip: - version: " - 6.99.99" - reason: Exclusions in the alias expression are not handled - - do: - indices.get_alias: - name: test_alias_1,test_blias_1,-test_alias* - - - is_false: test_index.aliases.test_alias_1 - - is_false: test_index.aliases.test_alias_2 - - match: {test_index.aliases.test_blias_1: {}} - - is_false: test_index.aliases.test_blias_2 - - is_false: test_index.aliases.test - - - do: - indices.get_alias: - name: test_blias_2,tes*,-test_alias* - - - is_false: test_index.aliases.test_alias_1 - - is_false: test_index.aliases.test_alias_2 - - match: {test_index.aliases.test_blias_1: {}} - - match: {test_index.aliases.test_blias_2: {}} - - match: {test_index.aliases.test: {}} - ---- -"Non-existent exclusion alias before wildcard returns 404": - - skip: - version: " - 6.99.99" - reason: Exclusions in the alias expression are not handled - - do: - catch: missing - indices.get_alias: - name: -test_alias_1,test_alias*,-test_alias_2 - - - match: { 'status': 404} - - match: { 'error': 'alias [-test_alias_1] missing' } - - match: {test_index.aliases.test_alias_1: {}} - - is_false: test_index.aliases.test_alias_2 - - is_false: test_index.aliases.test_blias_1 - - is_false: test_index.aliases.test_blias_2 - - is_false: test_index.aliases.test - - - do: - catch: missing - indices.get_alias: - name: -test_alias_1,-non-existing,test_alias*,-test - - - match: { 'status': 404} - - match: { 'error': 'aliases [-non-existing,-test_alias_1] missing' } - - match: {test_index.aliases.test_alias_1: {}} - - match: {test_index.aliases.test_alias_2: {}} - - is_false: test_index.aliases.test_blias_1 - - is_false: test_index.aliases.test_blias_2 - - is_false: test_index.aliases.test - ---- -"Missing exclusions does not fire 404": - - skip: - version: " - 6.99.99" - reason: Exclusions in the alias expression are not handled - - do: - indices.get_alias: - name: test_alias*,-non-existent,test_blias*,-test - - - match: {test_index.aliases.test_alias_1: {}} - - match: {test_index.aliases.test_alias_2: {}} - - match: {test_index.aliases.test_blias_1: {}} - - match: {test_index.aliases.test_blias_2: {}} - - is_false: test_index.aliases.test - ---- -"Exclusion of non wildcarded aliases": - - skip: - version: " - 6.99.99" - reason: Exclusions in the alias expression are not handled - - do: - indices.get_alias: - name: test_alias_1,test_blias_2,-test_alias*,-test_blias_2 - - - match: { '': {}} - ---- -"Wildcard exclusions does not trigger 404": - - skip: - version: " - 6.99.99" - reason: Exclusions in the alias expression are not handled - - do: - catch: missing - indices.get_alias: - name: -non-existent,-non-existent*,-another - - - match: { 'status': 404} - - match: { 'error': 'alias [-non-existent] missing' } - - is_false: test_index.aliases.test_alias_1 - - is_false: test_index.aliases.test_alias_2 - - is_false: test_index.aliases.test_blias_1 - - is_false: test_index.aliases.test_blias_2 - - is_false: test_index.aliases.test diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/10_basic.yml deleted file mode 100644 index 9be1f7246d5f3..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/10_basic.yml +++ /dev/null @@ -1,54 +0,0 @@ ---- -setup: - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0 - - do: - indices.create: - index: test_index - body: - mappings: - properties: - text: - type: text - ---- -"Get field mapping with no index": - - - do: - indices.get_field_mapping: - fields: text - - - match: {test_index.mappings.text.mapping.text.type: text} - ---- -"Get field mapping by index only": - - do: - indices.get_field_mapping: - index: test_index - fields: text - - - match: {test_index.mappings.text.mapping.text.type: text} - ---- -"Get field mapping by field, with another field that doesn't exist": - - - do: - indices.get_field_mapping: - index: test_index - fields: [ text , text1 ] - - - match: {test_index.mappings.text.mapping.text.type: text} - - is_false: test_index.mappings.test_type.text1 - ---- -"Get field mapping with include_defaults": - - - do: - indices.get_field_mapping: - index: test_index - fields: text - include_defaults: true - - - match: {test_index.mappings.text.mapping.text.type: text} - - match: {test_index.mappings.text.mapping.text.analyzer: default} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/11_basic_with_types.yml deleted file mode 100644 index 0a7f5fa3560ba..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/11_basic_with_types.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -setup: - - do: - indices.create: - include_type_name: true - index: test_index - body: - mappings: - test_type: - properties: - text: - type: text - ---- -"Get field mapping with no index and type": - - - do: - indices.get_field_mapping: - include_type_name: true - fields: text - - - match: {test_index.mappings.test_type.text.mapping.text.type: text} - ---- -"Get field mapping by index only": - - do: - indices.get_field_mapping: - include_type_name: true - index: test_index - fields: text - - - match: {test_index.mappings.test_type.text.mapping.text.type: text} - ---- -"Get field mapping by type & field": - - - do: - indices.get_field_mapping: - include_type_name: true - index: test_index - type: test_type - fields: text - - - match: {test_index.mappings.test_type.text.mapping.text.type: text} - ---- -"Get field mapping by type & field, with another field that doesn't exist": - - - do: - indices.get_field_mapping: - include_type_name: true - index: test_index - type: test_type - fields: [ text , text1 ] - - - match: {test_index.mappings.test_type.text.mapping.text.type: text} - - is_false: test_index.mappings.test_type.text1 - ---- -"Get field mapping with include_defaults": - - - do: - indices.get_field_mapping: - include_type_name: true - index: test_index - type: test_type - fields: text - include_defaults: true - - - match: {test_index.mappings.test_type.text.mapping.text.type: text} - - match: {test_index.mappings.test_type.text.mapping.text.analyzer: default} - ---- -"Get field mapping should work without index specifying type and fields": - - - do: - indices.get_field_mapping: - include_type_name: true - type: test_type - fields: text - - - match: {test_index.mappings.test_type.text.mapping.text.type: text} - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/20_missing_field.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/20_missing_field.yml deleted file mode 100644 index 1570ded351874..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/20_missing_field.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -"Return empty object if field doesn't exist, but type and index do": - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0 - - do: - indices.create: - index: test_index - body: - mappings: - properties: - text: - type: text - analyzer: whitespace - - - do: - indices.get_field_mapping: - index: test_index - fields: not_existent - - - match: { 'test_index.mappings': {}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/21_missing_field_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/21_missing_field_with_types.yml deleted file mode 100644 index 264d187ebd22d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/21_missing_field_with_types.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -"Return empty object if field doesn't exist, but type and index do": - - - do: - indices.create: - include_type_name: true - index: test_index - body: - mappings: - test_type: - properties: - text: - type: text - analyzer: whitespace - - - do: - indices.get_field_mapping: - include_type_name: true - index: test_index - type: test_type - fields: not_existent - - - match: { '': {}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/30_missing_type.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/30_missing_type.yml deleted file mode 100644 index 0bf3f1f7823ee..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/30_missing_type.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -"Raise 404 when type doesn't exist": - - - do: - indices.create: - include_type_name: true - index: test_index - body: - mappings: - test_type: - properties: - text: - type: text - analyzer: whitespace - - - do: - catch: missing - indices.get_field_mapping: - include_type_name: true - index: test_index - type: not_test_type - fields: text diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/40_missing_index.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/40_missing_index.yml deleted file mode 100644 index 7c7b07b587849..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/40_missing_index.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -"Raise 404 when index doesn't exist": - - - do: - catch: missing - indices.get_field_mapping: - index: test_index - fields: field - - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/50_field_wildcards.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/50_field_wildcards.yml deleted file mode 100644 index 7db61d122e7ce..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/50_field_wildcards.yml +++ /dev/null @@ -1,133 +0,0 @@ ---- -setup: - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0 - - do: - indices.create: - index: test_index - body: - mappings: - properties: - t1: - type: text - t2: - type: text - obj: - properties: - t1: - type: text - i_t1: - type: text - i_t3: - type: text - - - do: - indices.create: - index: test_index_2 - body: - mappings: - properties: - t1: - type: text - t2: - type: text - obj: - properties: - t1: - type: text - i_t1: - type: text - i_t3: - type: text - ---- -"Get field mapping with * for fields": - - - do: - indices.get_field_mapping: - fields: "*" - - - match: {test_index.mappings.t1.full_name: t1 } - - match: {test_index.mappings.t2.full_name: t2 } - - match: {test_index.mappings.obj\.t1.full_name: obj.t1 } - - match: {test_index.mappings.obj\.i_t1.full_name: obj.i_t1 } - - match: {test_index.mappings.obj\.i_t3.full_name: obj.i_t3 } - ---- -"Get field mapping with t* for fields": - - - do: - indices.get_field_mapping: - index: test_index - fields: "t*" - - - match: {test_index.mappings.t1.full_name: t1 } - - match: {test_index.mappings.t2.full_name: t2 } - - length: {test_index.mappings: 2} - ---- -"Get field mapping with *t1 for fields": - - - do: - indices.get_field_mapping: - index: test_index - fields: "*t1" - - match: {test_index.mappings.t1.full_name: t1 } - - match: {test_index.mappings.obj\.t1.full_name: obj.t1 } - - match: {test_index.mappings.obj\.i_t1.full_name: obj.i_t1 } - - length: {test_index.mappings: 3} - ---- -"Get field mapping with wildcarded relative names": - - - do: - indices.get_field_mapping: - index: test_index - fields: "obj.i_*" - - match: {test_index.mappings.obj\.i_t1.full_name: obj.i_t1 } - - match: {test_index.mappings.obj\.i_t3.full_name: obj.i_t3 } - - length: {test_index.mappings: 2} - ---- -"Get field mapping should work using '_all' for index": - - - do: - indices.get_field_mapping: - index: _all - fields: "t*" - - match: {test_index.mappings.t1.full_name: t1 } - - match: {test_index.mappings.t2.full_name: t2 } - - length: {test_index.mappings: 2} - - match: {test_index_2.mappings.t1.full_name: t1 } - - match: {test_index_2.mappings.t2.full_name: t2 } - - length: {test_index_2.mappings: 2} - ---- -"Get field mapping should work using '*' for index": - - - do: - indices.get_field_mapping: - index: '*' - fields: "t*" - - match: {test_index.mappings.t1.full_name: t1 } - - match: {test_index.mappings.t2.full_name: t2 } - - length: {test_index.mappings: 2} - - match: {test_index_2.mappings.t1.full_name: t1 } - - match: {test_index_2.mappings.t2.full_name: t2 } - - length: {test_index_2.mappings: 2} - ---- -"Get field mapping should work using comma_separated values for indices": - - - do: - indices.get_field_mapping: - index: 'test_index,test_index_2' - fields: "t*" - - match: {test_index.mappings.t1.full_name: t1 } - - match: {test_index.mappings.t2.full_name: t2 } - - length: {test_index.mappings: 2} - - match: {test_index_2.mappings.t1.full_name: t1 } - - match: {test_index_2.mappings.t2.full_name: t2 } - - length: {test_index_2.mappings: 2} - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/51_field_wildcards_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/51_field_wildcards_with_types.yml deleted file mode 100644 index 68c183e9b292e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/51_field_wildcards_with_types.yml +++ /dev/null @@ -1,144 +0,0 @@ ---- -setup: - - do: - indices.create: - include_type_name: true - index: test_index - body: - mappings: - test_type: - properties: - t1: - type: text - t2: - type: text - obj: - properties: - t1: - type: text - i_t1: - type: text - i_t3: - type: text - - - do: - indices.create: - include_type_name: true - index: test_index_2 - body: - mappings: - test_type_2: - properties: - t1: - type: text - t2: - type: text - obj: - properties: - t1: - type: text - i_t1: - type: text - i_t3: - type: text - ---- -"Get field mapping with * for fields": - - - do: - indices.get_field_mapping: - include_type_name: true - fields: "*" - - - match: {test_index.mappings.test_type.t1.full_name: t1 } - - match: {test_index.mappings.test_type.t2.full_name: t2 } - - match: {test_index.mappings.test_type.obj\.t1.full_name: obj.t1 } - - match: {test_index.mappings.test_type.obj\.i_t1.full_name: obj.i_t1 } - - match: {test_index.mappings.test_type.obj\.i_t3.full_name: obj.i_t3 } - ---- -"Get field mapping with t* for fields": - - - do: - indices.get_field_mapping: - include_type_name: true - index: test_index - fields: "t*" - - - match: {test_index.mappings.test_type.t1.full_name: t1 } - - match: {test_index.mappings.test_type.t2.full_name: t2 } - - length: {test_index.mappings.test_type: 2} - ---- -"Get field mapping with *t1 for fields": - - - do: - indices.get_field_mapping: - include_type_name: true - index: test_index - fields: "*t1" - - match: {test_index.mappings.test_type.t1.full_name: t1 } - - match: {test_index.mappings.test_type.obj\.t1.full_name: obj.t1 } - - match: {test_index.mappings.test_type.obj\.i_t1.full_name: obj.i_t1 } - - length: {test_index.mappings.test_type: 3} - ---- -"Get field mapping with wildcarded relative names": - - - do: - indices.get_field_mapping: - include_type_name: true - index: test_index - fields: "obj.i_*" - - match: {test_index.mappings.test_type.obj\.i_t1.full_name: obj.i_t1 } - - match: {test_index.mappings.test_type.obj\.i_t3.full_name: obj.i_t3 } - - length: {test_index.mappings.test_type: 2} - ---- -"Get field mapping should work using '_all' for indices and types": - - - do: - indices.get_field_mapping: - include_type_name: true - index: _all - type: _all - fields: "t*" - - match: {test_index.mappings.test_type.t1.full_name: t1 } - - match: {test_index.mappings.test_type.t2.full_name: t2 } - - length: {test_index.mappings.test_type: 2} - - match: {test_index_2.mappings.test_type_2.t1.full_name: t1 } - - match: {test_index_2.mappings.test_type_2.t2.full_name: t2 } - - length: {test_index_2.mappings.test_type_2: 2} - ---- -"Get field mapping should work using '*' for indices and types": - - - do: - indices.get_field_mapping: - include_type_name: true - index: '*' - type: '*' - fields: "t*" - - match: {test_index.mappings.test_type.t1.full_name: t1 } - - match: {test_index.mappings.test_type.t2.full_name: t2 } - - length: {test_index.mappings.test_type: 2} - - match: {test_index_2.mappings.test_type_2.t1.full_name: t1 } - - match: {test_index_2.mappings.test_type_2.t2.full_name: t2 } - - length: {test_index_2.mappings.test_type_2: 2} - ---- -"Get field mapping should work using comma_separated values for indices and types": - - - do: - indices.get_field_mapping: - include_type_name: true - index: 'test_index,test_index_2' - type: 'test_type,test_type_2' - fields: "t*" - - match: {test_index.mappings.test_type.t1.full_name: t1 } - - match: {test_index.mappings.test_type.t2.full_name: t2 } - - length: {test_index.mappings.test_type: 2} - - match: {test_index_2.mappings.test_type_2.t1.full_name: t1 } - - match: {test_index_2.mappings.test_type_2.t2.full_name: t2 } - - length: {test_index_2.mappings.test_type_2: 2} - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/60_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/60_mix_typeless_typeful.yml deleted file mode 100644 index 2b6433a3e98f8..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_field_mapping/60_mix_typeless_typeful.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -"GET mapping with typeless API on an index that has types": - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - - do: - indices.get_field_mapping: - include_type_name: false - index: index - fields: foo - - - match: { index.mappings.foo.mapping.foo.type: "keyword" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/10_basic.yml deleted file mode 100644 index c3addd95469d4..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/10_basic.yml +++ /dev/null @@ -1,88 +0,0 @@ ---- -setup: - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0 - - do: - indices.create: - index: test_1 - body: - mappings: {} - - do: - indices.create: - index: test_2 - body: - mappings: {} ---- -"Get /{index}/_mapping with empty mappings": - - - do: - indices.create: - index: t - - - do: - indices.get_mapping: - index: t - - - match: { t.mappings: {}} - ---- -"Get /_mapping": - - - do: - indices.get_mapping: {} - - - is_true: test_1.mappings - - is_true: test_2.mappings - ---- -"Get /{index}/_mapping": - - - do: - indices.get_mapping: - index: test_1 - - - is_true: test_1.mappings - - is_false: test_2 - - - ---- -"Get /_all/_mapping": - - - do: - indices.get_mapping: - index: _all - - - is_true: test_1.mappings - - is_true: test_2.mappings - ---- -"Get /*/_mapping": - - - do: - indices.get_mapping: - index: '*' - - - is_true: test_1.mappings - - is_true: test_2.mappings - ---- -"Get /index,index/_mapping": - - - do: - indices.get_mapping: - index: test_1,test_2 - - - is_true: test_1.mappings - - is_true: test_2.mappings - ---- -"Get /index*/_mapping/": - - - do: - indices.get_mapping: - index: '*2' - - - is_true: test_2.mappings - - is_false: test_1 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/11_basic_with_types.yml deleted file mode 100644 index 598cc24f7806b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/11_basic_with_types.yml +++ /dev/null @@ -1,158 +0,0 @@ ---- -setup: - - do: - indices.create: - include_type_name: true - index: test_1 - body: - mappings: - doc: {} - - do: - indices.create: - include_type_name: true - index: test_2 - body: - mappings: - doc: {} ---- -"Get /{index}/_mapping with empty mappings": - - - do: - indices.create: - index: t - - - do: - indices.get_mapping: - include_type_name: true - index: t - - - match: { t.mappings: {}} - ---- -"Get /_mapping": - - - do: - indices.get_mapping: - include_type_name: true - - - is_true: test_1.mappings.doc - - is_true: test_2.mappings.doc - ---- -"Get /{index}/_mapping": - - - do: - indices.get_mapping: - include_type_name: true - index: test_1 - - - is_true: test_1.mappings.doc - - is_false: test_2 - - ---- -"Get /{index}/_mapping/_all": - - - do: - indices.get_mapping: - include_type_name: true - index: test_1 - type: _all - - - is_true: test_1.mappings.doc - - is_false: test_2 - ---- -"Get /{index}/_mapping/*": - - - do: - indices.get_mapping: - include_type_name: true - index: test_1 - type: '*' - - - is_true: test_1.mappings.doc - - is_false: test_2 - ---- -"Get /{index}/_mapping/{type}": - - - do: - indices.get_mapping: - include_type_name: true - index: test_1 - type: doc - - - is_true: test_1.mappings.doc - - is_false: test_2 - ---- -"Get /{index}/_mapping/{type*}": - - - do: - indices.get_mapping: - include_type_name: true - index: test_1 - type: 'd*' - - - is_true: test_1.mappings.doc - - is_false: test_2 - ---- -"Get /_mapping/{type}": - - - do: - indices.get_mapping: - include_type_name: true - type: doc - - - is_true: test_1.mappings.doc - - is_true: test_2.mappings.doc - ---- -"Get /_all/_mapping/{type}": - - - do: - indices.get_mapping: - include_type_name: true - index: _all - type: doc - - - is_true: test_1.mappings.doc - - is_true: test_2.mappings.doc - ---- -"Get /*/_mapping/{type}": - - - do: - indices.get_mapping: - include_type_name: true - index: '*' - type: doc - - - is_true: test_1.mappings.doc - - is_true: test_2.mappings.doc - ---- -"Get /index,index/_mapping/{type}": - - - do: - indices.get_mapping: - include_type_name: true - index: test_1,test_2 - type: doc - - - is_true: test_1.mappings.doc - - is_true: test_2.mappings.doc - ---- -"Get /index*/_mapping/{type}": - - - do: - indices.get_mapping: - include_type_name: true - index: '*2' - type: doc - - - is_true: test_2.mappings.doc - - is_false: test_1 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/20_missing_type.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/20_missing_type.yml deleted file mode 100644 index f17fb6a595305..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/20_missing_type.yml +++ /dev/null @@ -1,106 +0,0 @@ ---- -"Non-existent type returns 404": - - do: - indices.create: - include_type_name: true - index: test_index - body: - mappings: - test_type: - properties: - text: - type: text - analyzer: whitespace - - - do: - catch: missing - indices.get_mapping: - include_type_name: true - index: test_index - type: not_test_type - - - match: { status: 404 } - - match: { error.reason: 'type[[not_test_type]] missing' } - ---- -"No type matching pattern returns 404": - - do: - indices.create: - include_type_name: true - index: test_index - body: - mappings: - test_type: - properties: - text: - type: text - analyzer: whitespace - - - do: - catch: missing - indices.get_mapping: - include_type_name: true - index: test_index - type: test*,not* - - - match: { status: 404 } - - match: { error: 'type [not*] missing' } - - is_true: test_index.mappings.test_type - ---- -"Existent and non-existent type returns 404 and the existing type": - - do: - indices.create: - include_type_name: true - index: test_index - body: - mappings: - test_type: - properties: - text: - type: text - analyzer: whitespace - - - do: - catch: missing - indices.get_mapping: - include_type_name: true - index: test_index - type: test_type,not_test_type - - - match: { status: 404 } - - match: { error: 'type [not_test_type] missing' } - - is_true: test_index.mappings.test_type - ---- -"Existent and non-existent types returns 404 and the existing type": - - do: - indices.create: - include_type_name: true - index: test_index - body: - mappings: - test_type: - properties: - text: - type: text - analyzer: whitespace - - - do: - catch: missing - indices.get_mapping: - include_type_name: true - index: test_index - type: test_type,not_test_type,another_not_test_type - - - match: { status: 404 } - - match: { error: 'types [another_not_test_type,not_test_type] missing' } - - is_true: test_index.mappings.test_type - ---- -"Type missing when no types exist": - - do: - catch: missing - indices.get_mapping: - include_type_name: true - type: not_test_type diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/30_missing_index.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/30_missing_index.yml deleted file mode 100644 index 5a7624265ecc9..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/30_missing_index.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -"Raise 404 when index doesn't exist": - - do: - catch: missing - indices.get_mapping: - index: test_index - ---- -"Index missing, no indexes": - - do: - catch: missing - indices.get_mapping: - index: test_index - ---- -"Index missing, ignore_unavailable=true": - - skip: - version: " - 6.99.99" - reason: ignore_unavailable was ignored in previous versions - - do: - indices.get_mapping: - index: test_index - ignore_unavailable: true - - - match: { '': {} } - ---- -"Index missing, ignore_unavailable=true, allow_no_indices=false": - - do: - catch: missing - indices.get_mapping: - index: test_index - ignore_unavailable: true - allow_no_indices: false - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/40_aliases.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/40_aliases.yml deleted file mode 100644 index 15a52b7b2db25..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/40_aliases.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -"Getting mapping for aliases should return the real index as key": - - - do: - indices.create: - index: test_index - body: - mappings: - properties: - text: - type: text - analyzer: whitespace - - - do: - indices.put_alias: - index: test_index - name: test_alias - - - do: - indices.get_mapping: - include_type_name: false - index: test_alias - - - match: {test_index.mappings.properties.text.type: text} - - match: {test_index.mappings.properties.text.analyzer: whitespace} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/50_wildcard_expansion.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/50_wildcard_expansion.yml deleted file mode 100644 index d3f15b3292285..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/50_wildcard_expansion.yml +++ /dev/null @@ -1,135 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test-xxx - body: - settings: - index: - number_of_replicas: 0 - mappings: - properties: - foo: - type: keyword - - do: - indices.create: - index: test-xxy - body: - settings: - index: - number_of_replicas: 0 - mappings: - properties: - foo2: - type: keyword - - do: - indices.create: - index: test-xyy - body: - settings: - index: - number_of_replicas: 0 - mappings: - properties: - foo3: - type: keyword - - do: - indices.create: - index: test-yyy - body: - settings: - index: - number_of_replicas: 0 - mappings: - properties: - foo4: - type: keyword - - - do: - cluster.health: - wait_for_status: green - - - do: - indices.close: - index: test-xyy - - - do: - cluster.health: - wait_for_status: green - ---- -"Get test-* with defaults": - - - do: - indices.get_mapping: - index: test-x* - - - is_true: test-xxx.mappings - - is_true: test-xxy.mappings - ---- -"Get test-* with wildcard_expansion=all": - - - do: - indices.get_mapping: - index: test-x* - expand_wildcards: all - - - is_true: test-xxx.mappings - - is_true: test-xxy.mappings - - is_true: test-xyy.mappings - ---- -"Get test-* with wildcard_expansion=open": - - - do: - indices.get_mapping: - index: test-x* - expand_wildcards: open - - - is_true: test-xxx.mappings - - is_true: test-xxy.mappings - ---- -"Get test-* with wildcard_expansion=closed": - - - do: - indices.get_mapping: - index: test-x* - expand_wildcards: closed - - - is_true: test-xyy.mappings - ---- -"Get test-* with wildcard_expansion=none": - - skip: - version: " - 6.99.99" - reason: allow_no_indices (defaults to true) was ignored in previous versions - - do: - indices.get_mapping: - index: test-x* - expand_wildcards: none - - - match: { '': {} } ---- -"Get test-* with wildcard_expansion=none allow_no_indices=false": - - skip: - version: " - 6.99.99" - reason: allow_no_indices was ignored in previous versions - - do: - catch: missing - indices.get_mapping: - index: test-x* - expand_wildcards: none - allow_no_indices: false ---- -"Get test-* with wildcard_expansion=open,closed": - - - do: - indices.get_mapping: - index: test-x* - expand_wildcards: open,closed - - - is_true: test-xxx.mappings - - is_true: test-xxy.mappings - - is_true: test-xyy.mappings diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/60_empty.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/60_empty.yml deleted file mode 100644 index b5069295a1fa6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/60_empty.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test_1 - - - do: - indices.create: - index: test_2 - ---- -"Check empty mapping when getting all mappings via /_mapping": - - - do: - indices.get_mapping: {} - - - match: { test_1.mappings: {}} - - match: { test_2.mappings: {}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/61_empty_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/61_empty_with_types.yml deleted file mode 100644 index 6da7f4a2c6946..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/61_empty_with_types.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -setup: - - - do: - indices.create: - index: test_1 - - - do: - indices.create: - index: test_2 - ---- -"Check empty mapping when getting all mappings via /_mapping": - - - do: - indices.get_mapping: - include_type_name: true - - - match: { test_1.mappings: {}} - - match: { test_2.mappings: {}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/70_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/70_mix_typeless_typeful.yml deleted file mode 100644 index 162a8d340d48a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_mapping/70_mix_typeless_typeful.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -"GET mapping with typeless API on an index that has types": - - - skip: - version: " - 6.99.99" - reason: include_type_name was introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - - do: - indices.get_mapping: - index: index - - - match: { index.mappings.properties.foo.type: "keyword" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/10_basic.yml deleted file mode 100644 index a50be32e82c6a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/10_basic.yml +++ /dev/null @@ -1,173 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test_1 - body: - settings: - number_of_shards: 5 - number_of_replicas: 1 - - do: - indices.create: - index: test_2 - body: - settings: - number_of_shards: 3 - number_of_replicas: 0 - ---- -"Get /_settings": - - - do: - indices.get_settings: {} - - - match: { test_1.settings.index.number_of_shards: "5"} - - match: { test_1.settings.index.number_of_replicas: "1"} - - match: { test_2.settings.index.number_of_shards: "3"} - - match: { test_2.settings.index.number_of_replicas: "0"} - ---- -"Get /{index}/_settings": - - - do: - indices.get_settings: - index: test_1 - - - match: { test_1.settings.index.number_of_shards: "5"} - - match: { test_1.settings.index.number_of_replicas: "1"} - - is_false: test_2 - - ---- -"Get /{index}/_settings/_all": - - - do: - indices.get_settings: - index: test_1 - name: _all - - - match: { test_1.settings.index.number_of_shards: "5"} - - match: { test_1.settings.index.number_of_replicas: "1"} - - is_false: test_2 - ---- -"Get /{index}/_settings/*": - - - do: - indices.get_settings: - index: test_1 - name: '*' - - - match: { test_1.settings.index.number_of_shards: "5"} - - match: { test_1.settings.index.number_of_replicas: "1"} - - is_false: test_2 - ---- -"Get /{index}/_settings/{name}": - - - do: - indices.get_settings: - index: test_1 - name: index.number_of_shards - - - match: { test_1.settings.index.number_of_shards: "5"} - - is_false: test_1.settings.index.number_of_replicas - - is_false: test_2 - ---- -"Get /{index}/_settings/{name,name}": - - - do: - indices.get_settings: - index: test_1 - name: index.number_of_shards,index.number_of_replicas - - - match: { test_1.settings.index.number_of_shards: "5"} - - match: { test_1.settings.index.number_of_replicas: "1"} - - is_false: test_2 - ---- -"Get /{index}/_settings/{name*}": - - - do: - indices.get_settings: - index: test_1 - name: 'index.number_of_s*' - - - match: { test_1.settings.index.number_of_shards: "5"} - - is_false: test_1.settings.index.number_of_replicas - - is_false: test_2 - ---- -"Get /_settings/{name}": - - - do: - indices.get_settings: - name: index.number_of_shards - - - match: { test_1.settings.index.number_of_shards: "5"} - - match: { test_2.settings.index.number_of_shards: "3"} - - is_false: test_1.settings.index.number_of_replicas - - is_false: test_2.settings.index.number_of_replicas - ---- -"Get /_all/_settings/{name}": - - - do: - indices.get_settings: - index: _all - name: index.number_of_shards - - - match: { test_1.settings.index.number_of_shards: "5"} - - match: { test_2.settings.index.number_of_shards: "3"} - - is_false: test_1.settings.index.number_of_replicas - - is_false: test_2.settings.index.number_of_replicas - - ---- -"Get /*/_settings/{name}": - - - do: - indices.get_settings: - index: '*' - name: index.number_of_shards - - - match: { test_1.settings.index.number_of_shards: "5"} - - match: { test_2.settings.index.number_of_shards: "3"} - - is_false: test_1.settings.index.number_of_replicas - - is_false: test_2.settings.index.number_of_replicas - ---- -"Get /index,index/_settings/{name}": - - - do: - indices.get_settings: - index: test_1,test_2 - name: index.number_of_shards - - - match: { test_1.settings.index.number_of_shards: "5"} - - match: { test_2.settings.index.number_of_shards: "3"} - - is_false: test_1.settings.index.number_of_replicas - - is_false: test_2.settings.index.number_of_replicas - ---- -"Get /index*/_settings/{name}": - - - do: - indices.get_settings: - index: '*2' - name: index.number_of_shards - - - match: { test_2.settings.index.number_of_shards: "3"} - - is_false: test_1 - - is_false: test_2.settings.index.number_of_replicas - ---- -"Get /_settings with local flag": - - - do: - indices.get_settings: - local: true - - - is_true: test_1 - - is_true: test_2 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/20_aliases.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/20_aliases.yml deleted file mode 100644 index da7678202ed34..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/20_aliases.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -"Getting settings for aliases should return the real index as key": - - - do: - indices.create: - index: test-index - body: - settings: - index: - refresh_interval: -1 - number_of_shards: 2 - number_of_replicas: 3 - - - do: - indices.put_alias: - index: test-index - name: test-alias - - - do: - indices.get_settings: - index: test-alias - - - match: { test-index.settings.index.number_of_replicas: "3" } - - match: { test-index.settings.index.number_of_shards: "2" } - - match: { test-index.settings.index.refresh_interval: "-1" } - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml deleted file mode 100644 index 2e3f4af03ebef..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -setup: - - do: - indices.create: - body: - settings: - index: - number_of_shards: 1 - number_of_replicas: 1 - index: test-index ---- -Test retrieval of default settings: - - skip: - version: " - 6.3.99" - reason: include_defaults will not work in mixed-mode clusters containing nodes pre-6.4 - - do: - indices.get_settings: - flat_settings: true - index: test-index - - is_false: - test-index.settings.index\.refresh_interval - - do: - indices.get_settings: - include_defaults: true - flat_settings: true - index: test-index - - match: - test-index.defaults.index\.refresh_interval: "1s" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/10_basic.yml deleted file mode 100644 index c1aac94bf1d84..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/10_basic.yml +++ /dev/null @@ -1,85 +0,0 @@ -setup: - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0.0 - - do: - indices.put_template: - name: test - body: - index_patterns: test-* - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - properties: - field: - type: keyword - ---- -"Get template": - - - do: - indices.get_template: - name: test - - - match: {test.index_patterns: ["test-*"]} - - match: {test.settings: {index: {number_of_shards: '1', number_of_replicas: '0'}}} - - match: {test.mappings: {properties: {field: {type: keyword}}}} - ---- -"Get template with no mappings": - - - do: - indices.put_template: - name: test_no_mappings - body: - index_patterns: test-* - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - indices.get_template: - name: test_no_mappings - - - match: {test_no_mappings.index_patterns: ["test-*"]} - - match: {test_no_mappings.settings: {index: {number_of_shards: '1', number_of_replicas: '0'}}} - - match: {test_no_mappings.mappings: {}} - ---- -"Get all templates": - - - do: - indices.put_template: - name: test2 - body: - index_patterns: test2-* - settings: - number_of_shards: 1 - - - do: - indices.get_template: {} - - - match: {test.index_patterns: ["test-*"]} - - match: {test2.index_patterns: ["test2-*"]} - ---- -"Get template with local flag": - - - do: - indices.get_template: - name: test - local: true - - - is_true: test - ---- -"Get template with flat settings and master timeout": - - - do: - indices.get_template: - name: test - flat_settings: true - master_timeout: 1m - - - match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/11_basic_with_types.yml deleted file mode 100644 index 0ecf304b1ce70..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/11_basic_with_types.yml +++ /dev/null @@ -1,48 +0,0 @@ -setup: - - do: - indices.put_template: - include_type_name: true - name: test - body: - index_patterns: test-* - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - _doc: - properties: - field: - type: keyword - ---- -"Get template": - - - do: - indices.get_template: - include_type_name: true - name: test - - - match: {test.index_patterns: ["test-*"]} - - match: {test.settings: {index: {number_of_shards: '1', number_of_replicas: '0'}}} - - match: {test.mappings: {_doc: {properties: {field: {type: keyword}}}}} - ---- -"Get template with no mappings": - - - do: - indices.put_template: - name: test_no_mappings - body: - index_patterns: test-* - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - indices.get_template: - include_type_name: true - name: test_no_mappings - - - match: {test_no_mappings.index_patterns: ["test-*"]} - - match: {test_no_mappings.settings: {index: {number_of_shards: '1', number_of_replicas: '0'}}} - - match: {test_no_mappings.mappings: {}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/20_get_missing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/20_get_missing.yml deleted file mode 100644 index 2751f57dacb6c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.get_template/20_get_missing.yml +++ /dev/null @@ -1,13 +0,0 @@ -setup: - - do: - indices.delete_template: - name: '*' - ignore: 404 ---- -"Get missing template": - - - do: - catch: missing - indices.get_template: - name: test - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/10_basic.yml deleted file mode 100644 index 3d30f126cf671..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/10_basic.yml +++ /dev/null @@ -1,121 +0,0 @@ ---- -"Basic test for index open/close": - - do: - indices.create: - index: test_index - body: - settings: - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - indices.close: - index: test_index - - is_true: acknowledged - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - index: test_index - - - do: - indices.open: - index: test_index - - is_true: acknowledged - - - do: - cluster.health: - wait_for_status: green - - - do: - search: - rest_total_hits_as_int: true - index: test_index - ---- -"Open index with wait_for_active_shards set to all": - - skip: - version: " - 6.0.99" - reason: wait_for_active_shards parameter was added in 6.1.0 - - - do: - indices.create: - index: test_index - body: - settings: - number_of_replicas: 0 - - - do: - indices.close: - index: test_index - - is_true: acknowledged - - - do: - indices.open: - index: test_index - wait_for_active_shards: all - - is_true: acknowledged - - match: { acknowledged: true } - - match: { shards_acknowledged: true } - ---- -"Close index with wait_for_active_shards set to all": - - skip: - version: " - 7.1.99" - reason: "closed indices are replicated starting version 7.2.0" - - - do: - indices.create: - index: test_index - body: - settings: - number_of_replicas: 0 - - - do: - indices.close: - index: test_index - wait_for_active_shards: all - - is_true: acknowledged - - match: { acknowledged: true } - - match: { shards_acknowledged: true } ---- -"Close index response with result per index": - - skip: - version: " - 7.2.99" - reason: "close index response reports result per index starting version 7.3.0" - - - do: - indices.create: - index: index_1 - body: - settings: - number_of_replicas: 0 - - - do: - indices.create: - index: index_2 - body: - settings: - number_of_replicas: 0 - - - do: - indices.create: - index: index_3 - body: - settings: - number_of_replicas: 0 - - - do: - indices.close: - index: "index_*" - - - match: { acknowledged: true } - - match: { shards_acknowledged: true } - - match: { indices.index_1.closed: true } - - match: { indices.index_2.closed: true } - - match: { indices.index_3.closed: true } - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/20_multiple_indices.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/20_multiple_indices.yml deleted file mode 100644 index bef5ea8a54651..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.open/20_multiple_indices.yml +++ /dev/null @@ -1,104 +0,0 @@ -setup: - - do: - indices.create: - index: test_index1 - body: - settings: - number_of_replicas: 0 - - do: - indices.create: - index: test_index2 - body: - settings: - number_of_replicas: 0 - - do: - indices.create: - index: test_index3 - body: - settings: - number_of_replicas: 0 - - do: - cluster.health: - wait_for_status: green - ---- -"All indices": - - do: - indices.close: - index: _all - - is_true: acknowledged - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - index: test_index2 - - - do: - indices.open: - index: _all - - is_true: acknowledged - - - do: - cluster.health: - wait_for_status: green - - - do: - search: - rest_total_hits_as_int: true - index: test_index2 - ---- -"Trailing wildcard": - - do: - indices.close: - index: test_* - - is_true: acknowledged - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - index: test_index2 - - - do: - indices.open: - index: test_* - - is_true: acknowledged - - - do: - cluster.health: - wait_for_status: green - - - do: - search: - rest_total_hits_as_int: true - index: test_index2 - ---- -"Only wildcard": - - do: - indices.close: - index: '*' - - is_true: acknowledged - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - index: test_index3 - - - do: - indices.open: - index: '*' - - is_true: acknowledged - - - do: - cluster.health: - wait_for_status: green - - - do: - search: - rest_total_hits_as_int: true - index: test_index3 - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/10_basic.yml deleted file mode 100644 index dd0628ea993ee..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/10_basic.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -"Basic test for put alias": - - - do: - indices.create: - index: test_index - - - do: - indices.exists_alias: - name: test_alias - - - is_false: '' - - - do: - indices.put_alias: - index: test_index - name: test_alias - - - do: - indices.exists_alias: - name: test_alias - - - is_true: '' - - - do: - indices.get_alias: - name: test_alias - - - match: {test_index.aliases.test_alias: {}} - ---- -"Can't create alias with invalid characters": - - - do: - indices.create: - index: test_index - - - do: - catch: bad_request - indices.put_alias: - index: test_index - name: test_* - ---- -"Can't create alias with the same name as an index": - - - do: - indices.create: - index: test_index - - do: - indices.create: - index: foo - - - do: - catch: bad_request - indices.put_alias: - index: test_index - name: foo - ---- -"Can set is_write_index": - - - skip: - version: " - 6.3.99" - reason: "is_write_index is only available from 6.4.0 on" - - - do: - indices.create: - index: test_index - - - do: - indices.put_alias: - index: test_index - name: test_alias - body: - is_write_index: true - - - do: - indices.get_alias: - index: test_index - name: test_alias - - match: {test_index.aliases.test_alias: { 'is_write_index': true }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml deleted file mode 100644 index bef57bbddf165..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml +++ /dev/null @@ -1,116 +0,0 @@ ---- -setup: -# create three indices - - - do: - indices.create: - index: test_index1 - - do: - indices.create: - index: test_index2 - - do: - indices.create: - index: foo - ---- -"put alias per index": - - do: - indices.put_alias: - index: test_index1 - name: alias - - do: - indices.put_alias: - index: test_index2 - name: alias - - - do: - indices.get_alias: - name: alias - - - match: {test_index1.aliases.alias: {}} - - - match: {test_index2.aliases.alias: {}} - - - is_false: foo - ---- -"put alias in _all index": - - - do: - indices.put_alias: - index: _all - name: alias - - - do: - indices.get_alias: - name: alias - - - match: {test_index1.aliases.alias: {}} - - match: {test_index2.aliases.alias: {}} - - match: {foo.aliases.alias: {}} - ---- -"put alias in * index": - - - - do: - indices.put_alias: - index: '*' - name: alias - - - do: - indices.get_alias: - name: alias - - - match: {test_index1.aliases.alias: {}} - - match: {test_index2.aliases.alias: {}} - - match: {foo.aliases.alias: {}} - ---- -"put alias prefix* index": - - do: - indices.put_alias: - index: "test_*" - name: alias - - - do: - indices.get_alias: - name: alias - - - match: {test_index1.aliases.alias: {}} - - match: {test_index2.aliases.alias: {}} - - is_false: foo - ---- -"put alias in list of indices": - - do: - indices.put_alias: - index: "test_index1,test_index2" - name: alias - - - do: - indices.get_alias: - name: alias - - - match: {test_index1.aliases.alias: {}} - - match: {test_index2.aliases.alias: {}} - - is_false: foo - ---- -"put alias with blank index": - - - - do: - catch: param - indices.put_alias: - name: alias - - ---- -"put alias with missing name": - - - - do: - catch: param - indices.put_alias: {} - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml deleted file mode 100644 index 338eaba8881c3..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml +++ /dev/null @@ -1,129 +0,0 @@ ---- -"Test Create and update mapping": - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0 - - do: - indices.create: - index: test_index - - - do: - indices.put_mapping: - index: test_index - body: - properties: - text1: - type: text - analyzer: whitespace - text2: - type: text - analyzer: whitespace - subfield.text3: - type: text - - - do: - indices.get_mapping: - index: test_index - - - match: {test_index.mappings.properties.text1.type: text} - - match: {test_index.mappings.properties.text1.analyzer: whitespace} - - match: {test_index.mappings.properties.text2.type: text} - - match: {test_index.mappings.properties.text2.analyzer: whitespace} - - - do: - indices.put_mapping: - index: test_index - body: - properties: - text1: - type: text - analyzer: whitespace - fields: - text_raw: - type: keyword - - - - do: - indices.get_mapping: - index: test_index - - - match: {test_index.mappings.properties.text1.type: text} - - match: {test_index.mappings.properties.subfield.properties.text3.type: text} - - match: {test_index.mappings.properties.text1.fields.text_raw.type: keyword} - ---- -"Create index with invalid mappings": - - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0 - - do: - indices.create: - index: test_index - - do: - catch: /illegal_argument_exception/ - indices.put_mapping: - index: test_index - body: - properties: - "": - type: keyword - ---- -"Put mappings with explicit _doc type": - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0 - - - do: - indices.create: - index: test_index - - - do: - catch: bad_request - indices.put_mapping: - index: test_index - body: - _doc: - properties: - field: - type: keyword - - - match: { error.type: "illegal_argument_exception" } - - match: { error.reason: "Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true." } - ---- -"Update per-field metadata": - - - skip: - version: " - 7.5.99" - reason: "Per-field meta was introduced in 7.6" - - - do: - indices.create: - index: test_index - body: - mappings: - properties: - foo: - type: keyword - meta: - bar: baz - - - do: - indices.put_mapping: - index: test_index - body: - properties: - foo: - type: keyword - meta: - baz: quux - - - do: - indices.get_mapping: - index: test_index - - - is_false: test_index.mappings.properties.foo.meta.bar - - match: { test_index.mappings.properties.foo.meta.baz: "quux" } - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/11_basic_with_types.yml deleted file mode 100644 index 5da9cd4bf707c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/11_basic_with_types.yml +++ /dev/null @@ -1,74 +0,0 @@ ---- -"Test Create and update mapping": - - do: - indices.create: - index: test_index - - - do: - indices.put_mapping: - include_type_name: true - index: test_index - type: test_type - body: - test_type: - properties: - text1: - type: text - analyzer: whitespace - text2: - type: text - analyzer: whitespace - subfield.text3: - type: text - - - do: - indices.get_mapping: - include_type_name: true - index: test_index - - - match: {test_index.mappings.test_type.properties.text1.type: text} - - match: {test_index.mappings.test_type.properties.text1.analyzer: whitespace} - - match: {test_index.mappings.test_type.properties.text2.type: text} - - match: {test_index.mappings.test_type.properties.text2.analyzer: whitespace} - - - do: - indices.put_mapping: - include_type_name: true - index: test_index - type: test_type - body: - test_type: - properties: - text1: - type: text - analyzer: whitespace - fields: - text_raw: - type: keyword - - - - do: - indices.get_mapping: - include_type_name: true - index: test_index - - - match: {test_index.mappings.test_type.properties.text1.type: text} - - match: {test_index.mappings.test_type.properties.subfield.properties.text3.type: text} - - match: {test_index.mappings.test_type.properties.text1.fields.text_raw.type: keyword} - ---- -"Create index with invalid mappings": - - do: - indices.create: - index: test_index - - do: - catch: /illegal_argument_exception/ - indices.put_mapping: - include_type_name: true - index: test_index - type: test_type - body: - test_type: - properties: - "": - type: keyword diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/20_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/20_mix_typeless_typeful.yml deleted file mode 100644 index 13cb3321841cf..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/20_mix_typeless_typeful.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -"PUT mapping with typeless API on an index that has types": - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - - do: - indices.put_mapping: - include_type_name: false - index: index - body: - properties: - bar: - type: "long" - - - do: - indices.get_mapping: - include_type_name: false - index: index - - - match: { index.mappings.properties.foo.type: "keyword" } - - match: { index.mappings.properties.bar.type: "long" } - - - do: - indices.put_mapping: - include_type_name: false - index: index - body: - properties: - foo: - type: "keyword" # also test no-op updates that trigger special logic wrt the mapping version - - - do: - catch: /the final mapping would have more than 1 type/ - indices.put_mapping: - include_type_name: true - index: index - type: some_other_type - body: - some_other_type: - properties: - bar: - type: "long" - - ---- -"PUT mapping with _doc on an index that has types": - - - skip: - version: " - 6.6.99" - reason: include_type_name is only supported as of 6.7 - - - - do: - indices.create: - include_type_name: true - index: index - body: - mappings: - my_type: - properties: - foo: - type: "keyword" - - - do: - catch: /the final mapping would have more than 1 type/ - indices.put_mapping: - include_type_name: true - index: index - type: _doc - body: - _doc: - properties: - bar: - type: "long" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml deleted file mode 100644 index 182ec017e0d30..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml +++ /dev/null @@ -1,165 +0,0 @@ -setup: - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0 - - do: - indices.create: - index: test_index1 - - do: - indices.create: - index: test_index2 - - do: - indices.create: - index: foo - - ---- -"put one mapping per index": - - do: - indices.put_mapping: - index: test_index1 - body: - properties: - text: - type: text - analyzer: whitespace - - do: - indices.put_mapping: - index: test_index2 - body: - properties: - text: - type: text - analyzer: whitespace - - - - do: - indices.get_mapping: {} - - - match: {test_index1.mappings.properties.text.type: text} - - match: {test_index1.mappings.properties.text.analyzer: whitespace} - - - match: {test_index2.mappings.properties.text.type: text} - - match: {test_index2.mappings.properties.text.analyzer: whitespace} - - - match: { foo.mappings: {} } - ---- -"put mapping in _all index": - - - do: - indices.put_mapping: - index: _all - body: - properties: - text: - type: text - analyzer: whitespace - - - do: - indices.get_mapping: {} - - - match: {test_index1.mappings.properties.text.type: text} - - match: {test_index1.mappings.properties.text.analyzer: whitespace} - - - match: {test_index2.mappings.properties.text.type: text} - - match: {test_index2.mappings.properties.text.analyzer: whitespace} - - - match: {foo.mappings.properties.text.type: text} - - match: {foo.mappings.properties.text.analyzer: whitespace} - ---- -"put mapping in * index": - - do: - indices.put_mapping: - index: "*" - body: - properties: - text: - type: text - analyzer: whitespace - - - do: - indices.get_mapping: {} - - - match: {test_index1.mappings.properties.text.type: text} - - match: {test_index1.mappings.properties.text.analyzer: whitespace} - - - match: {test_index2.mappings.properties.text.type: text} - - match: {test_index2.mappings.properties.text.analyzer: whitespace} - - - match: {foo.mappings.properties.text.type: text} - - match: {foo.mappings.properties.text.analyzer: whitespace} - ---- -"put mapping in prefix* index": - - do: - indices.put_mapping: - index: "test_index*" - body: - properties: - text: - type: text - analyzer: whitespace - - - do: - indices.get_mapping: {} - - - match: {test_index1.mappings.properties.text.type: text} - - match: {test_index1.mappings.properties.text.analyzer: whitespace} - - - match: {test_index2.mappings.properties.text.type: text} - - match: {test_index2.mappings.properties.text.analyzer: whitespace} - - - match: { foo.mappings: {} } - ---- -"put mapping in list of indices": - - do: - indices.put_mapping: - index: [test_index1, test_index2] - body: - properties: - text: - type: text - analyzer: whitespace - - - do: - indices.get_mapping: {} - - - match: {test_index1.mappings.properties.text.type: text} - - match: {test_index1.mappings.properties.text.analyzer: whitespace} - - - match: {test_index2.mappings.properties.text.type: text} - - match: {test_index2.mappings.properties.text.analyzer: whitespace} - - - match: { foo.mappings: {} } - ---- -"post a mapping with default analyzer twice": - - - do: - indices.put_mapping: - index: test_index1 - body: - dynamic: false - properties: - text: - analyzer: default - type: text - - - do: - indices.put_mapping: - index: test_index1 - body: - dynamic: false - properties: - text: - analyzer: default - type: text - - - do: - indices.get_mapping: {} - - - match: {test_index1.mappings.properties.text.type: text} - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options_with_types.yml deleted file mode 100644 index 6f9b6f7d9ceef..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_mapping/all_path_options_with_types.yml +++ /dev/null @@ -1,227 +0,0 @@ -setup: - - do: - indices.create: - index: test_index1 - - do: - indices.create: - index: test_index2 - - do: - indices.create: - index: foo - - ---- -"put one mapping per index": - - do: - indices.put_mapping: - include_type_name: true - index: test_index1 - type: test_type - body: - test_type: - properties: - text: - type: text - analyzer: whitespace - - do: - indices.put_mapping: - include_type_name: true - index: test_index2 - type: test_type - body: - test_type: - properties: - text: - type: text - analyzer: whitespace - - - - do: - indices.get_mapping: - include_type_name: true - - - match: {test_index1.mappings.test_type.properties.text.type: text} - - match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace} - - - match: {test_index2.mappings.test_type.properties.text.type: text} - - match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace} - - - match: { foo.mappings: {} } - ---- -"put mapping in _all index": - - - do: - indices.put_mapping: - include_type_name: true - index: _all - type: test_type - body: - test_type: - properties: - text: - type: text - analyzer: whitespace - - - do: - indices.get_mapping: - include_type_name: true - - - match: {test_index1.mappings.test_type.properties.text.type: text} - - match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace} - - - match: {test_index2.mappings.test_type.properties.text.type: text} - - match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace} - - - match: {foo.mappings.test_type.properties.text.type: text} - - match: {foo.mappings.test_type.properties.text.analyzer: whitespace} - ---- -"put mapping in * index": - - do: - indices.put_mapping: - include_type_name: true - index: "*" - type: test_type - body: - test_type: - properties: - text: - type: text - analyzer: whitespace - - - do: - indices.get_mapping: - include_type_name: true - - - match: {test_index1.mappings.test_type.properties.text.type: text} - - match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace} - - - match: {test_index2.mappings.test_type.properties.text.type: text} - - match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace} - - - match: {foo.mappings.test_type.properties.text.type: text} - - match: {foo.mappings.test_type.properties.text.analyzer: whitespace} - ---- -"put mapping in prefix* index": - - do: - indices.put_mapping: - include_type_name: true - index: "test_index*" - type: test_type - body: - test_type: - properties: - text: - type: text - analyzer: whitespace - - - do: - indices.get_mapping: - include_type_name: true - - - match: {test_index1.mappings.test_type.properties.text.type: text} - - match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace} - - - match: {test_index2.mappings.test_type.properties.text.type: text} - - match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace} - - - match: { foo.mappings: {} } - ---- -"put mapping in list of indices": - - do: - indices.put_mapping: - include_type_name: true - index: [test_index1, test_index2] - type: test_type - body: - test_type: - properties: - text: - type: text - analyzer: whitespace - - - do: - indices.get_mapping: - include_type_name: true - - - match: {test_index1.mappings.test_type.properties.text.type: text} - - match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace} - - - match: {test_index2.mappings.test_type.properties.text.type: text} - - match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace} - - - match: { foo.mappings: {} } - ---- -"put mapping with blank index": - - do: - indices.put_mapping: - include_type_name: true - type: test_type - body: - test_type: - properties: - text: - type: text - analyzer: whitespace - - - do: - indices.get_mapping: - include_type_name: true - - - match: {test_index1.mappings.test_type.properties.text.type: text} - - match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace} - - - match: {test_index2.mappings.test_type.properties.text.type: text} - - match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace} - - - match: {foo.mappings.test_type.properties.text.type: text} - - match: {foo.mappings.test_type.properties.text.analyzer: whitespace} - ---- -"put mapping with missing type": - - - - do: - catch: param - indices.put_mapping: - include_type_name: true - ---- -"post a mapping with default analyzer twice": - - - do: - indices.put_mapping: - include_type_name: true - index: test_index1 - type: test_type - body: - test_type: - dynamic: false - properties: - text: - analyzer: default - type: text - - - do: - indices.put_mapping: - include_type_name: true - index: test_index1 - type: test_type - body: - test_type: - dynamic: false - properties: - text: - analyzer: default - type: text - - - do: - indices.get_mapping: - include_type_name: true - - - match: {test_index1.mappings.test_type.properties.text.type: text} - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/10_basic.yml deleted file mode 100644 index 043800916d19a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/10_basic.yml +++ /dev/null @@ -1,123 +0,0 @@ -setup: - - do: - indices.create: - index: test-index - body: - settings: - index: - number_of_replicas: 0 - ---- -"Test indices settings": - - do: - indices.get_settings: - index: test-index - flat_settings: true - - - match: - test-index.settings.index\.number_of_replicas: "0" - - - do: - indices.put_settings: - body: - number_of_replicas: 1 - - - do: - indices.get_settings: - flat_settings: false - - - match: - test-index.settings.index.number_of_replicas: "1" - ---- -"Test indices settings ignore_unavailable": - - do: - indices.put_settings: - ignore_unavailable: true - index: test-index, non-existing - body: - index.number_of_replicas: 1 - - - do: - indices.get_settings: {} - - - match: - test-index.settings.index.number_of_replicas: "1" - ---- -"Test indices settings allow_no_indices": - - do: - indices.put_settings: - expand_wildcards: open - allow_no_indices: true - index: non-existing-* - body: - number_of_replicas: 1 - ---- -"Test preserve_existing settings": - - do: - indices.put_settings: - index: test-index - body: - number_of_replicas: 0 - - - do: - indices.get_settings: - flat_settings: false - - - match: - test-index.settings.index.number_of_replicas: "0" - - - do: - indices.put_settings: - preserve_existing: true - index: test-index - body: - index.number_of_replicas: 1 - index.translog.durability: "async" - - - do: - indices.get_settings: - flat_settings: false - - - match: - test-index.settings.index.number_of_replicas: "0" - - match: - test-index.settings.index.translog.durability: "async" - - - do: - indices.close: - index: test-index - - - do: - indices.put_settings: - preserve_existing: true - index: test-index - body: - settings: - index.translog.durability: "request" - index.query_string.lenient: "true" - - - do: - indices.get_settings: - index: test-index - flat_settings: false - - - match: - test-index.settings.index.query_string.lenient: "true" - - match: - test-index.settings.index.translog.durability: "async" - - - do: - indices.open: - index: test-index - - do: - indices.get_settings: - index: test-index - flat_settings: false - - - match: - test-index.settings.index.query_string.lenient: "true" - - match: - test-index.settings.index.translog.durability: "async" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/11_reset.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/11_reset.yml deleted file mode 100644 index ac5564fcd3ec4..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/11_reset.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -setup: - - do: - indices.create: - body: - settings: - index: - refresh_interval: 10s - index: test-index ---- -Test reset index settings: - - do: - indices.get_settings: - flat_settings: true - index: test-index - - match: - test-index.settings.index\.refresh_interval: "10s" - - do: - indices.put_settings: - body: - refresh_interval: null - - do: - indices.get_settings: - flat_settings: false - - is_false: test-index.settings.index\.refresh_interval diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/all_path_options.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/all_path_options.yml deleted file mode 100644 index 07f1956f0fcca..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_settings/all_path_options.yml +++ /dev/null @@ -1,113 +0,0 @@ -setup: - - do: - indices.create: - index: test_index1 - - do: - indices.create: - index: test_index2 - - do: - indices.create: - index: foo - - ---- -"put settings per index": - - do: - indices.put_settings: - index: test_index1 - body: - refresh_interval: 1s - - - do: - indices.put_settings: - index: test_index2 - body: - refresh_interval: 1s - - - - do: - indices.get_settings: {} - - - match: {test_index1.settings.index.refresh_interval: 1s} - - match: {test_index2.settings.index.refresh_interval: 1s} - - is_false: foo.settings.index.refresh_interval - ---- -"put settings in _all index": - - do: - indices.put_settings: - index: _all - body: - refresh_interval: 1s - - - do: - indices.get_settings: {} - - - match: {test_index1.settings.index.refresh_interval: 1s} - - match: {test_index2.settings.index.refresh_interval: 1s} - - match: {foo.settings.index.refresh_interval: 1s} - ---- -"put settings in * index": - - do: - indices.put_settings: - index: '*' - body: - refresh_interval: 1s - - - do: - indices.get_settings: {} - - - match: {test_index1.settings.index.refresh_interval: 1s} - - match: {test_index2.settings.index.refresh_interval: 1s} - - match: {foo.settings.index.refresh_interval: 1s} - - ---- -"put settings in prefix* index": - - do: - indices.put_settings: - index: 'test*' - body: - refresh_interval: 1s - - - do: - indices.get_settings: {} - - - match: {test_index1.settings.index.refresh_interval: 1s} - - match: {test_index2.settings.index.refresh_interval: 1s} - - is_false: foo.settings.index.refresh_interval - ---- -"put settings in list of indices": - - skip: - version: "all" - reason: list of indices not implemented yet - - do: - indices.put_settings: - index: test_index1, test_index2 - body: - refresh_interval: 1s - - - do: - indices.get_settings: {} - - - match: {test_index1.settings.index.refresh_interval: 1s} - - match: {test_index2.settings.index.refresh_interval: 1s} - - is_false: foo.settings.index.refresh_interval - - ---- -"put settings in blank index": - - do: - indices.put_settings: - body: - refresh_interval: 1s - - - do: - indices.get_settings: {} - - - match: {test_index1.settings.index.refresh_interval: 1s} - - match: {test_index2.settings.index.refresh_interval: 1s} - - match: {foo.settings.index.refresh_interval: 1s} - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/10_basic.yml deleted file mode 100644 index 3850ba4150b4f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/10_basic.yml +++ /dev/null @@ -1,261 +0,0 @@ ---- -"Put template": - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0.0 - - - do: - indices.put_template: - name: test - body: - index_patterns: test-* - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - properties: - field: - type: keyword - - - do: - indices.get_template: - name: test - flat_settings: true - - - match: {test.index_patterns: ["test-*"]} - - match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} - - match: {test.mappings: {properties: {field: {type: keyword}}}} - ---- -"Put multiple template": - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0.0 - - - do: - indices.put_template: - name: test - body: - index_patterns: [test-*, test2-*] - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - properties: - field: - type: text - - - do: - indices.get_template: - name: test - flat_settings: true - - - match: {test.index_patterns: ["test-*", "test2-*"]} - - match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} - - match: {test.mappings: {properties: {field: {type: text}}}} - ---- -"Put template with empty mappings": - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0.0 - - - do: - indices.put_template: - name: test - body: - index_patterns: test-* - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: {} - - - do: - indices.get_template: - name: test - flat_settings: true - - - match: {test.mappings: {}} - ---- -"Put template with aliases": - - - do: - indices.put_template: - name: test - body: - index_patterns: test-* - aliases: - test_alias: {} - test_blias: { routing: b } - test_clias: { filter: { term: { user: kimchy }}} - - - do: - indices.get_template: - name: test - - - match: { test.index_patterns: ["test-*"] } - - length: { test.aliases: 3 } - - is_true: test.aliases.test_alias - - match: { test.aliases.test_blias.index_routing: "b" } - - match: { test.aliases.test_blias.search_routing: "b" } - - match: { test.aliases.test_clias.filter.term.user: "kimchy" } - ---- -"Put template create": - - - do: - indices.put_template: - name: test - create: true - body: - index_patterns: test-* - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - indices.get_template: - name: test - flat_settings: true - - - match: {test.index_patterns: ["test-*"]} - - match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} - - - do: - catch: bad_request - indices.put_template: - name: test - create: true - body: - index_patterns: test-* - settings: - number_of_shards: 1 - number_of_replicas: 0 - ---- -"Test Put Versioned Template": - - - do: - indices.put_template: - name: "my_template" - body: > - { - "version": 10, - "index_patterns": "*", - "settings": { "number_of_shards": 1 } - } - - match: { acknowledged: true } - - - do: - indices.get_template: - name: "my_template" - - match: { my_template.version: 10 } - - # Lower version - - do: - indices.put_template: - name: "my_template" - body: > - { - "version": 9, - "index_patterns": "*", - "settings": { "number_of_shards": 1 } - } - - match: { acknowledged: true } - - - do: - indices.get_template: - name: "my_template" - - match: { my_template.version: 9 } - - # Higher version - - do: - indices.put_template: - name: "my_template" - body: > - { - "version": 6789, - "index_patterns": "*", - "settings": { "number_of_shards": 1 } - } - - match: { acknowledged: true } - - - do: - indices.get_template: - name: "my_template" - - match: { my_template.version: 6789 } - - # No version - - do: - indices.put_template: - name: "my_template" - body: > - { - "index_patterns": "*", - "settings": { "number_of_shards": 1 } - } - - match: { acknowledged: true } - - - do: - indices.get_template: - name: "my_template" - - is_false: my_template.version - - # Coming back with a version - - do: - indices.put_template: - name: "my_template" - body: > - { - "version": 5385, - "index_patterns": "*", - "settings": { "number_of_shards": 1 } - } - - match: { acknowledged: true } - - - do: - indices.get_template: - name: "my_template" - - match: { my_template.version: 5385 } - - # Able to delete the versioned template - - do: - indices.delete_template: - name: "my_template" - - match: { acknowledged: true } - - - do: - catch: missing - indices.get_template: - name: "my_template" - ---- -"Put index template without index_patterns": - - - do: - catch: /index patterns are missing/ - indices.put_template: - name: test - body: {} - ---- -"Put template with explicit _doc type": - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0 - - - do: - catch: bad_request - indices.put_template: - name: test - body: - index_patterns: test-* - mappings: - _doc: - properties: - field: - type: keyword - - - match: { error.type: "illegal_argument_exception" } - - match: { error.reason: "The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true." } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/11_basic_with_types.yml deleted file mode 100644 index fde28db3c691d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.put_template/11_basic_with_types.yml +++ /dev/null @@ -1,74 +0,0 @@ ---- -"Put template": - - do: - indices.put_template: - include_type_name: true - name: test - body: - index_patterns: test-* - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - _doc: - properties: - field: - type: keyword - - - do: - indices.get_template: - include_type_name: true - name: test - flat_settings: true - - - match: {test.index_patterns: ["test-*"]} - - match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} - - match: {test.mappings: {_doc: {properties: {field: {type: keyword}}}}} - ---- -"Put multiple template": - - do: - indices.put_template: - include_type_name: true - name: test - body: - index_patterns: [test-*, test2-*] - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - _doc: - properties: - field: - type: text - - - do: - indices.get_template: - include_type_name: true - name: test - flat_settings: true - - - match: {test.index_patterns: ["test-*", "test2-*"]} - - match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} - - match: {test.mappings: {_doc: {properties: {field: {type: text}}}}} - ---- -"Put template with empty mappings": - - do: - indices.put_template: - include_type_name: true - name: test - body: - index_patterns: test-* - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: {} - - - do: - indices.get_template: - include_type_name: true - name: test - flat_settings: true - - - match: {test.mappings: {}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.recovery/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.recovery/10_basic.yml deleted file mode 100644 index 4806601cec263..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.recovery/10_basic.yml +++ /dev/null @@ -1,157 +0,0 @@ ---- -"Indices recovery test": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - indices.recovery: - index: [test_1] - human: true - - - match: { test_1.shards.0.type: "EMPTY_STORE" } - - match: { test_1.shards.0.stage: "DONE" } - - match: { test_1.shards.0.primary: true } - - match: { test_1.shards.0.start_time: /^2\d\d\d-.+/ } - - match: { test_1.shards.0.target.ip: /^\d+\.\d+\.\d+\.\d+$/ } - - gte: { test_1.shards.0.index.files.total: 0 } - - gte: { test_1.shards.0.index.files.reused: 0 } - - gte: { test_1.shards.0.index.files.recovered: 0 } - - match: { test_1.shards.0.index.files.percent: /^\d+\.\d\%$/ } - - gte: { test_1.shards.0.index.size.total_in_bytes: 0 } - - gte: { test_1.shards.0.index.size.reused_in_bytes: 0 } - - gte: { test_1.shards.0.index.size.recovered_in_bytes: 0 } - - match: { test_1.shards.0.index.size.percent: /^\d+\.\d\%$/ } - - gte: { test_1.shards.0.index.source_throttle_time_in_millis: 0 } - - gte: { test_1.shards.0.index.target_throttle_time_in_millis: 0 } - - gte: { test_1.shards.0.translog.recovered: 0 } - - gte: { test_1.shards.0.translog.total: -1 } - - gte: { test_1.shards.0.translog.total_on_start: 0 } - - gte: { test_1.shards.0.translog.total_time_in_millis: 0 } - - gte: { test_1.shards.0.verify_index.check_index_time_in_millis: 0 } - - gte: { test_1.shards.0.verify_index.total_time_in_millis: 0 } ---- -"Indices recovery test for closed index": - - skip: - version: " - 7.1.99" - reason: closed indices are replicated starting version 7.2.0 - - - do: - indices.create: - index: test_2 - body: - settings: - index: - number_of_replicas: 0 - - - do: - indices.close: - index: test_2 - - is_true: acknowledged - - - do: - cluster.health: - index: test_2 - wait_for_status: green - - - do: - indices.recovery: - index: [test_2] - human: true - - - match: { test_2.shards.0.type: "EXISTING_STORE" } - - match: { test_2.shards.0.stage: "DONE" } - - match: { test_2.shards.0.primary: true } - - match: { test_2.shards.0.start_time: /^2\d\d\d-.+/ } - - match: { test_2.shards.0.target.ip: /^\d+\.\d+\.\d+\.\d+$/ } - - gte: { test_2.shards.0.index.files.total: 0 } - - gte: { test_2.shards.0.index.files.reused: 0 } - - gte: { test_2.shards.0.index.files.recovered: 0 } - - match: { test_2.shards.0.index.files.percent: /^\d+\.\d\%$/ } - - gte: { test_2.shards.0.index.size.total_in_bytes: 0 } - - gte: { test_2.shards.0.index.size.reused_in_bytes: 0 } - - gte: { test_2.shards.0.index.size.recovered_in_bytes: 0 } - - match: { test_2.shards.0.index.size.percent: /^\d+\.\d\%$/ } - - gte: { test_2.shards.0.index.source_throttle_time_in_millis: 0 } - - gte: { test_2.shards.0.index.target_throttle_time_in_millis: 0 } - - gte: { test_2.shards.0.translog.recovered: 0 } - - gte: { test_2.shards.0.translog.total: 0 } - - gte: { test_2.shards.0.translog.total_on_start: 0 } - - gte: { test_2.shards.0.translog.total_time_in_millis: 0 } - - gte: { test_2.shards.0.verify_index.check_index_time_in_millis: 0 } - - gte: { test_2.shards.0.verify_index.total_time_in_millis: 0 } ---- -"Indices recovery test index name not matching": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - - catch: missing - indices.recovery: - index: [foobar] - ---- -"Indices recovery test, wildcard not matching any index": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - indices.recovery: - index: [v*] - - - match: { $body: {} } ---- -"Indices recovery test with detailed parameter": - - skip: - version: " - 7.2.99" - reason: bug with detailed parameter fixed in 7.3 - - - do: - indices.create: - index: test_3 - body: - settings: - index: - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - indices.recovery: - index: [test_3] - human: true - detailed: true - - - match: { test_3.shards.0.index.files.details: [] } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.refresh/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.refresh/10_basic.yml deleted file mode 100644 index 6e493a0cce936..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.refresh/10_basic.yml +++ /dev/null @@ -1,58 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_replicas: 0 - number_of_shards: 5 - - - do: - indices.create: - index: test_2 - body: - settings: - index: - number_of_replicas: 0 - number_of_shards: 5 - - - do: - cluster.health: - wait_for_status: green - ---- -"Indices refresh test _all": - - - do: - indices.refresh: - index: [_all] - - - match: { _shards.total: 10 } - - match: { _shards.successful: 10 } - - match: { _shards.failed: 0 } - ---- -"Indices refresh test empty array": - - - - do: - indices.refresh: - index: [] - - - match: { _shards.total: 10 } - - match: { _shards.successful: 10 } - - match: { _shards.failed: 0 } - ---- -"Indices refresh test no-match wildcard": - - - do: - indices.refresh: - index: [bla*] - - - match: { _shards.total: 0 } - - match: { _shards.successful: 0 } - - match: { _shards.failed: 0 } - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/10_basic.yml deleted file mode 100644 index 342adced0640d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/10_basic.yml +++ /dev/null @@ -1,155 +0,0 @@ ---- -"Rollover index via API": - - - # create index with alias - - do: - indices.create: - index: logs-1 - wait_for_active_shards: 1 - body: - aliases: - logs_index: {} - logs_search: {} - - # index document - - do: - index: - index: logs-1 - type: test - id: "1" - body: { "foo": "hello world" } - # make this doc visible in index stats - refresh: true - - - do: - get: - index: logs_search - type: test - id: "1" - - - match: { _index: logs-1 } - - match: { _type: test } - - match: { _id: "1" } - - match: { _source: { foo: "hello world" } } - - # perform alias rollover - - do: - indices.rollover: - alias: "logs_search" - wait_for_active_shards: 1 - body: - conditions: - max_docs: 1 - - - match: { old_index: logs-1 } - - match: { new_index: logs-000002 } - - match: { rolled_over: true } - - match: { dry_run: false } - - match: { conditions: { "[max_docs: 1]": true } } - - # ensure new index is created - - do: - indices.exists: - index: logs-000002 - - - is_true: '' - - # index into new index - - do: - index: - index: logs-000002 - type: test - id: "2" - body: { "foo": "hello world" } - - - do: - indices.refresh: {} - - # check alias points to the new index - - do: - search: - rest_total_hits_as_int: true - index: logs_search - - - match: { hits.total: 1 } - - match: { hits.hits.0._index: "logs-000002"} - ---- -"Rollover no condition matched": - # create index with alias - - do: - indices.create: - index: logs-1 - wait_for_active_shards: 1 - body: - aliases: - logs_index: {} - logs_search: {} - - # run again and verify results without rolling over - - do: - indices.rollover: - alias: "logs_search" - wait_for_active_shards: 1 - body: - conditions: - max_docs: 1 - - - match: { old_index: logs-1 } - - match: { new_index: logs-000002 } - - match: { rolled_over: false } - - match: { dry_run: false } - - match: { conditions: { "[max_docs: 1]": false } } - ---- -"Rollover with dry-run but target index exists": - - # create index with alias - - do: - indices.create: - index: logs-1 - wait_for_active_shards: 1 - body: - aliases: - logs_index: {} - logs_search: {} - - - do: - indices.create: - index: logs-000002 - - - do: - # index_already_exists_exception was renamed to resource_arleady_exists_exception in 6.0 - catch: /(index|resource)_already_exists_exception/ - indices.rollover: - dry_run: true - alias: "logs_search" - wait_for_active_shards: 1 - body: - conditions: - max_docs: 1 - - # also do it without dry_run - - do: - # index_already_exists_exception was renamed to resource_arleady_exists_exception in 6.0 - catch: /(index|resource)_already_exists_exception/ - indices.rollover: - dry_run: false - alias: "logs_search" - wait_for_active_shards: 1 - body: - conditions: - max_docs: 1 - - - do: - catch: /invalid_index_name_exception/ - indices.rollover: - new_index: invalid|index|name - dry_run: true - alias: "logs_search" - wait_for_active_shards: 1 - body: - conditions: - max_docs: 1 - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml deleted file mode 100644 index ec9fabe02595d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml +++ /dev/null @@ -1,57 +0,0 @@ ---- -"Max docs rollover conditions matches only primary shards": - - skip: - version: "- 5.4.1" - reason: "matching docs changed from all shards to primary shards" - - # create index with alias and replica - - do: - indices.create: - index: logs-1 - wait_for_active_shards: 1 - body: - aliases: - logs_search: {} - - # index first document and wait for refresh - - do: - index: - index: logs-1 - type: test - id: "1" - body: { "foo": "hello world" } - refresh: true - - # perform alias rollover with no result - - do: - indices.rollover: - alias: "logs_search" - wait_for_active_shards: 1 - body: - conditions: - max_docs: 2 - - - match: { conditions: { "[max_docs: 2]": false } } - - match: { rolled_over: false } - - # index second document and wait for refresh - - do: - index: - index: logs-1 - type: test - id: "2" - body: { "foo": "hello world" } - refresh: true - - # perform alias rollover - - do: - indices.rollover: - alias: "logs_search" - wait_for_active_shards: 1 - body: - conditions: - max_docs: 2 - - - match: { conditions: { "[max_docs: 2]": true } } - - match: { rolled_over: true } - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/30_max_size_condition.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/30_max_size_condition.yml deleted file mode 100644 index 6e4df0f292915..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/30_max_size_condition.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -"Rollover with max_size condition": - - - skip: - version: " - 6.0.99" - reason: max_size condition is introduced in 6.1.0 - - # create index with alias and replica - - do: - indices.create: - index: logs-1 - wait_for_active_shards: 1 - body: - aliases: - logs_search: {} - - # index a document - - do: - index: - index: logs-1 - type: doc - id: "1" - body: { "foo": "hello world" } - refresh: true - - # perform alias rollover with a large max_size, no action. - - do: - indices.rollover: - alias: "logs_search" - wait_for_active_shards: 1 - body: - conditions: - max_size: 100mb - - - match: { conditions: { "[max_size: 100mb]": false } } - - match: { rolled_over: false } - - # perform alias rollover with a small max_size, got action. - - do: - indices.rollover: - alias: "logs_search" - wait_for_active_shards: 1 - body: - conditions: - max_size: 10b - - - match: { conditions: { "[max_size: 10b]": true } } - - match: { rolled_over: true } - - # perform alias rollover on an empty index, no action. - - do: - indices.rollover: - alias: "logs_search" - wait_for_active_shards: 1 - body: - conditions: - max_size: 1b - - - match: { conditions: { "[max_size: 1b]": false } } - - match: { rolled_over: false } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/40_mapping.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/40_mapping.yml deleted file mode 100644 index 47b004326a457..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/40_mapping.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -"Typeless mapping": - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0.0 - - - do: - indices.create: - index: logs-1 - body: - aliases: - logs_search: {} - - # index first document and wait for refresh - - do: - index: - index: logs-1 - id: "1" - body: { "foo": "hello world" } - refresh: true - - # index second document and wait for refresh - - do: - index: - index: logs-1 - id: "2" - body: { "foo": "hello world" } - refresh: true - - # perform alias rollover with new typeless mapping - - do: - indices.rollover: - alias: "logs_search" - body: - conditions: - max_docs: 2 - mappings: - properties: - foo2: - type: keyword - - - match: { conditions: { "[max_docs: 2]": true } } - - match: { rolled_over: true } - ---- -"Mappings with explicit _doc type": - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0 - - - do: - indices.create: - index: logs-1 - body: - aliases: - logs_search: {} - - - do: - catch: bad_request - indices.rollover: - alias: "logs_search" - body: - conditions: - max_docs: 2 - mappings: - _doc: - properties: - field: - type: keyword - - - match: { error.caused_by.type: "illegal_argument_exception" } - - match: { error.caused_by.reason: "The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true." } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/41_mapping_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/41_mapping_with_types.yml deleted file mode 100644 index 36389f3ce8bba..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.rollover/41_mapping_with_types.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -"Typeless mapping": - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0.0 - - - do: - indices.create: - index: logs-1 - body: - aliases: - logs_search: {} - - # index first document and wait for refresh - - do: - index: - index: logs-1 - type: test - id: "1" - body: { "foo": "hello world" } - refresh: true - - # index second document and wait for refresh - - do: - index: - index: logs-1 - type: test - id: "2" - body: { "foo": "hello world" } - refresh: true - - # perform alias rollover with new typeless mapping - - do: - indices.rollover: - include_type_name: true - alias: "logs_search" - body: - conditions: - max_docs: 2 - mappings: - _doc: - properties: - foo2: - type: keyword - - - match: { conditions: { "[max_docs: 2]": true } } - - match: { rolled_over: true } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.segments/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.segments/10_basic.yml deleted file mode 100644 index 37602774474a1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.segments/10_basic.yml +++ /dev/null @@ -1,74 +0,0 @@ ---- -"no segments test": - - do: - indices.segments: - allow_no_indices: true - - - match: { _shards.total: 0} - - match: { indices: {}} - - - do: - catch: missing - indices.segments: - allow_no_indices: false - ---- -"basic segments test": - - - do: - indices.create: - index: index1 - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - do: - index: - index: index1 - type: type - body: { foo: bar } - refresh: true - - - do: - cluster.health: - wait_for_status: green - - - do: - indices.segments: - index: index1 - - - match: { _shards.total: 1} - - match: { indices.index1.shards.0.0.routing.primary: true} - - match: { indices.index1.shards.0.0.segments._0.num_docs: 1} - ---- -"closed segments test": - - do: - indices.create: - index: index1 - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - do: - index: - index: index1 - type: type - body: { foo: bar } - refresh: true - - - do: - indices.close: - index: index1 - - - do: - catch: bad_request - indices.segments: - index: index1 - - - do: - indices.segments: - index: index1 - ignore_unavailable: true - - - match: { _shards.total: 0} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shard_stores/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shard_stores/10_basic.yml deleted file mode 100644 index db90bf29624a1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shard_stores/10_basic.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -"no indices test": - - do: - indices.shard_stores: - allow_no_indices: true - - - match: { indices: {}} - - - do: - catch: missing - indices.shard_stores: - allow_no_indices: false - ---- -"basic index test": - - - do: - indices.create: - index: index1 - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - do: - index: - index: index1 - type: type - body: { foo: bar } - refresh: true - - - do: - cluster.health: - wait_for_status: green - - - do: - indices.shard_stores: - index: index1 - status: "green" - - - match: { indices.index1.shards.0.stores.0.allocation: "primary" } - ---- -"multiple indices test": - - - do: - indices.create: - index: index1 - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - do: - indices.create: - index: index2 - body: - settings: - number_of_shards: "2" - number_of_replicas: "0" - - do: - index: - index: index1 - type: type - body: { foo: bar } - refresh: true - - do: - index: - index: index2 - type: type - body: { foo: bar } - refresh: true - - do: - cluster.health: - wait_for_status: green - - - do: - indices.shard_stores: - status: "green" - - - match: { indices.index1.shards.0.stores.0.allocation: "primary" } - - match: { indices.index2.shards.0.stores.0.allocation: "primary" } - - match: { indices.index2.shards.1.stores.0.allocation: "primary" } - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/10_basic.yml deleted file mode 100644 index 41c851b71cc6c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/10_basic.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -"Shrink index via API": - - skip: - version: " - 6.9.99" - reason: expects warnings that pre-7.0.0 will not send - features: [warnings, arbitrary_key] - - # creates an index with one document solely allocated on a particular data node - # and shrinks it into a new index with a single shard - # we don't do the relocation to a single node after the index is created - # here since in a mixed version cluster we can't identify - # which node is the one with the highest version and that is the only one that can safely - # be used to shrink the index. - - - do: - nodes.info: - node_id: data:true - - set: - nodes._arbitrary_key_: node_id - - - do: - indices.create: - index: source - wait_for_active_shards: 1 - body: - settings: - # ensure everything is allocated on the same data node - index.routing.allocation.include._id: $node_id - index.number_of_shards: 2 - index.number_of_replicas: 0 - - do: - index: - index: source - id: "1" - body: { "foo": "hello world" } - - - do: - get: - index: source - id: "1" - - - match: { _index: source } - - match: { _type: _doc } - - match: { _id: "1" } - - match: { _source: { foo: "hello world" } } - - # make it read-only - - do: - indices.put_settings: - index: source - body: - index.blocks.write: true - index.number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - index: source - - # now we do the actual shrink - - do: - indices.shrink: - index: "source" - target: "target" - wait_for_active_shards: 1 - master_timeout: 10s - body: - settings: - index.number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - get: - index: target - id: "1" - - - match: { _index: target } - - match: { _type: _doc } - - match: { _id: "1" } - - match: { _source: { foo: "hello world" } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml deleted file mode 100644 index dec0760fc6b19..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml +++ /dev/null @@ -1,74 +0,0 @@ ---- -"Shrink index ignores target template mapping": - - skip: - version: " - 6.9.99" - reason: expects warnings that pre-7.0.0 will not send - features: [warnings, arbitrary_key] - - - do: - nodes.info: - node_id: data:true - - set: - nodes._arbitrary_key_: node_id - - # create index - - do: - indices.create: - index: source - wait_for_active_shards: 1 - body: - settings: - # ensure everything is allocated on a single node - index.routing.allocation.include._id: $node_id - index.number_of_shards: 2 - index.number_of_replicas: 0 - mappings: - properties: - count: - type: text - - # index document - - do: - index: - index: source - id: "1" - body: { "count": "1" } - - # create template matching shrink target - - do: - indices.put_template: - name: tpl1 - body: - index_patterns: targ* - mappings: - properties: - count: - type: integer - - # make it read-only - - do: - indices.put_settings: - index: source - body: - index.blocks.write: true - index.number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - index: source - - # now we do the actual shrink - - do: - indices.shrink: - index: "source" - target: "target" - wait_for_active_shards: 1 - master_timeout: 10s - body: - settings: - index.number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml deleted file mode 100644 index 7fc73ef8fd017..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml +++ /dev/null @@ -1,105 +0,0 @@ ---- -"Copy settings during shrink index": - - skip: - version: " - 6.9.99" - reason: expects warnings that pre-7.0.0 will not send - features: [warnings, arbitrary_key] - - - do: - nodes.info: - node_id: data:true - - set: - nodes._arbitrary_key_: node_id - - - do: - indices.create: - index: source - wait_for_active_shards: 1 - body: - settings: - # ensure everything is allocated on the same node - index.routing.allocation.include._id: $node_id - index.number_of_shards: 2 - index.number_of_replicas: 0 - index.merge.scheduler.max_merge_count: 4 - - # make it read-only - - do: - indices.put_settings: - index: source - body: - index.blocks.write: true - index.number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - index: source - - # now we do a actual shrink and copy settings - - do: - indices.shrink: - index: "source" - target: "copy-settings-target" - wait_for_active_shards: 1 - master_timeout: 10s - copy_settings: true - body: - settings: - index.number_of_replicas: 0 - index.merge.scheduler.max_thread_count: 2 - warnings: - - "parameter [copy_settings] is deprecated and will be removed in 8.0.0" - - - do: - cluster.health: - wait_for_status: green - - - do: - indices.get_settings: - index: "copy-settings-target" - - # settings should be copied - - match: { copy-settings-target.settings.index.merge.scheduler.max_merge_count: "4" } - - match: { copy-settings-target.settings.index.merge.scheduler.max_thread_count: "2" } - - match: { copy-settings-target.settings.index.blocks.write: "true" } - - match: { copy-settings-target.settings.index.routing.allocation.include._id: $node_id } - - # now we do a actual shrink and copy settings (by default) - - do: - indices.shrink: - index: "source" - target: "default-copy-settings-target" - wait_for_active_shards: 1 - master_timeout: 10s - body: - settings: - index.number_of_replicas: 0 - index.merge.scheduler.max_thread_count: 2 - - - do: - cluster.health: - wait_for_status: green - - - do: - indices.get_settings: - index: "default-copy-settings-target" - - # settings should be copied - - match: { default-copy-settings-target.settings.index.merge.scheduler.max_merge_count: "4" } - - match: { default-copy-settings-target.settings.index.merge.scheduler.max_thread_count: "2" } - - match: { default-copy-settings-target.settings.index.blocks.write: "true" } - - match: { default-copy-settings-target.settings.index.routing.allocation.include._id: $node_id } - - # now we do a actual shrink and try to set no copy settings - - do: - catch: /illegal_argument_exception/ - indices.shrink: - index: "source" - target: "explicit-no-copy-settings-target" - wait_for_active_shards: 1 - master_timeout: 10s - copy_settings: false - body: - settings: - index.number_of_replicas: 0 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.sort/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.sort/10_basic.yml deleted file mode 100644 index b9089689b0cf1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.sort/10_basic.yml +++ /dev/null @@ -1,158 +0,0 @@ ---- -"Index Sort": - - - do: - indices.create: - index: test - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - index.sort.field: rank - mappings: - properties: - rank: - type: integer - - - do: - index: - index: test - id: "1" - body: { "rank": 4 } - - - do: - index: - index: test - id: "2" - body: { "rank": 1 } - - - do: - index: - index: test - id: "3" - body: { "rank": 3 } - - - do: - index: - index: test - id: "4" - body: { "rank": 2 } - - - do: - indices.refresh: - index: test - - - do: - index: - index: test - id: "5" - body: { "rank": 8 } - - - do: - index: - index: test - id: "6" - body: { "rank": 6 } - - - do: - index: - index: test - id: "7" - body: { "rank": 5 } - - - do: - index: - index: test - id: "8" - body: { "rank": 7 } - - - do: - index: - index: test - id: "8" - body: { "rank": 7 } - - - do: - indices.refresh: - index: test - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - sort: ["rank"] - size: 1 - - - match: {hits.total: 8 } - - length: {hits.hits: 1 } - - match: {hits.hits.0._id: "2" } - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - sort: ["rank"] - query: {"range": { "rank": { "from": 0 } } } - track_total_hits: false - size: 1 - - - match: {hits.total: -1 } - - length: {hits.hits: 1 } - - match: {hits.hits.0._id: "2" } - - - do: - indices.forcemerge: - index: test - max_num_segments: 1 - - - do: - indices.refresh: - index: test - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - sort: _doc - - - match: {hits.total: 8 } - - length: {hits.hits: 8 } - - match: {hits.hits.0._id: "2" } - - match: {hits.hits.1._id: "4" } - - match: {hits.hits.2._id: "3" } - - match: {hits.hits.3._id: "1" } - - match: {hits.hits.4._id: "7" } - - match: {hits.hits.5._id: "6" } - - match: {hits.hits.6._id: "8" } - - match: {hits.hits.7._id: "5" } - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - sort: ["rank"] - query: {"range": { "rank": { "from": 0 } } } - track_total_hits: false - size: 3 - - - match: {hits.total: -1 } - - length: {hits.hits: 3 } - - match: {hits.hits.0._id: "2" } - - match: {hits.hits.1._id: "4" } - - match: {hits.hits.2._id: "3" } - - - do: - catch: /disabling \[track_total_hits\] is not allowed in a scroll context/ - search: - rest_total_hits_as_int: true - index: test - scroll: 1m - body: - sort: ["rank"] - query: {"range": { "rank": { "from": 0 } } } - track_total_hits: false - size: 3 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/10_basic.yml deleted file mode 100644 index 2baa82ea78842..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/10_basic.yml +++ /dev/null @@ -1,223 +0,0 @@ ---- -setup: - - do: - indices.create: - index: source - wait_for_active_shards: 1 - body: - settings: - index.number_of_shards: 2 - index.number_of_replicas: 0 - index.number_of_routing_shards: 4 - - do: - index: - index: source - id: "1" - body: { "foo": "hello world" } - - - do: - index: - index: source - id: "2" - body: { "foo": "hello world 2" } - - - do: - index: - index: source - id: "3" - body: { "foo": "hello world 3" } - ---- -"Split index via API": - - skip: - version: " - 6.9.99" - reason: pre-7.0.0 will send warnings - features: "warnings" - - # make it read-only - - do: - indices.put_settings: - index: source - body: - index.blocks.write: true - index.number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - index: source - - # now we do the actual split - - do: - indices.split: - index: "source" - target: "target" - wait_for_active_shards: 1 - master_timeout: 10s - body: - settings: - index.number_of_replicas: 0 - index.number_of_shards: 4 - - - do: - cluster.health: - wait_for_status: green - - - do: - get: - index: target - id: "1" - - - match: { _index: target } - - match: { _type: _doc } - - match: { _id: "1" } - - match: { _source: { foo: "hello world" } } - - - - do: - get: - index: target - id: "2" - - - match: { _index: target } - - match: { _type: _doc } - - match: { _id: "2" } - - match: { _source: { foo: "hello world 2" } } - - - - do: - get: - index: target - id: "3" - - - match: { _index: target } - - match: { _type: _doc } - - match: { _id: "3" } - - match: { _source: { foo: "hello world 3" } } - - ---- -"Split from 1 to N": - - skip: - version: " - 6.99.99" - reason: automatic preparation for splitting was added in 7.0.0 - - do: - indices.create: - index: source_one_shard - wait_for_active_shards: 1 - body: - settings: - index.number_of_shards: 1 - index.number_of_replicas: 0 - - do: - index: - index: source_one_shard - id: "1" - body: { "foo": "hello world" } - - - do: - index: - index: source_one_shard - id: "2" - body: { "foo": "hello world 2" } - - - do: - index: - index: source_one_shard - id: "3" - body: { "foo": "hello world 3" } - - # make it read-only - - do: - indices.put_settings: - index: source_one_shard - body: - index.blocks.write: true - index.number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - index: source_one_shard - - # now we do the actual split from 1 to 5 - - do: - indices.split: - index: "source_one_shard" - target: "target" - wait_for_active_shards: 1 - master_timeout: 10s - body: - settings: - index.number_of_replicas: 0 - index.number_of_shards: 5 - - - do: - cluster.health: - wait_for_status: green - - - do: - get: - index: target - id: "1" - - - match: { _index: target } - - match: { _type: _doc } - - match: { _id: "1" } - - match: { _source: { foo: "hello world" } } - - - - do: - get: - index: target - id: "2" - - - match: { _index: target } - - match: { _type: _doc } - - match: { _id: "2" } - - match: { _source: { foo: "hello world 2" } } - - - - do: - get: - index: target - id: "3" - - - match: { _index: target } - - match: { _type: _doc } - - match: { _id: "3" } - - match: { _source: { foo: "hello world 3" } } - ---- -"Create illegal split indices": - - skip: - version: " - 6.9.99" - reason: pre-7.0.0 will send warnings - features: "warnings" - - # try to do an illegal split with number_of_routing_shards set - - do: - catch: /illegal_argument_exception/ - indices.split: - index: "source" - target: "target" - wait_for_active_shards: 1 - master_timeout: 10s - body: - settings: - index.number_of_replicas: 0 - index.number_of_shards: 4 - index.number_of_routing_shards: 8 - - # try to do an illegal split with illegal number_of_shards - - do: - catch: /illegal_state_exception/ - indices.split: - index: "source" - target: "target" - wait_for_active_shards: 1 - master_timeout: 10s - body: - settings: - index.number_of_replicas: 0 - index.number_of_shards: 6 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/20_source_mapping.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/20_source_mapping.yml deleted file mode 100644 index 3740167a0253a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/20_source_mapping.yml +++ /dev/null @@ -1,68 +0,0 @@ ---- -"Split index ignores target template mapping": - - skip: - version: " - 6.9.99" - reason: pre-7.0.0 will send warnings - features: "warnings" - - # create index - - do: - indices.create: - index: source - wait_for_active_shards: 1 - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - index.number_of_routing_shards: 2 - mappings: - properties: - count: - type: text - - # index document - - do: - index: - index: source - id: "1" - body: { "count": "1" } - - # create template matching shrink target - - do: - indices.put_template: - name: tpl1 - body: - index_patterns: targ* - mappings: - properties: - count: - type: integer - - # make it read-only - - do: - indices.put_settings: - index: source - body: - index.blocks.write: true - index.number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - index: source - - # now we do the actual split - - do: - indices.split: - index: "source" - target: "target" - wait_for_active_shards: 1 - master_timeout: 10s - body: - settings: - index.number_of_shards: 2 - index.number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/30_copy_settings.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/30_copy_settings.yml deleted file mode 100644 index 5893ccbc84ede..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.split/30_copy_settings.yml +++ /dev/null @@ -1,108 +0,0 @@ ---- -"Copy settings during split index": - - skip: - version: " - 6.9.99" - reason: expects warnings that pre-7.0.0 will not send - features: [arbitrary_key, warnings] - - - do: - nodes.info: - node_id: data:true - - set: - nodes._arbitrary_key_: node_id - - - do: - indices.create: - index: source - wait_for_active_shards: 1 - body: - settings: - # ensure everything is allocated on the same node - index.routing.allocation.include._id: $node_id - index.number_of_replicas: 0 - index.number_of_shards: 1 - index.number_of_routing_shards: 4 - index.merge.scheduler.max_merge_count: 4 - - # make it read-only - - do: - indices.put_settings: - index: source - body: - index.blocks.write: true - index.number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - index: source - - # now we do a actual split and copy settings - - do: - indices.split: - index: "source" - target: "copy-settings-target" - wait_for_active_shards: 1 - master_timeout: 10s - copy_settings: true - body: - settings: - index.number_of_replicas: 0 - index.number_of_shards: 2 - index.merge.scheduler.max_thread_count: 2 - warnings: - - "parameter [copy_settings] is deprecated and will be removed in 8.0.0" - - - - do: - cluster.health: - wait_for_status: green - - - do: - indices.get_settings: - index: "copy-settings-target" - - # settings should be copied - - match: { copy-settings-target.settings.index.merge.scheduler.max_merge_count: "4" } - - match: { copy-settings-target.settings.index.merge.scheduler.max_thread_count: "2" } - - match: { copy-settings-target.settings.index.blocks.write: "true" } - - match: { copy-settings-target.settings.index.routing.allocation.include._id: $node_id } - - # now we do a actual shrink and copy settings (by default) - - do: - indices.split: - index: "source" - target: "default-copy-settings-target" - wait_for_active_shards: 1 - master_timeout: 10s - body: - settings: - index.number_of_replicas: 0 - index.number_of_shards: 2 - index.merge.scheduler.max_thread_count: 2 - - - do: - cluster.health: - wait_for_status: green - - - do: - indices.get_settings: - index: "default-copy-settings-target" - - # settings should be copied - - match: { default-copy-settings-target.settings.index.merge.scheduler.max_merge_count: "4" } - - match: { default-copy-settings-target.settings.index.merge.scheduler.max_thread_count: "2" } - - match: { default-copy-settings-target.settings.index.blocks.write: "true" } - - match: { default-copy-settings-target.settings.index.routing.allocation.include._id: $node_id } - - - do: - catch: /illegal_argument_exception/ - indices.split: - index: "source" - target: "explicit-no-copy-settings-target" - wait_for_active_shards: 1 - master_timeout: 10s - copy_settings: false - body: - settings: - index.number_of_replicas: 0 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/10_index.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/10_index.yml deleted file mode 100644 index 1a650ee88eae6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/10_index.yml +++ /dev/null @@ -1,116 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test1 - body: - settings: - number_of_shards: 5 - number_of_replicas: 1 - - - do: - indices.create: - index: test2 - body: - settings: - number_of_shards: 4 - number_of_replicas: 1 - - do: - index: - index: test1 - id: 1 - body: { "foo": "bar" } - - - do: - index: - index: test2 - id: 1 - body: { "foo": "baz" } - ---- -"Index - blank": - - do: - indices.stats: {} - - - match: { _shards.total: 18 } - - is_true: _all - - is_true: indices.test1 - - is_true: indices.test2 - ---- -"Index - all": - - skip: - version: " - 6.3.99" - reason: "uuid is only available from 6.4.0 on" - - - do: - indices.stats: { index: _all } - - - match: { _shards.total: 18 } - - is_true: _all - - is_true: indices.test1 - - is_true: indices.test1.uuid - - is_true: indices.test2 - - is_true: indices.test2.uuid - - ---- -"Index - star": - - do: - indices.stats: { index: '*' } - - - match: { _shards.total: 18 } - - is_true: _all - - is_true: indices.test1 - - is_true: indices.test2 - ---- -"Index - star, no match": - - do: - indices.stats: { index: 'bla*' } - - - match: { _shards.total: 0 } - - is_true: _all - - is_false: indices.test1 - - is_false: indices.test2 - ---- -"Index - one index": - - do: - indices.stats: { index: 'test1' } - - - match: { _shards.total: 10 } - - is_true: _all - - is_true: indices.test1 - - is_false: indices.test2 - ---- -"Index - multi-index": - - do: - indices.stats: { index: [test1, test2] } - - - match: { _shards.total: 18 } - - is_true: _all - - is_true: indices.test1 - - is_true: indices.test2 - ---- -"Index - pattern": - - do: - indices.stats: { index: '*2' } - - - match: { _shards.total: 8 } - - is_true: _all - - is_false: indices.test1 - - is_true: indices.test2 - ---- -"Indices stats unrecognized parameter": - - do: - catch: bad_request - indices.stats: - metric: [ fieldata ] - - - match: { status: 400 } - - match: { error.type: illegal_argument_exception } - - match: { error.reason: "request [/_stats/fieldata] contains unrecognized metric: [fieldata] -> did you mean [fielddata]?" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/11_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/11_metric.yml deleted file mode 100644 index 79790935beef2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/11_metric.yml +++ /dev/null @@ -1,164 +0,0 @@ ---- -setup: - - - do: - index: - index: test1 - id: 1 - body: { "foo": "bar" } - - - do: - index: - index: test2 - id: 1 - body: { "foo": "baz" } - ---- -"Metric - blank": - - do: - indices.stats: {} - - - is_true: _all.total.docs - - is_true: _all.total.store - - is_true: _all.total.indexing - - is_true: _all.total.get - - is_true: _all.total.search - - is_true: _all.total.merges - - is_true: _all.total.refresh - - is_true: _all.total.flush - - is_true: _all.total.warmer - - is_true: _all.total.query_cache - - is_true: _all.total.fielddata - - is_true: _all.total.completion - - is_true: _all.total.segments - - is_true: _all.total.translog - - is_true: _all.total.recovery - ---- -"Metric - _all": - - do: - indices.stats: { metric: _all } - - - is_true: _all.total.docs - - is_true: _all.total.store - - is_true: _all.total.indexing - - is_true: _all.total.get - - is_true: _all.total.search - - is_true: _all.total.merges - - is_true: _all.total.refresh - - is_true: _all.total.flush - - is_true: _all.total.warmer - - is_true: _all.total.query_cache - - is_true: _all.total.fielddata - - is_true: _all.total.completion - - is_true: _all.total.segments - - is_true: _all.total.translog - - is_true: _all.total.recovery - ---- -"Metric - one": - - do: - indices.stats: { metric: docs } - - - is_true: _all.total.docs - - is_false: _all.total.store - - is_false: _all.total.indexing - - is_false: _all.total.get - - is_false: _all.total.search - - is_false: _all.total.merges - - is_false: _all.total.refresh - - is_false: _all.total.flush - - is_false: _all.total.warmer - - is_false: _all.total.query_cache - - is_false: _all.total.fielddata - - is_false: _all.total.completion - - is_false: _all.total.segments - - is_false: _all.total.translog - - is_false: _all.total.recovery - ---- -"Metric - multi": - - do: - indices.stats: { metric: [ store, get, merge ] } - - - is_false: _all.total.docs - - is_true: _all.total.store - - is_false: _all.total.indexing - - is_true: _all.total.get - - is_false: _all.total.search - - is_true: _all.total.merges - - is_false: _all.total.refresh - - is_false: _all.total.flush - - is_false: _all.total.warmer - - is_false: _all.total.query_cache - - is_false: _all.total.fielddata - - is_false: _all.total.completion - - is_false: _all.total.segments - - is_false: _all.total.translog - - is_false: _all.total.recovery - - ---- -"Metric - recovery": - - do: - indices.stats: { metric: [ recovery ] } - - - is_false: _all.total.docs - - is_false: _all.total.store - - is_false: _all.total.indexing - - is_false: _all.total.get - - is_false: _all.total.search - - is_false: _all.total.merges - - is_false: _all.total.refresh - - is_false: _all.total.flush - - is_false: _all.total.warmer - - is_false: _all.total.query_cache - - is_false: _all.total.fielddata - - is_false: _all.total.completion - - is_false: _all.total.segments - - is_false: _all.total.translog - - is_true: _all.total.recovery - ---- -"Metric - _all include_segment_file_sizes": - - do: - indices.stats: { metric: _all, include_segment_file_sizes: true } - - - is_true: _all.total.docs - - is_true: _all.total.store - - is_true: _all.total.indexing - - is_true: _all.total.get - - is_true: _all.total.search - - is_true: _all.total.merges - - is_true: _all.total.refresh - - is_true: _all.total.flush - - is_true: _all.total.warmer - - is_true: _all.total.query_cache - - is_true: _all.total.fielddata - - is_true: _all.total.completion - - is_true: _all.total.segments - - is_true: _all.total.translog - - is_true: _all.total.recovery - - is_true: _all.total.segments.file_sizes - ---- -"Metric - segments include_segment_file_sizes": - - do: - indices.stats: { metric: segments, include_segment_file_sizes: true } - - - is_false: _all.total.docs - - is_false: _all.total.store - - is_false: _all.total.indexing - - is_false: _all.total.get - - is_false: _all.total.search - - is_false: _all.total.merges - - is_false: _all.total.refresh - - is_false: _all.total.flush - - is_false: _all.total.warmer - - is_false: _all.total.query_cache - - is_false: _all.total.fielddata - - is_false: _all.total.completion - - is_true: _all.total.segments - - is_false: _all.total.translog - - is_false: _all.total.recovery - - is_true: _all.total.segments.file_sizes diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/12_level.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/12_level.yml deleted file mode 100644 index e9bd219a3e0ab..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/12_level.yml +++ /dev/null @@ -1,68 +0,0 @@ ---- -setup: - - - do: - index: - index: test1 - id: 1 - body: { "foo": "bar" } - - - do: - index: - index: test2 - id: 1 - body: { "foo": "baz" } - ---- -"Level - blank": - - do: - indices.stats: {} - - - is_true: _all.total.docs - - is_true: _all.total.docs - - is_true: indices.test1.total.docs - - is_true: indices.test1.total.docs - - is_false: indices.test1.shards - - is_true: indices.test2.total.docs - - is_true: indices.test2.total.docs - - is_false: indices.test2.shards - ---- -"Level - indices": - - do: - indices.stats: { level: indices } - - - is_true: _all.total.docs - - is_true: _all.total.docs - - is_true: indices.test1.total.docs - - is_true: indices.test1.total.docs - - is_false: indices.test1.shards - - is_true: indices.test2.total.docs - - is_true: indices.test2.total.docs - - is_false: indices.test2.shards - ---- -"Level - cluster": - - do: - indices.stats: { level: cluster } - - - is_true: _all.total.docs - - is_true: _all.total.docs - - is_false: indices - - ---- -"Level - shards": - - do: - indices.stats: { level: shards } - - - is_true: _all.total.docs - - is_true: _all.total.docs - - is_true: indices.test1.total.docs - - is_true: indices.test1.total.docs - - is_true: indices.test1.shards - - is_true: indices.test2.total.docs - - is_true: indices.test2.total.docs - - is_true: indices.test2.shards - - is_true: indices.test1.shards.0.0.commit.id - - is_true: indices.test2.shards.0.0.commit.id diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/13_fields.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/13_fields.yml deleted file mode 100644 index 42a11e467ccb3..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/13_fields.yml +++ /dev/null @@ -1,328 +0,0 @@ ---- -setup: - - - do: - indices.create: - index: test1 - wait_for_active_shards: all - body: - settings: - # Limit the number of shards so that shards are unlikely - # to be relocated or being initialized between the test - # set up and the test execution - index.number_of_shards: 3 - index.number_of_replicas: 0 - mappings: - properties: - bar: - type: text - fielddata: true - fields: - completion: - type: completion - baz: - type: text - fielddata: true - fields: - completion: - type: completion - - - do: - cluster.health: - wait_for_no_relocating_shards: true - - - do: - index: - index: test1 - id: 1 - body: { "bar": "bar", "baz": "baz" } - - - do: - index: - index: test1 - id: 2 - body: { "bar": "foo", "baz": "foo" } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - index: test1 - body: - suggest: - result: - text: "b" - completion: - field: bar.completion - - - do: - search: - rest_total_hits_as_int: true - index: test1 - body: - suggest: - result: - text: "b" - completion: - field: baz.completion - - - do: - search: - rest_total_hits_as_int: true - body: - sort: [ "bar", "baz" ] - ---- -"Fields - blank": - - do: - indices.stats: {} - - - match: { _shards.failed: 0} - - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } - - is_false: _all.total.fielddata.fields - - gt: { _all.total.completion.size_in_bytes: 0 } - - is_false: _all.total.completion.fields - ---- -"Fields - one": - - do: - indices.stats: { fields: bar } - - - match: { _shards.failed: 0} - - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } - - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } - - is_false: _all.total.fielddata.fields.baz - - gt: { _all.total.completion.size_in_bytes: 0 } - - is_false: _all.total.completion.fields.bar - ---- -"Fields - multi": - - do: - indices.stats: { fields: "bar,baz.completion" } - - - match: { _shards.failed: 0} - - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } - - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } - - is_false: _all.total.fielddata.fields.baz - - gt: { _all.total.completion.size_in_bytes: 0 } - - is_false: _all.total.completion.fields.bar\.completion - - gt: { _all.total.completion.fields.baz\.completion.size_in_bytes: 0 } - ---- -"Fields - star": - - do: - indices.stats: { fields: "*" } - - - match: { _shards.failed: 0} - - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } - - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } - - gt: { _all.total.fielddata.fields.baz.memory_size_in_bytes: 0 } - - gt: { _all.total.completion.size_in_bytes: 0 } - - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } - - gt: { _all.total.completion.fields.baz\.completion.size_in_bytes: 0 } - ---- -"Fields - pattern": - - do: - indices.stats: { fields: "bar*" } - - - match: { _shards.failed: 0} - - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } - - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } - - is_false: _all.total.fielddata.fields.baz - - gt: { _all.total.completion.size_in_bytes: 0 } - - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } - - is_false: _all.total.completion.fields.baz\.completion - ---- -"Fields - _all metric": - - do: - indices.stats: { fields: "bar*", metric: _all } - - - match: { _shards.failed: 0} - - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } - - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } - - is_false: _all.total.fielddata.fields.baz - - gt: { _all.total.completion.size_in_bytes: 0 } - - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } - - is_false: _all.total.completion.fields.baz\.completion - ---- -"Fields - fielddata metric": - - do: - indices.stats: { fields: "bar*", metric: fielddata } - - - match: { _shards.failed: 0} - - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } - - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } - - is_false: _all.total.fielddata.fields.baz - - is_false: _all.total.completion - ---- -"Fields - completion metric": - - do: - indices.stats: { fields: "bar*", metric: completion } - - - match: { _shards.failed: 0} - - is_false: _all.total.fielddata - - gt: { _all.total.completion.size_in_bytes: 0 } - - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } - - is_false: _all.total.completion.fields.baz\.completion - ---- -"Fields - multi metric": - - do: - indices.stats: { fields: "bar*" , metric: [ completion, fielddata, search ]} - - - match: { _shards.failed: 0} - - gt: { _all.total.fielddata.memory_size_in_bytes: 0 } - - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } - - is_false: _all.total.fielddata.fields.baz - - gt: { _all.total.completion.size_in_bytes: 0 } - - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } - - is_false: _all.total.completion.fields.baz\.completion - ---- -"Fielddata fields - one": - - do: - indices.stats: { fielddata_fields: bar } - - - match: { _shards.failed: 0} - - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } - - is_false: _all.total.fielddata.fields.baz - - is_false: _all.total.completion.fields - ---- -"Fielddata fields - multi": - - do: - indices.stats: { fielddata_fields: "bar,baz,baz.completion" } - - - match: { _shards.failed: 0} - - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } - - gt: { _all.total.fielddata.fields.baz.memory_size_in_bytes: 0 } - - is_false: _all.total.completion.fields - ---- -"Fielddata fields - star": - - do: - indices.stats: { fielddata_fields: "*" } - - - match: { _shards.failed: 0} - - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } - - gt: { _all.total.fielddata.fields.baz.memory_size_in_bytes: 0 } - - is_false: _all.total.completion.fields - ---- -"Fielddata fields - pattern": - - do: - indices.stats: { fielddata_fields: "*r" } - - - match: { _shards.failed: 0} - - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } - - is_false: _all.total.fielddata.fields.baz - - is_false: _all.total.completion.fields - - ---- -"Fielddata fields - all metric": - - do: - indices.stats: { fielddata_fields: "*r", metric: _all } - - - match: { _shards.failed: 0} - - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } - - is_false: _all.total.fielddata.fields.baz - - is_false: _all.total.completion.fields - ---- -"Fielddata fields - one metric": - - do: - indices.stats: { fielddata_fields: "*r", metric: fielddata } - - - match: { _shards.failed: 0} - - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } - - is_false: _all.total.fielddata.fields.baz - - is_false: _all.total.completion.fields - - ---- -"Fielddata fields - multi metric": - - do: - indices.stats: { fielddata_fields: "*r", metric: [ fielddata, search] } - - - match: { _shards.failed: 0} - - gt: { _all.total.fielddata.fields.bar.memory_size_in_bytes: 0 } - - is_false: _all.total.fielddata.fields.baz - - is_false: _all.total.completion.fields - - ---- -"Completion fields - one": - - do: - indices.stats: { completion_fields: bar.completion } - - - match: { _shards.failed: 0} - - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } - - is_false: _all.total.completion.fields.baz\.completion - - is_false: _all.total.fielddata.fields - ---- -"Completion fields - multi": - - do: - indices.stats: { completion_fields: "bar.completion,baz,baz.completion" } - - - match: { _shards.failed: 0} - - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } - - gt: { _all.total.completion.fields.baz\.completion.size_in_bytes: 0 } - - is_false: _all.total.fielddata.fields - ---- -"Completion fields - star": - - do: - indices.stats: { completion_fields: "*" } - - - match: { _shards.failed: 0} - - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } - - gt: { _all.total.completion.fields.baz\.completion.size_in_bytes: 0 } - - is_false: _all.total.fielddata.fields - ---- -"Completion - pattern": - - do: - indices.stats: { completion_fields: "*r*" } - - - match: { _shards.failed: 0} - - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } - - is_false: _all.total.completion.fields.baz\.completion - - is_false: _all.total.fielddata.fields - ---- -"Completion - all metric": - - do: - indices.stats: { completion_fields: "*r*", metric: _all } - - - match: { _shards.failed: 0} - - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } - - is_false: _all.total.completion.fields.baz\.completion - - is_false: _all.total.fielddata.fields - ---- -"Completion - one metric": - - do: - indices.stats: { completion_fields: "*r*", metric: completion } - - - match: { _shards.failed: 0} - - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } - - is_false: _all.total.completion.fields.baz\.completion - - is_false: _all.total.fielddata.fields - ---- -"Completion - multi metric": - - do: - indices.stats: { completion_fields: "*r*", metric: [ completion, search ] } - - - match: { _shards.failed: 0} - - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } - - is_false: _all.total.completion.fields.baz\.completion - - is_false: _all.total.fielddata.fields diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/14_groups.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/14_groups.yml deleted file mode 100644 index daf55b38919b2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/14_groups.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -setup: - - - do: - index: - index: test1 - id: 1 - body: { "bar": "bar", "baz": "baz" } - - - do: - search: - rest_total_hits_as_int: true - body: - stats: [ bar, baz ] - ---- -"Groups - blank": - - do: - indices.stats: {} - - - gt: { _all.total.search.query_total: 0 } - - is_false: _all.total.search.groups - ---- -"Groups - one": - - do: - indices.stats: { groups: bar } - - - gt: { _all.total.search.groups.bar.query_total: 0 } - - is_false: _all.total.search.groups.baz - ---- -"Groups - multi": - - do: - indices.stats: { groups: "bar,baz" } - - - gt: { _all.total.search.groups.bar.query_total: 0 } - - gt: { _all.total.search.groups.baz.query_total: 0 } - ---- -"Groups - star": - - do: - indices.stats: { groups: "*" } - - - gt: { _all.total.search.groups.bar.query_total: 0 } - - gt: { _all.total.search.groups.baz.query_total: 0 } - ---- -"Groups - pattern": - - do: - indices.stats: { groups: "*r" } - - - gt: { _all.total.search.groups.bar.query_total: 0 } - - is_false: _all.total.search.groups.baz - ---- -"Groups - _all metric": - - do: - indices.stats: { groups: bar, metric: _all } - - - gt: { _all.total.search.groups.bar.query_total: 0 } - - is_false: _all.total.search.groups.baz - ---- -"Groups - search metric": - - do: - indices.stats: { groups: bar, metric: search } - - - gt: { _all.total.search.groups.bar.query_total: 0 } - - is_false: _all.total.search.groups.baz - ---- -"Groups - multi metric": - - do: - indices.stats: { groups: bar, metric: [ indexing, search] } - - - gt: { _all.total.search.groups.bar.query_total: 0 } - - is_false: _all.total.search.groups.baz diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/15_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/15_types.yml deleted file mode 100644 index e2f31c3405707..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/15_types.yml +++ /dev/null @@ -1,81 +0,0 @@ ---- -setup: - - - do: - index: - index: test1 - type: bar - id: 1 - body: { "bar": "bar", "baz": "baz" } - - - do: - index: - index: test2 - type: baz - id: 1 - body: { "bar": "bar", "baz": "baz" } - - ---- -"Types - blank": - - do: - indices.stats: {} - - - match: { _all.primaries.indexing.index_total: 2 } - - is_false: _all.primaries.indexing.types - ---- -"Types - one": - - do: - indices.stats: { types: bar } - - - match: { _all.primaries.indexing.types.bar.index_total: 1 } - - is_false: _all.primaries.indexing.types.baz - ---- -"Types - multi": - - do: - indices.stats: { types: "bar,baz" } - - - match: { _all.primaries.indexing.types.bar.index_total: 1 } - - match: { _all.primaries.indexing.types.baz.index_total: 1 } - ---- -"Types - star": - - do: - indices.stats: { types: "*" } - - - match: { _all.primaries.indexing.types.bar.index_total: 1 } - - match: { _all.primaries.indexing.types.baz.index_total: 1 } - ---- -"Types - pattern": - - do: - indices.stats: { types: "*r" } - - - match: { _all.primaries.indexing.types.bar.index_total: 1 } - - is_false: _all.primaries.indexing.types.baz - ---- -"Types - _all metric": - - do: - indices.stats: { types: bar, metric: _all } - - - match: { _all.primaries.indexing.types.bar.index_total: 1 } - - is_false: _all.primaries.indexing.types.baz - ---- -"Types - indexing metric": - - do: - indices.stats: { types: bar, metric: indexing } - - - match: { _all.primaries.indexing.types.bar.index_total: 1 } - - is_false: _all.primaries.indexing.types.baz - ---- -"Types - multi metric": - - do: - indices.stats: { types: bar, metric: [ indexing, search ] } - - - match: { _all.primaries.indexing.types.bar.index_total: 1 } - - is_false: _all.primaries.indexing.types.baz diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/20_translog.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/20_translog.yml deleted file mode 100644 index b6ed05610e41c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/20_translog.yml +++ /dev/null @@ -1,280 +0,0 @@ ---- -"Translog retention without soft_deletes": - - skip: - version: " - 7.5.99" - reason: "indices without soft deletes are deprecated in 7.6" - features: "warnings" - - - do: - indices.create: - index: test - body: - settings: - soft_deletes.enabled: false - warnings: - - Creating indices with soft-deletes disabled is deprecated and will be removed in future Elasticsearch versions. - Please do not specify value for setting [index.soft_deletes.enabled] of index [test]. - - do: - cluster.health: - wait_for_no_initializing_shards: true - wait_for_events: languid - - do: - indices.stats: - metric: [ translog ] - - set: { indices.test.primaries.translog.size_in_bytes: creation_size } - - - do: - index: - index: test - id: 1 - body: { "foo": "bar" } - - - do: - indices.stats: - metric: [ translog ] - - gt: { indices.test.primaries.translog.size_in_bytes: $creation_size } - - match: { indices.test.primaries.translog.operations: 1 } -# we can't check this yet as creation size will contain two empty translog generations. A single -# non empty generation with one op may be smaller or larger than that. -# - gt: { indices.test.primaries.translog.uncommitted_size_in_bytes: $creation_size } - - match: { indices.test.primaries.translog.uncommitted_operations: 1 } - - - do: - indices.flush: - index: test - - - do: - indices.stats: - metric: [ translog ] - - gt: { indices.test.primaries.translog.size_in_bytes: $creation_size } - - match: { indices.test.primaries.translog.operations: 1 } - ## creation translog size has some overhead due to an initial empty generation that will be trimmed later - - lt: { indices.test.primaries.translog.uncommitted_size_in_bytes: $creation_size } - - match: { indices.test.primaries.translog.uncommitted_operations: 0 } - - - do: - indices.put_settings: - index: test - body: - index.translog.retention.size: -1 - index.translog.retention.age: -1 - - - do: - indices.flush: - index: test - force: true # force flush as we don't have pending ops - - - do: - indices.stats: - metric: [ translog ] - ## creation translog size has some overhead due to an initial empty generation that will be trimmed later - - lte: { indices.test.primaries.translog.size_in_bytes: $creation_size } - - match: { indices.test.primaries.translog.operations: 0 } - - lte: { indices.test.primaries.translog.uncommitted_size_in_bytes: $creation_size } - - match: { indices.test.primaries.translog.uncommitted_operations: 0 } - ---- -"Translog retention with soft_deletes": - - skip: - version: " - 7.3.99" - reason: "start ignoring translog retention policy with soft-deletes enabled in 7.4" - - do: - indices.create: - index: test - body: - settings: - soft_deletes.enabled: true - - do: - cluster.health: - wait_for_no_initializing_shards: true - wait_for_events: languid - # Before 8.0, an empty shard has two empty translog files as we used the translog_generation commit tag as the minimum required - # translog generation for recovery. Here we force-flush to have a consistent translog stats for both old and new indices. - - do: - indices.flush: - index: test - force: true - wait_if_ongoing: true - - do: - indices.stats: - metric: [ translog ] - - set: { indices.test.primaries.translog.size_in_bytes: creation_size } - - - do: - index: - index: test - id: 1 - body: { "foo": "bar" } - - - do: - indices.stats: - metric: [ translog ] - - gt: { indices.test.primaries.translog.size_in_bytes: $creation_size } - - match: { indices.test.primaries.translog.operations: 1 } - - match: { indices.test.primaries.translog.uncommitted_operations: 1 } - # call flush twice to sync the global checkpoint after the last operation so that we can have the safe commit - - do: - indices.flush: - index: test - - do: - indices.flush: - index: test - - do: - indices.stats: - metric: [ translog ] - - match: { indices.test.primaries.translog.size_in_bytes: $creation_size } - - match: { indices.test.primaries.translog.operations: 0 } - - match: { indices.test.primaries.translog.uncommitted_size_in_bytes: $creation_size } - - match: { indices.test.primaries.translog.uncommitted_operations: 0 } - ---- -"Translog retention settings are deprecated": - - skip: - version: " - 7.6.99" - reason: "translog retention settings are deprecated in 7.6" - features: "warnings" - - do: - warnings: - - Translog retention settings [index.translog.retention.age] and [index.translog.retention.size] - are deprecated and effectively ignored. They will be removed in a future version. - indices.create: - index: test - body: - settings: - index.translog.retention.size: 128mb - - do: - indices.put_settings: - index: test - body: - index.number_of_replicas: 0 - - do: - warnings: - - Translog retention settings [index.translog.retention.age] and [index.translog.retention.size] - are deprecated and effectively ignored. They will be removed in a future version. - indices.put_settings: - index: test - body: - index.translog.retention.age: 1h - - do: - indices.put_settings: - index: test - body: - index.translog.retention.age: null - index.translog.retention.size: null - ---- -"Translog last modified age stats": - - skip: - version: " - 6.2.99" - reason: translog last modified age stats was added in 6.3.0 - - do: - index: - index: test - id: 1 - body: { "foo": "bar" } - - - do: - indices.stats: - metric: [ translog ] - - gte: { indices.test.primaries.translog.earliest_last_modified_age: 0 } - ---- -"Translog stats on closed indices without soft-deletes": - - skip: - version: " - 7.5.99" - reason: "indices without soft deletes are deprecated in 7.6" - features: "warnings" - - - do: - indices.create: - index: test - body: - settings: - soft_deletes.enabled: false - warnings: - - Creating indices with soft-deletes disabled is deprecated and will be removed in future Elasticsearch versions. - Please do not specify value for setting [index.soft_deletes.enabled] of index [test]. - - - do: - cluster.health: - wait_for_no_initializing_shards: true - wait_for_events: languid - - do: - index: - index: test - id: 1 - body: { "foo": "bar" } - - - do: - index: - index: test - id: 2 - body: { "foo": "bar" } - - - do: - index: - index: test - id: 3 - body: { "foo": "bar" } - - - do: - indices.stats: - metric: [ translog ] - - match: { indices.test.primaries.translog.operations: 3 } - - match: { indices.test.primaries.translog.uncommitted_operations: 3 } - - - do: - indices.close: - index: test - wait_for_active_shards: 1 - - is_true: acknowledged - - - do: - indices.stats: - metric: [ translog ] - expand_wildcards: all - forbid_closed_indices: false - - match: { indices.test.primaries.translog.operations: 3 } - - match: { indices.test.primaries.translog.uncommitted_operations: 0 } - ---- -"Translog stats on closed indices with soft-deletes": - - skip: - version: " - 7.3.99" - reason: "start ignoring translog retention policy with soft-deletes enabled in 7.4" - - do: - indices.create: - index: test - body: - settings: - soft_deletes.enabled: true - - do: - cluster.health: - wait_for_no_initializing_shards: true - wait_for_events: languid - - do: - index: - index: test - id: 1 - body: { "foo": "bar" } - - do: - indices.stats: - metric: [ translog ] - - match: { indices.test.primaries.translog.operations: 1 } - - match: { indices.test.primaries.translog.uncommitted_operations: 1 } - - do: - cluster.health: - wait_for_no_initializing_shards: true - wait_for_events: languid - - do: - indices.close: - index: test - wait_for_active_shards: 1 - - is_true: acknowledged - - do: - indices.stats: - metric: [ translog ] - expand_wildcards: all - forbid_closed_indices: false - - match: { indices.test.primaries.translog.operations: 0 } - - match: { indices.test.primaries.translog.uncommitted_operations: 0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/30_segments.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/30_segments.yml deleted file mode 100644 index e39e019805544..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/30_segments.yml +++ /dev/null @@ -1,63 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_no_initializing_shards: true - ---- -"Segment Stats": - - - skip: - version: " - 7.1.99" - reason: forbid_closed_indices is not supported in ealier version - - - do: - indices.stats: - metric: [ segments ] - - set: { indices.test.primaries.segments.count: num_segments } - - - do: - index: - index: test - id: 1 - body: { "foo": "bar" } - - - do: - indices.flush: - index: test - - - do: - indices.stats: - metric: [ segments ] - - gt: { indices.test.primaries.segments.count: $num_segments } - - set: { indices.test.primaries.segments.count: num_segments_after_flush } - - - do: - indices.close: - index: test - wait_for_active_shards: "all" - - - do: - indices.stats: - metric: segments - expand_wildcards: closed - forbid_closed_indices: false - - - match: { indices.test.primaries.segments.count: 0 } - - - do: - indices.stats: - metric: segments - include_unloaded_segments: true - expand_wildcards: closed - forbid_closed_indices: false - - - match: { indices.test.primaries.segments.count: $num_segments_after_flush } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/40_updates_on_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/40_updates_on_refresh.yml deleted file mode 100644 index 73c58211c189e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.stats/40_updates_on_refresh.yml +++ /dev/null @@ -1,67 +0,0 @@ ---- -setup: - - - do: - indices.create: - index: test1 - wait_for_active_shards: all - body: - settings: - # Limit the number of shards so that shards are unlikely - # to be relocated or being initialized between the test - # set up and the test execution - index.number_of_shards: 3 - index.number_of_replicas: 0 - mappings: - properties: - bar: - type: text - fielddata: true - fields: - completion: - type: completion - - - do: - cluster.health: - wait_for_no_relocating_shards: true - wait_for_events: languid - - - do: - index: - index: test1 - id: 1 - body: { "bar": "bar" } - - - do: - index: - index: test1 - id: 2 - body: { "bar": "foo" } - - - do: - indices.refresh: {} - ---- -"Completion stats": - - do: - indices.stats: { completion_fields: "*" } - - - match: { _shards.failed: 0} - - gt: { _all.total.completion.fields.bar\.completion.size_in_bytes: 0 } - - gt: { _all.total.completion.size_in_bytes: 0 } - - set: { _all.total.completion.size_in_bytes: original_size } - - - do: - index: - index: test1 - id: 3 - body: { "bar": "foo", "baz": "foo" } - - - do: - indices.refresh: {} - - - do: - indices.stats: { completion_fields: "*" } - - - match: { _shards.failed: 0} - - gt: { _all.total.completion.size_in_bytes: $original_size } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/10_basic.yml deleted file mode 100644 index b7cae037b86ce..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/10_basic.yml +++ /dev/null @@ -1,168 +0,0 @@ ---- -"Basic test for aliases": - - - do: - indices.create: - index: test_index - - - do: - indices.exists_alias: - name: test_alias - - - is_false: '' - - - do: - indices.update_aliases: - body: - actions: - - add: - index: test_index - alias: test_alias - routing: routing_value - filter: - ids: - values: ["1", "2", "3"] - - - do: - indices.exists_alias: - name: test_alias - - - is_true: '' - - - do: - indices.get_alias: - index: test_index - name: test_alias - - - match: {test_index.aliases.test_alias: {filter: { ids : { values: ["1", "2", "3"]}}, 'index_routing': 'routing_value', 'search_routing': 'routing_value'}} - ---- -"Basic test for multiple aliases": - - - do: - indices.create: - index: test_index - - - do: - indices.exists_alias: - name: test_alias1 - - - is_false: '' - - - do: - indices.exists_alias: - name: test_alias2 - - - is_false: '' - - - do: - indices.update_aliases: - body: - actions: - - add: - indices: [test_index] - aliases: [test_alias1, test_alias2] - routing: routing_value - - - do: - indices.exists_alias: - name: test_alias1 - - - is_true: '' - - - do: - indices.exists_alias: - name: test_alias2 - - - is_true: '' - - - do: - indices.get_alias: - index: test_index - - - match: {test_index.aliases.test_alias1: {'index_routing': 'routing_value', 'search_routing': 'routing_value'}} - - match: {test_index.aliases.test_alias2: {'index_routing': 'routing_value', 'search_routing': 'routing_value'}} - ---- -"Remove alias": - - do: - indices.create: - index: test_index - - do: - indices.exists_alias: - name: test_alias1 - - is_false: '' - - do: - indices.exists_alias: - name: test_alias2 - - is_false: '' - - do: - indices.exists_alias: - name: test_alias3 - - is_false: '' - - - do: - indices.update_aliases: - body: - actions: - - add: - index: test_index - aliases: [test_alias1, test_alias2] - - do: - indices.exists_alias: - name: test_alias1 - - is_true: '' - - do: - indices.exists_alias: - name: test_alias2 - - is_true: '' - - do: - indices.exists_alias: - name: test_alias3 - - is_false: '' - - - do: - indices.update_aliases: - body: - actions: - - remove: - index: test_index - alias: test_alias1 - - add: - index: test_index - alias: test_alias3 - - do: - indices.exists_alias: - name: test_alias1 - - is_false: '' - - do: - indices.exists_alias: - name: test_alias2 - - is_true: '' - - do: - indices.exists_alias: - name: test_alias3 - - is_true: '' - - - do: - indices.update_aliases: - body: - actions: - - remove: - index: test_index - alias: test_alias2 - - remove: - index: test_index - alias: test_alias3 - - do: - indices.exists_alias: - name: test_alias1 - - is_false: '' - - do: - indices.exists_alias: - name: test_alias2 - - is_false: '' - - do: - indices.exists_alias: - name: test_alias3 - - is_false: '' diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/20_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/20_routing.yml deleted file mode 100644 index ecedcef0c1a48..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/20_routing.yml +++ /dev/null @@ -1,135 +0,0 @@ -setup: - - do: - indices.create: - index: test_index - ---- -"Routing": - - - do: - indices.update_aliases: - body: - actions: - - add: - index: test_index - alias: test_alias - routing: routing - - - do: - indices.get_alias: - index: test_index - - - match: {test_index.aliases.test_alias: {'index_routing': 'routing', 'search_routing': 'routing'}} - ---- -"Index Routing": - - - do: - indices.update_aliases: - body: - actions: - - add: - index: test_index - alias: test_alias - index_routing: index_routing - - - do: - indices.get_alias: - index: test_index - - - match: {test_index.aliases.test_alias: {'index_routing': 'index_routing'}} - ---- -"Search Routing": - - - do: - indices.update_aliases: - body: - actions: - - add: - index: test_index - alias: test_alias - search_routing: search_routing - - - do: - indices.get_alias: - index: test_index - - - match: {test_index.aliases.test_alias: {'search_routing': 'search_routing'}} - ---- -"Index, Default Routing": - - - do: - indices.update_aliases: - body: - actions: - - add: - index: test_index - alias: test_alias - index_routing: index_routing - routing: routing - - - do: - indices.get_alias: - index: test_index - - - match: {test_index.aliases.test_alias: {'index_routing': 'index_routing', 'search_routing': 'routing'}} - ---- -"Search, Default Routing": - - - do: - indices.update_aliases: - body: - actions: - - add: - index: test_index - alias: test_alias - search_routing: search_routing - routing: routing - - - do: - indices.get_alias: - index: test_index - - - match: {test_index.aliases.test_alias: {'index_routing': 'routing', 'search_routing': 'search_routing'}} - ---- -"Index, Search, Default Routing": - - - do: - indices.update_aliases: - body: - actions: - - add: - index: test_index - alias: test_alias - index_routing: index_routing - search_routing: search_routing - routing: routing - - - do: - indices.get_alias: - index: test_index - - - match: {test_index.aliases.test_alias: {'index_routing': 'index_routing', 'search_routing': 'search_routing'}} - ---- -"Numeric Routing": - - - do: - indices.update_aliases: - body: - actions: - - add: - index: test_index - alias: test_alias - routing: 5 - - - do: - indices.get_alias: - index: test_index - - - match: {test_index.aliases.test_alias: {'index_routing': '5', 'search_routing': '5'}} - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/30_remove_index_and_replace_with_alias.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/30_remove_index_and_replace_with_alias.yml deleted file mode 100644 index ebf923e259997..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.update_aliases/30_remove_index_and_replace_with_alias.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -"Remove an index and replace it with an alias": - - - do: - indices.create: - index: test - - do: - indices.create: - index: test_2 - - - do: - indices.update_aliases: - body: - actions: - - add: - index: test_2 - aliases: [test, test_write] - - remove_index: - index: test - - - do: - indices.exists_alias: - name: test - - is_true: '' - - - do: - indices.exists_alias: - name: test_write - - is_true: '' - - - do: - indices.get: - index: test - # the name of the index that the alias points to, would be `test` if the index were still there - - is_true: test_2 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.upgrade/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.upgrade/10_basic.yml deleted file mode 100644 index 55070cb8c1f97..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.upgrade/10_basic.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -"Basic test for upgrade indices": - - - do: - indices.create: - index: test_index - body: - settings: - index: - number_of_replicas: 0 - - - do: - indices.upgrade: - index: test_index - - - match: {upgraded_indices.test_index.oldest_lucene_segment_version: '/(\d\.)+\d/'} - - is_true: upgraded_indices.test_index.upgrade_version - ---- -"Upgrade indices ignore unavailable": - - do: - indices.create: - index: test_index - body: - settings: - index: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - indices.upgrade: - index: ["does_not_exist", "test_index"] - ignore_unavailable: true - - - match: {_shards.total: 1} - - is_true: upgraded_indices.test_index.upgrade_version - - is_false: upgraded_indices.does_not_exist - ---- -"Upgrade indices allow no indices": - - - do: - indices.upgrade: - index: test_index - ignore_unavailable: true - allow_no_indices: true - - - match: {_shards.total: 0} - ---- -"Upgrade indices disallow no indices": - - - do: - catch: missing - indices.upgrade: - index: test_index - ignore_unavailable: true - allow_no_indices: false - ---- -"Upgrade indices disallow unavailable": - - - do: - indices.create: - index: test_index - - - do: - catch: missing - indices.upgrade: - index: ["test_index", "does_not_exist"] - ignore_unavailable: false - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/10_basic.yml deleted file mode 100644 index 2221d08c0b7e2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/10_basic.yml +++ /dev/null @@ -1,88 +0,0 @@ -setup: - - do: - indices.create: - index: testing - body: - settings: - number_of_replicas: 0 - aliases: - alias_1: - "filter" : { "match_all" : {} } - - ---- -"Validate query api": - - skip: - version: ' - 7.6.99' - reason: message changed in 7.7.0 - - - do: - indices.validate_query: - q: query string - index: testing - - - is_true: valid - - - do: - indices.validate_query: - q: query string - index: alias_1 - - - is_true: valid - - - do: - indices.validate_query: - body: - query: - invalid_query: {} - - - is_false: valid - - is_false: error - - - do: - indices.validate_query: - explain: true - body: - query: - invalid_query: {} - - - is_false: valid - - match: {error: '/.+unknown\squery\s\[invalid_query\].+/' } - - - do: - indices.validate_query: - explain: true - body: - query: - boool: {} - - - is_false: valid - - match: {error: '/.+unknown\squery\s\[boool\]\sdid\syou\smean\s\[bool\]\?.+/' } - - - do: - indices.validate_query: - explain: true - - - is_true: valid - - match: {_shards.failed: 0} - - match: {explanations.0.index: 'testing'} - - match: {explanations.0.explanation: '*:*'} - ---- -"Validate body without query element": - - do: - indices.validate_query: - body: - match_all: {} - - - is_false: valid - - is_false: error - - - do: - indices.validate_query: - explain: true - body: - match_all: {} - - - is_false: valid - - match: {error: 'org.elasticsearch.common.ParsingException: request does not support [match_all]'} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/20_query_string.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/20_query_string.yml deleted file mode 100644 index 2f74aee3a973e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/indices.validate_query/20_query_string.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -"validate_query with query_string parameters": - - do: - indices.create: - index: test - body: - mappings: - properties: - field: - type: text - number: - type: integer - - - do: - indices.validate_query: - index: test - q: bar - df: field - - - is_true: valid - - - do: - indices.validate_query: - index: test - q: field:foo field:xyz - - - is_true: valid - - - do: - indices.validate_query: - index: test - q: field:foo field:xyz - default_operator: AND - - - is_true: valid - - - do: - indices.validate_query: - index: test - q: field:BA* - - - is_true: valid - - - do: - indices.validate_query: - index: test - q: number:foo - lenient: true - - - is_true: valid diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/info/10_info.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/info/10_info.yml deleted file mode 100644 index d0c99ee0a7c5b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/info/10_info.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -"Info": - - do: {info: {}} - - is_true: name - - is_true: cluster_name - - is_true: cluster_uuid - - is_true: tagline - - is_true: version - - is_true: version.number diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/info/20_lucene_version.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/info/20_lucene_version.yml deleted file mode 100644 index 83414fbabc565..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/info/20_lucene_version.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -"Lucene Version": - - do: {info: {}} - - is_true: version.lucene_version - - - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/ingest/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/ingest/10_basic.yml deleted file mode 100644 index e5b9b0fd5ebca..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/ingest/10_basic.yml +++ /dev/null @@ -1,154 +0,0 @@ ---- -"Test basic pipeline crud": - - do: - ingest.put_pipeline: - id: "my_pipeline" - body: > - { - "description": "_description", - "processors": [ - ] - } - - match: { acknowledged: true } - - - do: - ingest.get_pipeline: - id: "my_pipeline" - - match: { my_pipeline.description: "_description" } - - - do: - ingest.delete_pipeline: - id: "my_pipeline" - - match: { acknowledged: true } - - - do: - catch: missing - ingest.get_pipeline: - id: "my_pipeline" - ---- -"Test Put Versioned Pipeline": - - do: - ingest.put_pipeline: - id: "my_pipeline" - body: > - { - "version": 10, - "processors": [ ] - } - - match: { acknowledged: true } - - - do: - ingest.get_pipeline: - id: "my_pipeline" - - match: { my_pipeline.version: 10 } - - # Lower version - - do: - ingest.put_pipeline: - id: "my_pipeline" - body: > - { - "version": 9, - "processors": [ ] - } - - match: { acknowledged: true } - - - do: - ingest.get_pipeline: - id: "my_pipeline" - - match: { my_pipeline.version: 9 } - - # Higher version - - do: - ingest.put_pipeline: - id: "my_pipeline" - body: > - { - "version": 6789, - "processors": [ ] - } - - match: { acknowledged: true } - - - do: - ingest.get_pipeline: - id: "my_pipeline" - - match: { my_pipeline.version: 6789 } - - # No version - - do: - ingest.put_pipeline: - id: "my_pipeline" - body: > - { - "processors": [ ] - } - - match: { acknowledged: true } - - - do: - ingest.get_pipeline: - id: "my_pipeline" - - is_false: my_pipeline.version - - # Coming back with a version - - do: - ingest.put_pipeline: - id: "my_pipeline" - body: > - { - "version": 5385, - "processors": [ ] - } - - match: { acknowledged: true } - - - do: - ingest.get_pipeline: - id: "my_pipeline" - - match: { my_pipeline.version: 5385 } - - # Able to delete the versioned pipeline - - do: - ingest.delete_pipeline: - id: "my_pipeline" - - match: { acknowledged: true } - - - do: - catch: missing - ingest.get_pipeline: - id: "my_pipeline" ---- -"Test Get All Pipelines": - - do: - ingest.put_pipeline: - id: "first_pipeline" - body: > - { - "description": "first", - "processors": [] - } - - do: - ingest.put_pipeline: - id: "second_pipeline" - body: > - { - "description": "second", - "processors": [] - } - - - do: - ingest.get_pipeline: {} - - match: { first_pipeline.description: "first" } - - match: { second_pipeline.description: "second" } - ---- -"Test invalid config": - - do: - catch: /parse_exception/ - ingest.put_pipeline: - id: "my_pipeline" - body: > - { - "description": "_description", - "processors": [], - "invalid_field" : {} - } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/10_basic.yml deleted file mode 100644 index 798d699ae80a0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/10_basic.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -"Basic multi-get": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_2 - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - indices.refresh: {} - - - do: - mget: - body: - docs: - - { _index: test_2, _id: 1} - - { _index: test_1, _id: 2} - - { _index: test_1, _id: 1} - - - is_false: docs.0.found - - match: { docs.0._index: test_2 } - - match: { docs.0._type: null } - - match: { docs.0._id: "1" } - - - is_false: docs.1.found - - match: { docs.1._index: test_1 } - - match: { docs.1._type: _doc } - - match: { docs.1._id: "2" } - - - is_true: docs.2.found - - match: { docs.2._index: test_1 } - - match: { docs.2._type: _doc } - - match: { docs.2._id: "1" } - - match: { docs.2._version: 1 } - - match: { docs.2._source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/11_default_index_type.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/11_default_index_type.yml deleted file mode 100644 index 773b7e3bcfe6b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/11_default_index_type.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -"Default index/type": - - do: - indices.create: - index: test_2 - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - mget: - index: test_1 - type: test - body: - docs: - - { _index: test_2, _id: 1} - - { _type: none, _id: 1} - - { _id: 2} - - { _id: 1} - - - is_false: docs.0.found - - match: { docs.0._index: test_2 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } - - - is_false: docs.1.found - - match: { docs.1._index: test_1 } - - match: { docs.1._type: none } - - match: { docs.1._id: "1" } - - - is_false: docs.2.found - - match: { docs.2._index: test_1 } - - match: { docs.2._type: test } - - match: { docs.2._id: "2" } - - - is_true: docs.3.found - - match: { docs.3._index: test_1 } - - match: { docs.3._type: test } - - match: { docs.3._id: "1" } - - match: { docs.3._version: 1 } - - match: { docs.3._source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/12_non_existent_index.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/12_non_existent_index.yml deleted file mode 100644 index a1101a903f896..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/12_non_existent_index.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -"Non-existent index": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - mget: - body: - docs: - - { _index: test_2, _id: 1} - - - is_false: docs.0.found - - match: { docs.0._index: test_2 } - - match: { docs.0._type: null } - - match: { docs.0._id: "1" } - - - do: - mget: - body: - docs: - - { _index: test_1, _id: 1} - - - is_true: docs.0.found - - match: { docs.0._index: test_1 } - - match: { docs.0._type: _doc } - - match: { docs.0._id: "1" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/13_missing_metadata.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/13_missing_metadata.yml deleted file mode 100644 index 2711bed58dbb1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/13_missing_metadata.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -"Missing metadata": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - catch: /action_request_validation_exception.+ id is missing/ - mget: - body: - docs: - - { _index: test_1 } - - - do: - catch: /action_request_validation_exception.+ index is missing/ - mget: - body: - docs: - - { _id: 1 } - - - do: - catch: /action_request_validation_exception.+ no documents to get/ - mget: - body: - docs: [] - - - do: - catch: /action_request_validation_exception.+ no documents to get/ - mget: - body: {} - - - do: - mget: - body: - docs: - - { _index: test_1, _id: 1} - - - is_true: docs.0.found - - match: { docs.0._index: test_1 } - - match: { docs.0._type: _doc } - - match: { docs.0._id: "1" } - - match: { docs.0._version: 1 } - - match: { docs.0._source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/14_alias_to_multiple_indices.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/14_alias_to_multiple_indices.yml deleted file mode 100644 index 4ee569956397c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/14_alias_to_multiple_indices.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -"Multi Get with alias that resolves to multiple indices": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - bulk: - refresh: true - body: | - {"index": {"_index": "test_1", "_type": "_doc", "_id": 1}} - { "foo": "bar" } - {"index": {"_index": "test_2", "_type": "_doc", "_id": 2}} - { "foo": "bar" } - {"index": {"_index": "test_3", "_type": "_doc", "_id": 3}} - { "foo": "bar" } - - - do: - indices.put_alias: - index: test_2 - name: test_two_and_three - - - do: - indices.put_alias: - index: test_3 - name: test_two_and_three - - - do: - mget: - body: - docs: - - { _index: test_1, _id: 1} - - { _index: test_two_and_three, _id: 2} - - - is_true: docs.0.found - - match: { docs.0._index: test_1 } - - match: { docs.0._type: _doc } - - match: { docs.0._id: "1" } - - - is_false: docs.1.found - - match: { docs.1._index: test_two_and_three } - - match: { docs.1._type: null } - - match: { docs.1._id: "2" } - - match: { docs.1.error.root_cause.0.type: "illegal_argument_exception" } - - match: { docs.1.error.root_cause.0.reason: "/Alias.\\[test_two_and_three\\].has.more.than.one.indices.associated.with.it.\\[\\[test_[23]{1},.test_[23]{1}\\]\\],.can't.execute.a.single.index.op/" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/15_ids.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/15_ids.yml deleted file mode 100644 index fbdc9b265a95a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/15_ids.yml +++ /dev/null @@ -1,73 +0,0 @@ ---- -"IDs": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - index: - index: test_1 - id: 2 - body: { foo: baz } - - - do: - mget: - index: test_1 - body: - ids: [1, 3] - - - is_true: docs.0.found - - match: { docs.0._index: test_1 } - - match: { docs.0._type: _doc } - - match: { docs.0._id: "1" } - - match: { docs.0._version: 1 } - - match: { docs.0._source: { foo: bar }} - - - is_false: docs.1.found - - match: { docs.1._index: test_1 } - - match: { docs.1._type: _doc } - - match: { docs.1._id: "3" } - - - do: - mget: - index: test_1 - body: - ids: [1, 2] - - - is_true: docs.0.found - - match: { docs.0._index: test_1 } - - match: { docs.0._type: _doc } - - match: { docs.0._id: "1" } - - match: { docs.0._version: 1 } - - match: { docs.0._source: { foo: bar }} - - - is_true: docs.1.found - - match: { docs.1._index: test_1 } - - match: { docs.1._type: _doc } - - match: { docs.1._id: "2" } - - match: { docs.1._version: 1 } - - match: { docs.1._source: { foo: baz }} - - - - do: - catch: /action_request_validation_exception.+ no documents to get/ - mget: - index: test_1 - body: - ids: [] - - - do: - catch: /action_request_validation_exception.+ no documents to get/ - mget: - index: test_1 - body: {} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/16_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/16_basic_with_types.yml deleted file mode 100644 index 0850772ad426c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/16_basic_with_types.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -"Basic multi-get": - - do: - indices.create: - index: test_2 - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - indices.refresh: {} - - - do: - mget: - body: - docs: - - { _index: test_2, _type: test, _id: 1} - - { _index: test_1, _type: none, _id: 1} - - { _index: test_1, _type: test, _id: 2} - - { _index: test_1, _type: test, _id: 1} - - - is_false: docs.0.found - - match: { docs.0._index: test_2 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } - - - is_false: docs.1.found - - match: { docs.1._index: test_1 } - - match: { docs.1._type: none } - - match: { docs.1._id: "1" } - - - is_false: docs.2.found - - match: { docs.2._index: test_1 } - - match: { docs.2._type: test } - - match: { docs.2._id: "2" } - - - is_true: docs.3.found - - match: { docs.3._index: test_1 } - - match: { docs.3._type: test } - - match: { docs.3._id: "1" } - - match: { docs.3._version: 1 } - - match: { docs.3._source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/17_default_index.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/17_default_index.yml deleted file mode 100644 index d03f99be39517..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/17_default_index.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -"Default index/type": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_2 - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - mget: - index: test_1 - body: - docs: - - { _index: test_2, _id: 1} - - { _id: 2} - - { _id: 1} - - - is_false: docs.0.found - - match: { docs.0._index: test_2 } - - match: { docs.0._type: null } - - match: { docs.0._id: "1" } - - - is_false: docs.1.found - - match: { docs.1._index: test_1 } - - match: { docs.1._type: _doc } - - match: { docs.1._id: "2" } - - - is_true: docs.2.found - - match: { docs.2._index: test_1 } - - match: { docs.2._type: _doc } - - match: { docs.2._id: "1" } - - match: { docs.2._version: 1 } - - match: { docs.2._source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/18_non_existent_index_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/18_non_existent_index_with_types.yml deleted file mode 100644 index 0623464225072..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/18_non_existent_index_with_types.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -"Non-existent index": - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - mget: - body: - docs: - - { _index: test_2, _type: test, _id: 1} - - - is_false: docs.0.found - - match: { docs.0._index: test_2 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } - - - do: - mget: - body: - docs: - - { _index: test_1, _type: test, _id: 1} - - - is_true: docs.0.found - - match: { docs.0._index: test_1 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/19_missing_metadata_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/19_missing_metadata_with_types.yml deleted file mode 100644 index d7af1797f7a40..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/19_missing_metadata_with_types.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -"Missing metadata": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - catch: /action_request_validation_exception.+ id is missing/ - mget: - body: - docs: - - { _index: test_1, _type: test} - - - do: - catch: /action_request_validation_exception.+ index is missing/ - mget: - body: - docs: - - { _type: test, _id: 1} - - - do: - catch: /action_request_validation_exception.+ no documents to get/ - mget: - body: - docs: [] - - - do: - catch: /action_request_validation_exception.+ no documents to get/ - mget: - body: {} - - - do: - mget: - body: - docs: - - { _index: test_1, _id: 1} - - - is_true: docs.0.found - - match: { docs.0._index: test_1 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } - - match: { docs.0._version: 1 } - - match: { docs.0._source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/20_stored_fields.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/20_stored_fields.yml deleted file mode 100644 index 45460deb04e0b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/20_stored_fields.yml +++ /dev/null @@ -1,115 +0,0 @@ ---- -"Stored fields": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - mappings: - properties: - foo: - type: keyword - store: true - count: - type: integer - store: true - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - mget: - index: test_1 - body: - docs: - - { _id: 1 } - - { _id: 1, stored_fields: foo } - - { _id: 1, stored_fields: [foo] } - - { _id: 1, stored_fields: [foo, _source] } - - - is_false: docs.0.fields - - match: { docs.0._source: { foo: bar }} - - - match: { docs.1.fields.foo: [bar] } - - is_false: docs.1._source - - - match: { docs.2.fields.foo: [bar] } - - is_false: docs.2._source - - - match: { docs.3.fields.foo: [bar] } - - match: { docs.3._source: { foo: bar }} - - - do: - mget: - index: test_1 - stored_fields: foo - body: - docs: - - { _id: 1 } - - { _id: 1, stored_fields: foo } - - { _id: 1, stored_fields: [foo] } - - { _id: 1, stored_fields: [foo, _source] } - - - match: { docs.0.fields.foo: [bar] } - - is_false: docs.0._source - - - match: { docs.1.fields.foo: [bar] } - - is_false: docs.1._source - - - match: { docs.2.fields.foo: [bar] } - - is_false: docs.2._source - - - match: { docs.3.fields.foo: [bar] } - - match: { docs.3._source: { foo: bar }} - - - do: - mget: - index: test_1 - stored_fields: [foo] - body: - docs: - - { _id: 1 } - - { _id: 1, stored_fields: foo } - - { _id: 1, stored_fields: [foo] } - - { _id: 1, stored_fields: [foo, _source] } - - - match: { docs.0.fields.foo: [bar] } - - is_false: docs.0._source - - - match: { docs.1.fields.foo: [bar] } - - is_false: docs.1._source - - - match: { docs.2.fields.foo: [bar] } - - is_false: docs.2._source - - - match: { docs.3.fields.foo: [bar] } - - match: { docs.3._source: { foo: bar }} - - - do: - mget: - index: test_1 - stored_fields: [foo, _source] - body: - docs: - - { _id: 1 } - - { _id: 1, stored_fields: foo } - - { _id: 1, stored_fields: [foo] } - - { _id: 1, stored_fields: [foo, _source] } - - - match: { docs.0.fields.foo: [bar] } - - match: { docs.0._source: { foo: bar }} - - - match: { docs.1.fields.foo: [bar] } - - is_false: docs.1._source - - - match: { docs.2.fields.foo: [bar] } - - is_false: docs.2._source - - - match: { docs.3.fields.foo: [bar] } - - match: { docs.3._source: { foo: bar }} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/21_alias_to_multiple_indices_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/21_alias_to_multiple_indices_with_types.yml deleted file mode 100644 index 3a0fec04738b6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/21_alias_to_multiple_indices_with_types.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -"Multi Get with alias that resolves to multiple indices": - - - do: - bulk: - refresh: true - body: | - {"index": {"_index": "test_1", "_type": "test", "_id": 1}} - { "foo": "bar" } - {"index": {"_index": "test_2", "_type": "test", "_id": 2}} - { "foo": "bar" } - {"index": {"_index": "test_3", "_type": "test", "_id": 3}} - { "foo": "bar" } - - - do: - indices.put_alias: - index: test_2 - name: test_two_and_three - - - do: - indices.put_alias: - index: test_3 - name: test_two_and_three - - - do: - mget: - body: - docs: - - { _index: test_1, _type: test, _id: 1} - - { _index: test_two_and_three, _type: test, _id: 2} - - - is_true: docs.0.found - - match: { docs.0._index: test_1 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } - - - is_false: docs.1.found - - match: { docs.1._index: test_two_and_three } - - match: { docs.1._type: test } - - match: { docs.1._id: "2" } - - match: { docs.1.error.root_cause.0.type: "illegal_argument_exception" } - - match: { docs.1.error.root_cause.0.reason: "/Alias.\\[test_two_and_three\\].has.more.than.one.indices.associated.with.it.\\[\\[test_[23]{1},.test_[23]{1}\\]\\],.can't.execute.a.single.index.op/" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/22_ids_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/22_ids_with_types.yml deleted file mode 100644 index 6c233e4d92a9c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/22_ids_with_types.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -"IDs": - - do: - indices.create: - index: test_1 - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - index: - index: test_1 - type: test - id: 2 - body: { foo: baz } - - - do: - mget: - index: test_1 - type: test - body: - ids: [1, 3] - - - is_true: docs.0.found - - match: { docs.0._index: test_1 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } - - match: { docs.0._version: 1 } - - match: { docs.0._source: { foo: bar }} - - - is_false: docs.1.found - - match: { docs.1._index: test_1 } - - match: { docs.1._type: test } - - match: { docs.1._id: "3" } - - - do: - mget: - index: test_1 - body: - ids: [1, 2] - - - is_true: docs.0.found - - match: { docs.0._index: test_1 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } - - match: { docs.0._version: 1 } - - match: { docs.0._source: { foo: bar }} - - - is_true: docs.1.found - - match: { docs.1._index: test_1 } - - match: { docs.1._type: test } - - match: { docs.1._id: "2" } - - match: { docs.1._version: 1 } - - match: { docs.1._source: { foo: baz }} - - - - do: - catch: /action_request_validation_exception.+ no documents to get/ - mget: - index: test_1 - body: - ids: [] - - - do: - catch: /action_request_validation_exception.+ no documents to get/ - mget: - index: test_1 - body: {} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/23_stored_fields_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/23_stored_fields_with_types.yml deleted file mode 100644 index 05b9738d46180..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/23_stored_fields_with_types.yml +++ /dev/null @@ -1,120 +0,0 @@ ---- -"Stored fields": - - - do: - indices.create: - include_type_name: true - index: test_1 - body: - mappings: - test: - properties: - foo: - type: keyword - store: true - count: - type: integer - store: true - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - mget: - index: test_1 - type: test - body: - docs: - - { _id: 1 } - - { _id: 1, stored_fields: foo } - - { _id: 1, stored_fields: [foo] } - - { _id: 1, stored_fields: [foo, _source] } - - - is_false: docs.0.fields - - match: { docs.0._source: { foo: bar }} - - - match: { docs.1.fields.foo: [bar] } - - is_false: docs.1._source - - - match: { docs.2.fields.foo: [bar] } - - is_false: docs.2._source - - - match: { docs.3.fields.foo: [bar] } - - match: { docs.3._source: { foo: bar }} - - - do: - mget: - index: test_1 - type: test - stored_fields: foo - body: - docs: - - { _id: 1 } - - { _id: 1, stored_fields: foo } - - { _id: 1, stored_fields: [foo] } - - { _id: 1, stored_fields: [foo, _source] } - - - match: { docs.0.fields.foo: [bar] } - - is_false: docs.0._source - - - match: { docs.1.fields.foo: [bar] } - - is_false: docs.1._source - - - match: { docs.2.fields.foo: [bar] } - - is_false: docs.2._source - - - match: { docs.3.fields.foo: [bar] } - - match: { docs.3._source: { foo: bar }} - - - do: - mget: - index: test_1 - type: test - stored_fields: [foo] - body: - docs: - - { _id: 1 } - - { _id: 1, stored_fields: foo } - - { _id: 1, stored_fields: [foo] } - - { _id: 1, stored_fields: [foo, _source] } - - - match: { docs.0.fields.foo: [bar] } - - is_false: docs.0._source - - - match: { docs.1.fields.foo: [bar] } - - is_false: docs.1._source - - - match: { docs.2.fields.foo: [bar] } - - is_false: docs.2._source - - - match: { docs.3.fields.foo: [bar] } - - match: { docs.3._source: { foo: bar }} - - - do: - mget: - index: test_1 - type: test - stored_fields: [foo, _source] - body: - docs: - - { _id: 1 } - - { _id: 1, stored_fields: foo } - - { _id: 1, stored_fields: [foo] } - - { _id: 1, stored_fields: [foo, _source] } - - - match: { docs.0.fields.foo: [bar] } - - match: { docs.0._source: { foo: bar }} - - - match: { docs.1.fields.foo: [bar] } - - is_false: docs.1._source - - - match: { docs.2.fields.foo: [bar] } - - is_false: docs.2._source - - - match: { docs.3.fields.foo: [bar] } - - match: { docs.3._source: { foo: bar }} - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/40_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/40_routing.yml deleted file mode 100644 index df2924f274bdf..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/40_routing.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -"Routing": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - id: 1 - routing: 5 - body: { foo: bar } - - - do: - mget: - index: test_1 - stored_fields: [_routing] - body: - docs: - - { _id: 1 } - - { _id: 1, routing: 4 } - - { _id: 1, routing: 5 } - - - is_false: docs.0.found - - is_false: docs.1.found - - - is_true: docs.2.found - - match: { docs.2._index: test_1 } - - match: { docs.2._type: _doc } - - match: { docs.2._id: "1" } - - match: { docs.2._routing: "5" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/41_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/41_routing_with_types.yml deleted file mode 100644 index d550dd26657c9..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/41_routing_with_types.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -"Routing": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - routing: 5 - body: { foo: bar } - - - do: - mget: - index: test_1 - type: test - stored_fields: [_routing] - body: - docs: - - { _id: 1 } - - { _id: 1, routing: 4 } - - { _id: 1, routing: 5 } - - - is_false: docs.0.found - - is_false: docs.1.found - - - is_true: docs.2.found - - match: { docs.2._index: test_1 } - - match: { docs.2._type: test } - - match: { docs.2._id: "1" } - - match: { docs.2._routing: "5" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/60_realtime_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/60_realtime_refresh.yml deleted file mode 100644 index 3b1bfcdca556c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/60_realtime_refresh.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -"Realtime Refresh": - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - settings: - index: - refresh_interval: -1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - mget: - index: test_1 - realtime: false - body: - ids: [1] - - - is_false: docs.0.found - - - do: - mget: - index: test_1 - realtime: true - body: - ids: [1] - - - is_true: docs.0.found - - - do: - mget: - index: test_1 - realtime: false - refresh: true - body: - ids: [1] - - - is_true: docs.0.found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/61_realtime_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/61_realtime_refresh_with_types.yml deleted file mode 100644 index 0cb7b71cf4368..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/61_realtime_refresh_with_types.yml +++ /dev/null @@ -1,53 +0,0 @@ ---- -"Realtime Refresh": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - refresh_interval: -1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - mget: - index: test_1 - type: test - realtime: false - body: - ids: [1] - - - is_false: docs.0.found - - - do: - mget: - index: test_1 - type: test - realtime: true - body: - ids: [1] - - - is_true: docs.0.found - - - do: - mget: - index: test_1 - type: test - realtime: false - refresh: true - body: - ids: [1] - - - is_true: docs.0.found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/70_source_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/70_source_filtering.yml deleted file mode 100644 index 3a3086cf3616d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/70_source_filtering.yml +++ /dev/null @@ -1,121 +0,0 @@ -setup: - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - - do: - index: - index: test_1 - id: 2 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - ---- -"Source filtering - true/false": - - - do: - mget: - body: - docs: - - { _index: "test_1", _id: "1", _source: false } - - { _index: "test_1", _id: "2", _source: true } - - - match: { docs.0._id: "1" } - - is_false: docs.0._source - - match: { docs.1._id: "2" } - - is_true: docs.1._source - ---- -"Source filtering - include field": - - - do: - mget: - body: - docs: - - { _index: "test_1", _id: "1", _source: include.field1 } - - { _index: "test_1", _id: "2", _source: [ include.field1 ] } - - - match: { docs.0._source: { include: { field1: v1 }} } - - match: { docs.1._source: { include: { field1: v1 }} } - - ---- -"Source filtering - include nested field": - - - do: - mget: - body: - docs: - - { _index: "test_1", _id: "1", _source: { include: include.field1 } } - - { _index: "test_1", _id: "2", _source: { include: [ include.field1 ] } } - - - match: { docs.0._source: { include: { field1: v1 }} } - - match: { docs.1._source: { include: { field1: v1 }} } - ---- -"Source filtering - exclude field": - - - do: - mget: - body: - docs: - - { _index: "test_1", _id: "1", _source: { include: [ include ], exclude: [ "*.field2" ] } } - - - match: { docs.0._source: { include: { field1: v1 }} } - ---- -"Source filtering - ids and true/false": - - - do: - mget: - _source: false - index: test_1 - body: { ids: [ 1,2 ] } - - is_false: docs.0._source - - is_false: docs.1._source - - - do: - mget: - _source: true - index: test_1 - body: { ids: [ 1,2 ] } - - is_true: docs.0._source - - is_true: docs.1._source - ---- -"Source filtering - ids and include field": - - - do: - mget: - _source: include.field1 - index: test_1 - body: { ids: [ 1,2 ] } - - match: { docs.0._source: { include: { field1: v1 }} } - - match: { docs.1._source: { include: { field1: v1 }} } - ---- -"Source filtering - ids and include nested field": - - - do: - mget: - _source_includes: "include.field1,count" - index: test_1 - body: { ids: [ 1,2 ] } - - match: { docs.0._source: { include: { field1: v1 }, count: 1} } - - match: { docs.1._source: { include: { field1: v1 }, count: 1} } - ---- -"Source filtering - ids and exclude field": - - - do: - mget: - _source_includes: include - _source_excludes: "*.field2" - index: test_1 - body: { ids: [ 1,2 ] } - - match: { docs.0._source: { include: { field1: v1 } } } - - match: { docs.1._source: { include: { field1: v1 } } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/71_source_filtering_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/71_source_filtering_with_types.yml deleted file mode 100644 index 4581e060b41a7..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/71_source_filtering_with_types.yml +++ /dev/null @@ -1,119 +0,0 @@ -setup: - - do: - index: - index: test_1 - type: test - id: 1 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - - do: - index: - index: test_1 - type: test - id: 2 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - ---- -"Source filtering - true/false": - - - do: - mget: - body: - docs: - - { _index: "test_1", _type: "test", _id: "1", _source: false } - - { _index: "test_1", _type: "test", _id: "2", _source: true } - - - match: { docs.0._id: "1" } - - is_false: docs.0._source - - match: { docs.1._id: "2" } - - is_true: docs.1._source - ---- -"Source filtering - include field": - - - do: - mget: - body: - docs: - - { _index: "test_1", _type: "test", _id: "1", _source: include.field1 } - - { _index: "test_1", _type: "test", _id: "2", _source: [ include.field1 ] } - - - match: { docs.0._source: { include: { field1: v1 }} } - - match: { docs.1._source: { include: { field1: v1 }} } - - ---- -"Source filtering - include nested field": - - - do: - mget: - body: - docs: - - { _index: "test_1", _type: "test", _id: "1", _source: { include: include.field1 } } - - { _index: "test_1", _type: "test", _id: "2", _source: { include: [ include.field1 ] } } - - - match: { docs.0._source: { include: { field1: v1 }} } - - match: { docs.1._source: { include: { field1: v1 }} } - ---- -"Source filtering - exclude field": - - - do: - mget: - body: - docs: - - { _index: "test_1", _type: "test", _id: "1", _source: { include: [ include ], exclude: [ "*.field2" ] } } - - - match: { docs.0._source: { include: { field1: v1 }} } - ---- -"Source filtering - ids and true/false": - - - do: - mget: - _source: false - index: test_1 - body: { ids: [ 1,2 ] } - - is_false: docs.0._source - - is_false: docs.1._source - - - do: - mget: - _source: true - index: test_1 - body: { ids: [ 1,2 ] } - - is_true: docs.0._source - - is_true: docs.1._source - ---- -"Source filtering - ids and include field": - - - do: - mget: - _source: include.field1 - index: test_1 - body: { ids: [ 1,2 ] } - - match: { docs.0._source: { include: { field1: v1 }} } - - match: { docs.1._source: { include: { field1: v1 }} } - ---- -"Source filtering - ids and include nested field": - - - do: - mget: - _source_includes: "include.field1,count" - index: test_1 - body: { ids: [ 1,2 ] } - - match: { docs.0._source: { include: { field1: v1 }, count: 1} } - - match: { docs.1._source: { include: { field1: v1 }, count: 1} } - ---- -"Source filtering - ids and exclude field": - - - do: - mget: - _source_includes: include - _source_excludes: "*.field2" - index: test_1 - body: { ids: [ 1,2 ] } - - match: { docs.0._source: { include: { field1: v1 } } } - - match: { docs.1._source: { include: { field1: v1 } } } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated.yml deleted file mode 100644 index 0283455350a80..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated.yml +++ /dev/null @@ -1,35 +0,0 @@ - ---- -"Deprecated parameters should fail in Multi Get query": - - skip: - version: " - 6.99.99" - reason: _version, _routing are removed starting from 7.0, their equivalents without underscore are used instead - features: "warnings" - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - index: - index: test_1 - id: 2 - body: { foo: baz } - - - do: - catch: bad_request - mget: - body: - docs: - - { _index: test_1, _id: 1, _routing : test1 } - - { _index: test_1, _id: 2, _routing : test1 } - - - do: - catch: bad_request - mget: - body: - docs: - - { _index: test_1, _id: 1, _version : 1 } - - { _index: test_1, _id: 2, _version : 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated_with_types.yml deleted file mode 100644 index 5033f75c79426..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/80_deprecated_with_types.yml +++ /dev/null @@ -1,38 +0,0 @@ - ---- -"Deprecated parameters should fail in Multi Get query": - - - skip: - version: " - 6.99.99" - reason: _version, _routing are removed starting from 7.0, their equivalents without underscore are used instead - features: "warnings" - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - index: - index: test_1 - type: test - id: 2 - body: { foo: baz } - - - do: - catch: bad_request - mget: - body: - docs: - - { _index: test_1, _type: test, _id: 1, _routing : test1 } - - { _index: test_1, _type: test, _id: 2, _routing : test1 } - - - do: - catch: bad_request - mget: - body: - docs: - - { _index: test_1, _type: test, _id: 1, _version : 1 } - - { _index: test_1, _type: test, _id: 2, _version : 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/mget/TODO.txt deleted file mode 100644 index 340ff579b41e0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mget/TODO.txt +++ /dev/null @@ -1,3 +0,0 @@ -Tests missing for: - -# preference diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/10_basic.yml deleted file mode 100644 index 243d953811336..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/10_basic.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -"Basic mlt": - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_replicas: 0 - mappings: - properties: - foo: - type : "text" - title: - type : "text" - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar, title: howdy } - - - do: - indices.refresh: {} - - - do: - cluster.health: - wait_for_status: green - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: - more_like_this: - like: - - - _id: 1 - fields: ["title"] - - - match: {hits.total: 0} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/20_docs.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/20_docs.yml deleted file mode 100644 index bb1b25a0dcb40..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/20_docs.yml +++ /dev/null @@ -1,57 +0,0 @@ ---- -"Basic mlt query with docs": - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - index: - index: test_1 - id: 2 - body: { foo: baz } - - - do: - index: - index: test_1 - id: 3 - body: { foo: foo } - - - do: - indices.refresh: {} - - - do: - cluster.health: - wait_for_status: green - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: - more_like_this: - like: - - - _index: test_1 - _type: _doc - doc: - foo: bar - - - _index: test_1 - _type: _doc - _id: 2 - - - _id: 3 - include: true - min_doc_freq: 0 - min_term_freq: 0 - - - match: { hits.total: 3 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/30_unlike.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/30_unlike.yml deleted file mode 100644 index abea4c8fbe57a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mlt/30_unlike.yml +++ /dev/null @@ -1,53 +0,0 @@ ---- -"Basic mlt query with unlike": - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - - do: - index: - index: test_1 - id: 1 - body: { foo: bar baz selected } - - - do: - index: - index: test_1 - id: 2 - body: { foo: bar } - - - do: - index: - index: test_1 - id: 3 - body: { foo: bar baz } - - - do: - indices.refresh: {} - - - do: - cluster.health: - wait_for_status: green - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: - more_like_this: - like: - _index: test_1 - _type: _doc - _id: 1 - unlike: - _index: test_1 - _type: _doc - _id: 3 - include: true - min_doc_freq: 0 - min_term_freq: 0 - - - match: { hits.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/10_basic.yml deleted file mode 100644 index 5b092c9d15e44..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/10_basic.yml +++ /dev/null @@ -1,152 +0,0 @@ ---- -setup: - - - do: - index: - index: index_1 - id: 1 - body: { foo: bar } - - - do: - index: - index: index_1 - id: 2 - body: { foo: baz } - - - do: - index: - index: index_1 - id: 3 - body: { foo: foo } - - - do: - index: - index: index_2 - id: 1 - body: { foo: foo } - - - do: - indices.refresh: {} - ---- -"Basic multi-search": - - - do: - msearch: - rest_total_hits_as_int: true - body: - - index: index_* - - query: - match: {foo: foo} - - index: index_2 - - query: - match_all: {} - - index: index_1 - - query: - match: {foo: foo} - - index: index_3 - - query: - match_all: {} - - {} - - query: - match_all: {} - - - match: { responses.0.hits.total: 2 } - - match: { responses.1.hits.total: 1 } - - match: { responses.2.hits.total: 1 } - - match: { responses.3.error.root_cause.0.type: index_not_found_exception } - - match: { responses.3.error.root_cause.0.reason: "/no.such.index/" } - - match: { responses.3.error.root_cause.0.index: index_3 } - - match: { responses.4.hits.total: 4 } - ---- -"Least impact smoke test": -# only passing these parameters to make sure they are consumed - - do: - msearch: - rest_total_hits_as_int: true - max_concurrent_shard_requests: 1 - max_concurrent_searches: 1 - body: - - index: index_* - - query: - match: {foo: foo} - - index: index_2 - - query: - match_all: {} - - index: index_1 - - query: - match: {foo: foo} - - index: index_3 - - query: - match_all: {} - - {} - - query: - match_all: {} - - - match: { responses.0.hits.total: 2 } - - match: { responses.1.hits.total: 1 } - - match: { responses.2.hits.total: 1 } - - match: { responses.3.error.root_cause.0.type: index_not_found_exception } - - match: { responses.3.error.root_cause.0.reason: "/no.such.index/" } - - match: { responses.3.error.root_cause.0.index: index_3 } - - match: { responses.4.hits.total: 4 } - ---- -"Search with new response format": - - skip: - version: " - 6.99.99" - reason: hits.total is returned as an object in 7.0.0 - - - do: - msearch: - body: - - index: index_* - - query: - match: {foo: foo} - - index: index_2 - - query: - match_all: {} - - index: index_1 - - query: - match: {foo: foo} - - - match: { responses.0.hits.total.value: 2 } - - match: { responses.0.hits.total.relation: eq } - - match: { responses.1.hits.total.value: 1 } - - match: { responses.1.hits.total.relation: eq } - - match: { responses.2.hits.total.value: 1 } - - match: { responses.2.hits.total.relation: eq } - - - do: - msearch: - body: - - index: index_* - - { query: { match: {foo: foo}}, track_total_hits: 1 } - - index: index_2 - - query: - match_all: {} - - index: index_1 - - query: - match: {foo: foo} - - - match: { responses.0.hits.total.value: 1 } - - match: { responses.0.hits.total.relation: gte } - - match: { responses.1.hits.total.value: 1 } - - match: { responses.1.hits.total.relation: eq } - - match: { responses.2.hits.total.value: 1 } - - match: { responses.2.hits.total.relation: eq } - - - do: - catch: /\[rest_total_hits_as_int\] cannot be used if the tracking of total hits is not accurate, got 10/ - msearch: - rest_total_hits_as_int: true - body: - - index: index_* - - { query: { match_all: {}}, track_total_hits: 10} - - index: index_2 - - query: - match_all: {} - - index: index_1 - - query: - match: {foo: foo} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/11_status.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/11_status.yml deleted file mode 100644 index d3c1916b2c508..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/11_status.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test_1 ---- -"Check Status": - - do: - msearch: - rest_total_hits_as_int: true - body: - - index: test_2 - - query: - match_all: {} - - index: test_1 - - query: - match_all: {} - - - match: { responses.0.status: 404 } - - match: { responses.1.status: 200 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/12_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/12_basic_with_types.yml deleted file mode 100644 index 64e88de404ab7..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/12_basic_with_types.yml +++ /dev/null @@ -1,97 +0,0 @@ ---- -setup: - - - do: - index: - index: index_1 - type: test - id: 1 - body: { foo: bar } - - - do: - index: - index: index_1 - type: test - id: 2 - body: { foo: baz } - - - do: - index: - index: index_1 - type: test - id: 3 - body: { foo: foo } - - - do: - index: - index: index_2 - type: test - id: 1 - body: { foo: foo } - - - do: - indices.refresh: {} - ---- -"Basic multi-search": - - - do: - msearch: - rest_total_hits_as_int: true - body: - - index: index_* - - query: - match: {foo: foo} - - index: index_2 - - query: - match_all: {} - - index: index_1 - - query: - match: {foo: foo} - - index: index_3 - - query: - match_all: {} - - type: test - - query: - match_all: {} - - - match: { responses.0.hits.total: 2 } - - match: { responses.1.hits.total: 1 } - - match: { responses.2.hits.total: 1 } - - match: { responses.3.error.root_cause.0.type: index_not_found_exception } - - match: { responses.3.error.root_cause.0.reason: "/no.such.index/" } - - match: { responses.3.error.root_cause.0.index: index_3 } - - match: { responses.4.hits.total: 4 } - ---- -"Least impact smoke test": -# only passing these parameters to make sure they are consumed - - do: - msearch: - rest_total_hits_as_int: true - max_concurrent_shard_requests: 1 - max_concurrent_searches: 1 - body: - - index: index_* - - query: - match: {foo: foo} - - index: index_2 - - query: - match_all: {} - - index: index_1 - - query: - match: {foo: foo} - - index: index_3 - - query: - match_all: {} - - type: test - - query: - match_all: {} - - - match: { responses.0.hits.total: 2 } - - match: { responses.1.hits.total: 1 } - - match: { responses.2.hits.total: 1 } - - match: { responses.3.error.root_cause.0.type: index_not_found_exception } - - match: { responses.3.error.root_cause.0.reason: "/no.such.index/" } - - match: { responses.3.error.root_cause.0.index: index_3 } - - match: { responses.4.hits.total: 4 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/20_typed_keys.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/20_typed_keys.yml deleted file mode 100644 index 0be04fd01c0ed..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/msearch/20_typed_keys.yml +++ /dev/null @@ -1,112 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test-0 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - index_start_at: - type: integer - integer: - type: integer - float: - type: float - name: - type: keyword - title: - type: completion - - - do: - indices.create: - index: test-1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - index_start_at: - type: integer - integer: - type: integer - float: - type: float - name: - type: keyword - title: - type: completion - - - do: - bulk: - refresh: true - body: - - '{"index": {"_index": "test-0"}}' - - '{"row": 1, "index_start_at": 56, "integer": 38, "float": 12.5713, "name": "Ruth", "bool": true, "title": "doctor"}' - - '{"index": {"_index": "test-0"}}' - - '{"row": 2, "index_start_at": 57, "integer": 42, "float": 15.3393, "name": "Jackie", "bool": false}' - - '{"index": {"_index": "test-1"}}' - - '{"row": 3, "index_start_at": 58, "integer": 29, "float": 19.0517, "name": "Stephanie", "bool": true}' - - '{"index": {"_index": "test-1"}}' - - '{"row": 4, "index_start_at": 59, "integer": 19, "float": 19.3717, "bool": true, "title": "commandant"}' - - '{"index": {"_index": "test-1"}}' - - '{"row": 5, "index_start_at": 60, "integer": 0, "float": 17.3349, "name": "Natalie", "bool": false}' - ---- -"Multisearch test with typed_keys parameter": - - do: - msearch: - rest_total_hits_as_int: true - typed_keys: true - body: - # Testing aggegrations - - index: test-* - - {query: {match: {bool: true} }, size: 0, aggs: {test_filter: {filter: {range: {integer: {gte: 20} } } } } } - - index: test-1 - - {query: {match_all: {} }, size: 0, aggs: {test_range: {range: {field: float, ranges: [ {to: 19.2499999}, {from: 19.25} ] } } } } - - index: test-* - - {query: {bool: {filter: {range: {row: {lt: 5}}} } }, size: 0, aggs: {test_percentiles: {percentiles: {field: float} } } } - # Testing suggesters - - index: test-* - - {query: {match_all: {} }, size: 0, suggest: {term_suggester: {text: Natalie, term: {field: name } } } } - - index: test-* - - {query: {match_all: {} }, size: 0, suggest: {completion_suggester: {prefix: doc, completion: {field: title } } } } - - index: test-* - - {query: {match_all: {} }, size: 0, suggest: {phrase_suggester: {text: Ruht, phrase: {field: name } } } } - - - match: { responses.0.hits.total: 3 } - - match: { responses.0.aggregations.filter#test_filter.doc_count : 2 } - - match: { responses.1.hits.total: 3 } - - match: { responses.1.aggregations.range#test_range.buckets.0.key : "*-19.2499999" } - - match: { responses.1.aggregations.range#test_range.buckets.0.doc_count : 2 } - - match: { responses.1.aggregations.range#test_range.buckets.1.key : "19.25-*" } - - match: { responses.1.aggregations.range#test_range.buckets.1.doc_count : 1 } - - match: { responses.2.hits.total: 4 } - - is_true: responses.2.aggregations.tdigest_percentiles#test_percentiles.values - - is_true: responses.3.suggest.term#term_suggester - - is_true: responses.4.suggest.completion#completion_suggester - - is_true: responses.5.suggest.phrase#phrase_suggester - ---- -"Multisearch test with typed_keys parameter for sampler and significant terms": - - do: - msearch: - rest_total_hits_as_int: true - typed_keys: true - body: - - index: test-* - - {query: {match_all: {} }, size: 0, aggs: {test_sampler: {sampler: {shard_size: 200}, aggs: {test_significant_terms: {significant_terms: {field: name} } } } } } - - index: test-* - - {query: {match_all: {} }, size: 0, aggs: {test_umterms: {terms: {field: surname} } } } - - index: test-* - - {query: {match_all: {} }, size: 0, aggs: {test_sterms: {terms: {field: name}, aggs: {test_umsignificant_terms: {significant_terms: {field: surname} } } } } } - - - match: { responses.0.hits.total: 5 } - - match: { responses.0.aggregations.sampler#test_sampler.doc_count : 5 } - - match: { responses.0.aggregations.sampler#test_sampler.sigsterms#test_significant_terms.doc_count : 5 } - - match: { responses.1.hits.total: 5 } - - match: { responses.1.aggregations.sterms#test_umterms.doc_count_error_upper_bound : 0 } - - match: { responses.2.hits.total: 5 } - - match: { responses.2.aggregations.sterms#test_sterms.doc_count_error_upper_bound : 0 } - - is_true: responses.2.aggregations.sterms#test_sterms.buckets.0.sigsterms#test_umsignificant_terms diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/10_basic.yml deleted file mode 100644 index 87c3e6065bba4..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/10_basic.yml +++ /dev/null @@ -1,57 +0,0 @@ -setup: - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - indices.create: - index: testidx - body: - mappings: - properties: - text: - type : "text" - term_vector : "with_positions_offsets" - - do: - index: - index: testidx - id: testing_document - body: {"text" : "The quick brown fox is brown."} - - - do: - indices.refresh: {} - ---- -"Basic tests for multi termvector get": - - - do: - mtermvectors: - "term_statistics" : true - "body" : - "docs": - - - "_index" : "testidx" - "_id" : "testing_document" - - - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} - - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} - - - do: - mtermvectors: - "term_statistics" : true - "index" : "testidx" - "body" : - "docs": - - - "_id" : "testing_document" - - - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} - - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} - - - do: - mtermvectors: - "term_statistics" : true - "index" : "testidx" - "ids" : ["testing_document"] - - - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} - - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/11_basic_with_types.yml deleted file mode 100644 index 0c037eee9ddd2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/11_basic_with_types.yml +++ /dev/null @@ -1,86 +0,0 @@ -setup: - - do: - indices.create: - include_type_name: true - index: testidx - body: - mappings: - testtype: - properties: - text: - type : "text" - term_vector : "with_positions_offsets" - - do: - index: - index: testidx - type: testtype - id: testing_document - body: {"text" : "The quick brown fox is brown."} - - - do: - indices.refresh: {} - ---- -"Basic tests for multi termvector get": - - - do: - mtermvectors: - "term_statistics" : true - "body" : - "docs": - - - "_index" : "testidx" - "_type" : "testtype" - "_id" : "testing_document" - - - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} - - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} - - - do: - mtermvectors: - "term_statistics" : true - "body" : - "docs": - - - "_index" : "testidx" - "_type" : "testtype" - "_id" : "testing_document" - - - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} - - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} - - - do: - mtermvectors: - "term_statistics" : true - "index" : "testidx" - "body" : - "docs": - - - "_type" : "testtype" - "_id" : "testing_document" - - - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} - - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} - - - do: - mtermvectors: - "term_statistics" : true - "index" : "testidx" - "type" : "testtype" - "body" : - "docs": - - - "_id" : "testing_document" - - - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} - - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} - - - do: - mtermvectors: - "term_statistics" : true - "index" : "testidx" - "type" : "testtype" - "ids" : ["testing_document"] - - - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} - - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/20_deprecated.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/20_deprecated.yml deleted file mode 100644 index 376192680c99b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/20_deprecated.yml +++ /dev/null @@ -1,53 +0,0 @@ -setup: - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - ---- -"Deprecated camel case and _ parameters should fail in Term Vectors query": - - - skip: - version: " - 6.99.99" - reason: camel case and _ parameters (e.g. versionType, _version_type) should fail from 7.0 - features: "warnings" - - - do: - indices.create: - index: testidx - body: - mappings: - properties: - text: - type : "text" - term_vector : "with_positions_offsets" - - - do: - index: - index: testidx - id: testing_document - body: {"text" : "The quick brown fox is brown."} - - - do: - catch: bad_request - mtermvectors: - "term_statistics" : true - "body" : - "docs": - - - "_index" : "testidx" - "_id" : "testing_document" - "version" : 1 - "versionType" : "external" - - - do: - catch: bad_request - mtermvectors: - "term_statistics" : true - "body" : - "docs": - - - "_index" : "testidx" - "_type" : "_doc" - "_id" : "testing_document" - "version" : 1 - "_version_type" : "external" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/21_deprecated_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/21_deprecated_with_types.yml deleted file mode 100644 index b0335498e22a1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/21_deprecated_with_types.yml +++ /dev/null @@ -1,53 +0,0 @@ - ---- -"Deprecated camel case and _ parameters should fail in Term Vectors query": - - - skip: - version: " - 6.99.99" - reason: camel case and _ parameters (e.g. versionType, _version_type) should fail from 7.0 - features: "warnings" - - - do: - indices.create: - include_type_name: true - index: testidx - body: - mappings: - testtype: - properties: - text: - type : "text" - term_vector : "with_positions_offsets" - - - do: - index: - index: testidx - type: testtype - id: testing_document - body: {"text" : "The quick brown fox is brown."} - - - do: - catch: bad_request - mtermvectors: - "term_statistics" : true - "body" : - "docs": - - - "_index" : "testidx" - "_type" : "testtype" - "_id" : "testing_document" - "version" : 1 - "versionType" : "external" - - - do: - catch: bad_request - mtermvectors: - "term_statistics" : true - "body" : - "docs": - - - "_index" : "testidx" - "_type" : "testtype" - "_id" : "testing_document" - "version" : 1 - "_version_type" : "external" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/30_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/30_mix_typeless_typeful.yml deleted file mode 100644 index b14b5f94ebbc2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/mtermvectors/30_mix_typeless_typeful.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -"mtermvectors without types on an index that has types": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type : "text" - term_vector : "with_positions_offsets" - - - do: - index: - index: index - id: 1 - body: { foo: bar } - - - do: - mtermvectors: - body: - docs: - - _index: index - _id: 1 - - - match: {docs.0.term_vectors.foo.terms.bar.term_freq: 1} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/10_basic.yml deleted file mode 100644 index 5821117f4c005..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/10_basic.yml +++ /dev/null @@ -1,13 +0,0 @@ -setup: - - skip: - features: [arbitrary_key] ---- -"node_info test": - - do: - nodes.info: {} - - set: - nodes._arbitrary_key_: node_id - - - is_true: nodes - - is_true: cluster_name - - is_true: nodes.$node_id.roles diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/20_transport.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/20_transport.yml deleted file mode 100644 index 09102157bcb99..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/20_transport.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- - -"node_info test profile is empty": - - skip: - features: [stash_in_path, arbitrary_key] - - - do: - nodes.info: {} - - set: - nodes._arbitrary_key_: node_id - - - do: - nodes.info: - metric: [ transport ] - - - is_true: nodes.$node_id.transport.profiles diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/30_settings.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/30_settings.yml deleted file mode 100644 index 99b8b6f361a47..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.info/30_settings.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -"node_info test flat_settings": - - skip: - features: [arbitrary_key] - - - do: - nodes.info: {} - - set: - nodes._arbitrary_key_: node_id - - - do: - nodes.info: - metric: [ settings ] - - - match : { nodes.$node_id.settings.client.type: node } - - - do: - nodes.info: - metric: [ settings ] - flat_settings: true - - - match : { nodes.$node_id.settings.client\.type: node } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.reload_secure_settings/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.reload_secure_settings/10_basic.yml deleted file mode 100644 index 0a4cf0d64a001..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.reload_secure_settings/10_basic.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -"node_reload_secure_settings test": - - - do: - nodes.reload_secure_settings: {} - - - is_true: nodes - - is_true: cluster_name diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/10_basic.yml deleted file mode 100644 index 099483be9aded..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/10_basic.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -"Nodes stats": - - do: - nodes.stats: - metric: [ indices, transport ] - - - is_true: cluster_name - - is_true: nodes - ---- -"Nodes stats level": - - skip: - features: [arbitrary_key] - - - do: - nodes.info: {} - - set: - nodes._arbitrary_key_: node_id - - - do: - nodes.stats: - metric: [ indices ] - level: "indices" - - - is_true: nodes.$node_id.indices.indices - ---- -"Nodes stats unrecognized parameter": - - do: - catch: bad_request - nodes.stats: - metric: [ transprot ] - - - match: { status: 400 } - - match: { error.type: illegal_argument_exception } - - match: { error.reason: "request [/_nodes/stats/transprot] contains unrecognized metric: [transprot] -> did you mean [transport]?" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml deleted file mode 100644 index a09619b7255c3..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml +++ /dev/null @@ -1,227 +0,0 @@ ---- -"Metric - blank": - - skip: - features: [arbitrary_key] - - do: - nodes.info: {} - - set: - nodes._arbitrary_key_: node_id - - - do: - nodes.stats: {} - - - is_true: nodes.$node_id.indices.docs - - is_true: nodes.$node_id.indices.store - - is_true: nodes.$node_id.indices.indexing - - is_true: nodes.$node_id.indices.get - - is_true: nodes.$node_id.indices.search - - is_true: nodes.$node_id.indices.merges - - is_true: nodes.$node_id.indices.refresh - - is_true: nodes.$node_id.indices.flush - - is_true: nodes.$node_id.indices.warmer - - is_true: nodes.$node_id.indices.query_cache - - is_true: nodes.$node_id.indices.fielddata - - is_true: nodes.$node_id.indices.completion - - is_true: nodes.$node_id.indices.segments - - is_true: nodes.$node_id.indices.translog - - is_true: nodes.$node_id.indices.recovery - ---- -"Metric - _all": - - skip: - features: [arbitrary_key] - - do: - nodes.info: {} - - set: - nodes._arbitrary_key_: node_id - - - do: - nodes.stats: { metric: _all } - - - is_true: nodes.$node_id.indices.docs - - is_true: nodes.$node_id.indices.store - - is_true: nodes.$node_id.indices.indexing - - is_true: nodes.$node_id.indices.get - - is_true: nodes.$node_id.indices.search - - is_true: nodes.$node_id.indices.merges - - is_true: nodes.$node_id.indices.refresh - - is_true: nodes.$node_id.indices.flush - - is_true: nodes.$node_id.indices.warmer - - is_true: nodes.$node_id.indices.query_cache - - is_true: nodes.$node_id.indices.fielddata - - is_true: nodes.$node_id.indices.completion - - is_true: nodes.$node_id.indices.segments - - is_true: nodes.$node_id.indices.translog - - is_true: nodes.$node_id.indices.recovery - ---- -"Metric - indices _all": - - skip: - features: [arbitrary_key] - - do: - nodes.info: {} - - set: - nodes._arbitrary_key_: node_id - - - do: - nodes.stats: { metric: indices, index_metric: _all } - - - is_true: nodes.$node_id.indices.docs - - is_true: nodes.$node_id.indices.store - - is_true: nodes.$node_id.indices.indexing - - is_true: nodes.$node_id.indices.get - - is_true: nodes.$node_id.indices.search - - is_true: nodes.$node_id.indices.merges - - is_true: nodes.$node_id.indices.refresh - - is_true: nodes.$node_id.indices.flush - - is_true: nodes.$node_id.indices.warmer - - is_true: nodes.$node_id.indices.query_cache - - is_true: nodes.$node_id.indices.fielddata - - is_true: nodes.$node_id.indices.completion - - is_true: nodes.$node_id.indices.segments - - is_true: nodes.$node_id.indices.translog - - is_true: nodes.$node_id.indices.recovery - ---- -"Metric - one": - - skip: - features: [arbitrary_key] - - do: - nodes.info: {} - - set: - nodes._arbitrary_key_: node_id - - - do: - nodes.stats: { metric: indices, index_metric: docs } - - - is_true: nodes.$node_id.indices.docs - - is_false: nodes.$node_id.indices.store - - is_false: nodes.$node_id.indices.indexing - - is_false: nodes.$node_id.indices.get - - is_false: nodes.$node_id.indices.search - - is_false: nodes.$node_id.indices.merges - - is_false: nodes.$node_id.indices.refresh - - is_false: nodes.$node_id.indices.flush - - is_false: nodes.$node_id.indices.warmer - - is_false: nodes.$node_id.indices.query_cache - - is_false: nodes.$node_id.indices.fielddata - - is_false: nodes.$node_id.indices.completion - - is_false: nodes.$node_id.indices.segments - - is_false: nodes.$node_id.indices.translog - - is_false: nodes.$node_id.indices.recovery - ---- -"Metric - multi": - - skip: - features: [arbitrary_key] - - do: - nodes.info: {} - - set: - nodes._arbitrary_key_: node_id - - - do: - nodes.stats: { metric: indices, index_metric: [ store, get, merge ] } - - - is_false: nodes.$node_id.indices.docs - - is_true: nodes.$node_id.indices.store - - is_false: nodes.$node_id.indices.indexing - - is_true: nodes.$node_id.indices.get - - is_false: nodes.$node_id.indices.search - - is_true: nodes.$node_id.indices.merges - - is_false: nodes.$node_id.indices.refresh - - is_false: nodes.$node_id.indices.flush - - is_false: nodes.$node_id.indices.warmer - - is_false: nodes.$node_id.indices.query_cache - - is_false: nodes.$node_id.indices.fielddata - - is_false: nodes.$node_id.indices.completion - - is_false: nodes.$node_id.indices.segments - - is_false: nodes.$node_id.indices.translog - - is_false: nodes.$node_id.indices.recovery - - ---- -"Metric - recovery": - - skip: - features: [arbitrary_key] - - do: - nodes.info: {} - - set: - nodes._arbitrary_key_: node_id - - - do: - nodes.stats: { metric: indices, index_metric: [ recovery ] } - - - is_false: nodes.$node_id.indices.docs - - is_false: nodes.$node_id.indices.store - - is_false: nodes.$node_id.indices.indexing - - is_false: nodes.$node_id.indices.get - - is_false: nodes.$node_id.indices.search - - is_false: nodes.$node_id.indices.merges - - is_false: nodes.$node_id.indices.refresh - - is_false: nodes.$node_id.indices.flush - - is_false: nodes.$node_id.indices.warmer - - is_false: nodes.$node_id.indices.query_cache - - is_false: nodes.$node_id.indices.fielddata - - is_false: nodes.$node_id.indices.completion - - is_false: nodes.$node_id.indices.segments - - is_false: nodes.$node_id.indices.translog - - is_true: nodes.$node_id.indices.recovery - ---- -"Metric - _all include_segment_file_sizes": - - skip: - features: [arbitrary_key] - - do: - nodes.info: {} - - set: - nodes._arbitrary_key_: node_id - - - do: - nodes.stats: { metric: indices, index_metric: _all, include_segment_file_sizes: true } - - - is_true: nodes.$node_id.indices.docs - - is_true: nodes.$node_id.indices.store - - is_true: nodes.$node_id.indices.indexing - - is_true: nodes.$node_id.indices.get - - is_true: nodes.$node_id.indices.search - - is_true: nodes.$node_id.indices.merges - - is_true: nodes.$node_id.indices.refresh - - is_true: nodes.$node_id.indices.flush - - is_true: nodes.$node_id.indices.warmer - - is_true: nodes.$node_id.indices.query_cache - - is_true: nodes.$node_id.indices.fielddata - - is_true: nodes.$node_id.indices.completion - - is_true: nodes.$node_id.indices.segments - - is_true: nodes.$node_id.indices.translog - - is_true: nodes.$node_id.indices.recovery - - is_true: nodes.$node_id.indices.segments.file_sizes - ---- -"Metric - segments include_segment_file_sizes": - - skip: - features: [arbitrary_key] - - do: - nodes.info: {} - - set: - nodes._arbitrary_key_: node_id - - - do: - nodes.stats: { metric: indices, index_metric: segments, include_segment_file_sizes: true } - - - is_false: nodes.$node_id.indices.docs - - is_false: nodes.$node_id.indices.store - - is_false: nodes.$node_id.indices.indexing - - is_false: nodes.$node_id.indices.get - - is_false: nodes.$node_id.indices.search - - is_false: nodes.$node_id.indices.merges - - is_false: nodes.$node_id.indices.refresh - - is_false: nodes.$node_id.indices.flush - - is_false: nodes.$node_id.indices.warmer - - is_false: nodes.$node_id.indices.query_cache - - is_false: nodes.$node_id.indices.fielddata - - is_false: nodes.$node_id.indices.completion - - is_true: nodes.$node_id.indices.segments - - is_false: nodes.$node_id.indices.translog - - is_false: nodes.$node_id.indices.recovery - - is_true: nodes.$node_id.indices.segments.file_sizes - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/20_response_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/20_response_filtering.yml deleted file mode 100644 index a478fd7d3f235..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/20_response_filtering.yml +++ /dev/null @@ -1,202 +0,0 @@ ---- -"Nodes Stats with response filtering": - - skip: - features: [arbitrary_key] - - do: - nodes.info: {} - - set: - nodes._arbitrary_key_: node_id - - # Nodes Stats with no filtering - - do: - nodes.stats: {} - - - is_true: cluster_name - - is_true: nodes - - is_true: nodes.$node_id.name - - is_true: nodes.$node_id.indices - - is_true: nodes.$node_id.indices.docs - - gte: { nodes.$node_id.indices.docs.count: 0 } - - is_true: nodes.$node_id.indices.segments - - gte: { nodes.$node_id.indices.segments.count: 0 } - - is_true: nodes.$node_id.jvm - - is_true: nodes.$node_id.jvm.threads - - gte: { nodes.$node_id.jvm.threads.count: 0 } - - is_true: nodes.$node_id.jvm.buffer_pools.direct - - gte: { nodes.$node_id.jvm.buffer_pools.direct.count: 0 } - - gte: { nodes.$node_id.jvm.buffer_pools.direct.used_in_bytes: 0 } - - # Nodes Stats with only "cluster_name" field - - do: - nodes.stats: - filter_path: cluster_name - - - is_true: cluster_name - - is_false: nodes - - is_false: nodes.$node_id.name - - is_false: nodes.$node_id.indices - - is_false: nodes.$node_id.jvm - - # Nodes Stats with "nodes" field and sub-fields - - do: - nodes.stats: - filter_path: nodes.* - - - is_false: cluster_name - - is_true: nodes - - is_true: nodes.$node_id.name - - is_true: nodes.$node_id.indices - - is_true: nodes.$node_id.indices.docs - - gte: { nodes.$node_id.indices.docs.count: 0 } - - is_true: nodes.$node_id.indices.segments - - gte: { nodes.$node_id.indices.segments.count: 0 } - - is_true: nodes.$node_id.jvm - - is_true: nodes.$node_id.jvm.threads - - gte: { nodes.$node_id.jvm.threads.count: 0 } - - is_true: nodes.$node_id.jvm.buffer_pools.direct - - gte: { nodes.$node_id.jvm.buffer_pools.direct.count: 0 } - - gte: { nodes.$node_id.jvm.buffer_pools.direct.used_in_bytes: 0 } - - # Nodes Stats with "nodes.*.indices" field and sub-fields - - do: - nodes.stats: - filter_path: nodes.*.indices - - - is_false: cluster_name - - is_true: nodes - - is_false: nodes.$node_id.name - - is_true: nodes.$node_id.indices - - is_true: nodes.$node_id.indices.docs - - gte: { nodes.$node_id.indices.docs.count: 0 } - - is_true: nodes.$node_id.indices.segments - - gte: { nodes.$node_id.indices.segments.count: 0 } - - is_false: nodes.$node_id.jvm - - # Nodes Stats with "nodes.*.name" and "nodes.*.indices.docs.count" fields - - do: - nodes.stats: - filter_path: [ "nodes.*.name", "nodes.*.indices.docs.count" ] - - - is_false: cluster_name - - is_true: nodes - - is_true: nodes.$node_id.name - - is_true: nodes.$node_id.indices - - is_true: nodes.$node_id.indices.docs - - gte: { nodes.$node_id.indices.docs.count: 0 } - - is_false: nodes.$node_id.indices.segments - - is_false: nodes.$node_id.jvm - - # Nodes Stats with all "count" fields - - do: - nodes.stats: - filter_path: "nodes.**.count" - - - is_false: cluster_name - - is_true: nodes - - is_false: nodes.$node_id.name - - is_true: nodes.$node_id.indices - - is_true: nodes.$node_id.indices.docs - - gte: { nodes.$node_id.indices.docs.count: 0 } - - is_true: nodes.$node_id.indices.segments - - gte: { nodes.$node_id.indices.segments.count: 0 } - - is_true: nodes.$node_id.jvm - - is_true: nodes.$node_id.jvm.threads - - gte: { nodes.$node_id.jvm.threads.count: 0 } - - is_true: nodes.$node_id.jvm.buffer_pools.direct - - gte: { nodes.$node_id.jvm.buffer_pools.direct.count: 0 } - - is_false: nodes.$node_id.jvm.buffer_pools.direct.used_in_bytes - - # Nodes Stats with all "count" fields in sub-fields of "jvm" field - - do: - nodes.stats: - filter_path: "nodes.**.jvm.**.count" - - - is_false: cluster_name - - is_true: nodes - - is_false: nodes.$node_id.name - - is_false: nodes.$node_id.indices - - is_false: nodes.$node_id.indices.docs.count - - is_false: nodes.$node_id.indices.segments.count - - is_true: nodes.$node_id.jvm - - is_true: nodes.$node_id.jvm.threads - - gte: { nodes.$node_id.jvm.threads.count: 0 } - - is_true: nodes.$node_id.jvm.buffer_pools.direct - - gte: { nodes.$node_id.jvm.buffer_pools.direct.count: 0 } - - is_false: nodes.$node_id.jvm.buffer_pools.direct.used_in_bytes - - # Nodes Stats with "nodes.*.fs.data" fields - - do: - nodes.stats: - filter_path: "nodes.*.fs.data" - - - is_false: cluster_name - - is_true: nodes - - is_false: nodes.$node_id.name - - is_false: nodes.$node_id.indices - - is_false: nodes.$node_id.jvm - - is_true: nodes.$node_id.fs.data - - is_true: nodes.$node_id.fs.data.0.path - - is_true: nodes.$node_id.fs.data.0.type - - is_true: nodes.$node_id.fs.data.0.total_in_bytes - - # Nodes Stats with "nodes.*.fs.data.t*" fields - - do: - nodes.stats: - filter_path: "nodes.*.fs.data.t*" - - - is_false: cluster_name - - is_true: nodes - - is_false: nodes.$node_id.name - - is_false: nodes.$node_id.indices - - is_false: nodes.$node_id.jvm - - is_true: nodes.$node_id.fs.data - - is_false: nodes.$node_id.fs.data.0.path - - is_true: nodes.$node_id.fs.data.0.type - - is_true: nodes.$node_id.fs.data.0.total_in_bytes - ---- -"Nodes Stats filtered using both includes and excludes filters": - - skip: - features: [arbitrary_key] - - do: - nodes.info: {} - - set: - nodes._arbitrary_key_: node_id - - # Nodes Stats with "nodes" field but no JVM stats - - do: - nodes.stats: - filter_path: [ "nodes", "-nodes.*.jvm", "-nodes.*.indices" ] - - - is_false: cluster_name - - is_true: nodes - - is_true: nodes.$node_id.name - - is_true: nodes.$node_id.os - - is_false: nodes.$node_id.indices - - is_false: nodes.$node_id.jvm - - # Nodes Stats with "nodes.*.indices" field and sub-fields but no indices segments - - do: - nodes.stats: - filter_path: "nodes.*.indices,-nodes.*.indices.segments" - - - is_false: cluster_name - - is_true: nodes - - is_false: nodes.$node_id.name - - is_true: nodes.$node_id.indices - - is_true: nodes.$node_id.indices.docs - - is_false: nodes.$node_id.indices.segments - - # Nodes Stats with "nodes.*.fs.data.t*" fields but no "type" field - - do: - nodes.stats: - filter_path: "nodes.*.fs.data.t*,-**.type" - - - is_false: cluster_name - - is_true: nodes - - is_false: nodes.$node_id.name - - is_false: nodes.$node_id.indices - - is_false: nodes.$node_id.jvm - - is_true: nodes.$node_id.fs.data - - is_false: nodes.$node_id.fs.data.0.type - - is_true: nodes.$node_id.fs.data.0.total_in_bytes diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/30_discovery.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/30_discovery.yml deleted file mode 100644 index a6b7f29a183c8..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/nodes.stats/30_discovery.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -"Discovery stats": - - skip: - features: [arbitrary_key] - - - do: - nodes.info: - node_id: _master - - set: - nodes._arbitrary_key_: master - - - do: - nodes.stats: - metric: [ discovery ] - - - is_true: cluster_name - - is_true: nodes - - is_true: nodes.$master.name - - is_false: nodes.$master.jvm - - is_true: nodes.$master.discovery - - is_true: nodes.$master.discovery.cluster_state_queue - - is_true: nodes.$master.discovery.published_cluster_states - - gte: { nodes.$master.discovery.published_cluster_states.full_states: 0 } - - gte: { nodes.$master.discovery.published_cluster_states.incompatible_diffs: 0 } - - gte: { nodes.$master.discovery.published_cluster_states.compatible_diffs: 0 } - - is_true: nodes.$master.roles - - - do: - nodes.stats: - filter_path: "nodes.*.discovery" - - - is_false: cluster_name - - is_true: nodes - - is_false: nodes.$master.name - - is_false: nodes.$master.jvm - - is_true: nodes.$master.discovery - - is_true: nodes.$master.discovery.cluster_state_queue - - is_true: nodes.$master.discovery.published_cluster_states - - gte: { nodes.$master.discovery.published_cluster_states.full_states: 0 } - - gte: { nodes.$master.discovery.published_cluster_states.incompatible_diffs: 0 } - - gte: { nodes.$master.discovery.published_cluster_states.compatible_diffs: 0 } - - is_false: nodes.$master.roles diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/ping/10_ping.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/ping/10_ping.yml deleted file mode 100644 index ec07c218dabd9..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/ping/10_ping.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -"Ping": - - do: { ping: {}} - - is_true: '' - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/range/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/range/10_basic.yml deleted file mode 100644 index 20dd6fc614694..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/range/10_basic.yml +++ /dev/null @@ -1,449 +0,0 @@ -setup: - - do: - indices.create: - index: test - body: - settings: - number_of_replicas: 0 - mappings: - "properties": - "integer_range": - "type" : "integer_range" - "long_range": - "type" : "long_range" - "float_range": - "type" : "float_range" - "double_range": - "type" : "double_range" - "date_range": - "type" : "date_range" - "ip_range": - "type" : "ip_range" - ---- -"Integer range": - - - do: - index: - index: test - id: 1 - body: { "integer_range" : { "gte": 1, "lte": 5 } } - - - do: - index: - index: test - id: 2 - body: { "integer_range" : { "gte": 1, "lte": 3 } } - - - do: - index: - index: test - id: 3 - body: { "integer_range" : { "gte": 4, "lte": 5 } } - - - do: - index: - index: test - id: 4 - body: { "integer_range" : null } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "integer_range" : { "gte": 3, "lte" : 4 } } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "query_string" : { "query" : "integer_range:[3 TO 4]" } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "integer_range" : { "gte": 3, "lte" : 4, "relation": "intersects" } } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "integer_range" : { "gte": 3, "lte" : 4, "relation": "contains" } } } } - - - match: { hits.total: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "integer_range" : { "gte": 3, "lte" : 4, "relation": "within" } } } } - - - match: { hits.total: 0 } - - - do: - search: - rest_total_hits_as_int: true - body: { "query" : { "match_all": {} } } - - - match: { hits.total: 4 } - ---- -"Long range": - - - do: - index: - index: test - id: 1 - body: { "long_range" : { "gte": 1, "lte": 5 } } - - - do: - index: - index: test - id: 2 - body: { "long_range" : { "gte": 1, "lte": 3 } } - - - do: - index: - index: test - id: 3 - body: { "long_range" : { "gte": 4, "lte": 5 } } - - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "long_range" : { "gte": 3, "lte" : 4 } } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "query_string" : { "query" : "long_range:[3 TO 4]" } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "long_range" : { "gte": 3, "lte" : 4, "relation": "intersects" } } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "long_range" : { "gte": 3, "lte" : 4, "relation": "contains" } } } } - - - match: { hits.total: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "long_range" : { "gte": 3, "lte" : 4, "relation": "within" } } } } - - - match: { hits.total: 0 } - ---- -"Float range": - - - do: - index: - index: test - id: 1 - body: { "float_range" : { "gte": 1, "lte": 5 } } - - - do: - index: - index: test - id: 2 - body: { "float_range" : { "gte": 1, "lte": 3 } } - - - do: - index: - index: test - id: 3 - body: { "float_range" : { "gte": 4, "lte": 5 } } - - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "float_range" : { "gte": 3, "lte" : 4 } } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "query_string" : { "query" : "float_range:[3 TO 4]" } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "float_range" : { "gte": 3, "lte" : 4, "relation": "intersects" } } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "float_range" : { "gte": 3, "lte" : 4, "relation": "contains" } } } } - - - match: { hits.total: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "float_range" : { "gte": 3, "lte" : 4, "relation": "within" } } } } - - - match: { hits.total: 0 } - ---- -"Double range": - - - do: - index: - index: test - id: 1 - body: { "double_range" : { "gte": 1, "lte": 5 } } - - - do: - index: - index: test - id: 2 - body: { "double_range" : { "gte": 1, "lte": 3 } } - - - do: - index: - index: test - id: 3 - body: { "double_range" : { "gte": 4, "lte": 5 } } - - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "double_range" : { "gte": 3, "lte" : 4 } } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "query_string" : { "query" : "double_range:[3 TO 4]" } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "double_range" : { "gte": 3, "lte" : 4, "relation": "intersects" } } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "double_range" : { "gte": 3, "lte" : 4, "relation": "contains" } } } } - - - match: { hits.total: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "double_range" : { "gte": 3, "lte" : 4, "relation": "within" } } } } - - - match: { hits.total: 0 } - ---- -"IP range": - - - do: - index: - index: test - id: 1 - body: { "ip_range" : { "gte": "192.168.0.1", "lte": "192.168.0.5" } } - - - do: - index: - index: test - id: 2 - body: { "ip_range" : { "gte": "192.168.0.1", "lte": "192.168.0.3" } } - - - do: - index: - index: test - id: 3 - body: { "ip_range" : { "gte": "192.168.0.4", "lte": "192.168.0.5" } } - - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "ip_range" : { "gte": "192.168.0.3", "lte" : "192.168.0.4" } } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "query_string" : { "query" : "ip_range:[192.168.0.3 TO 192.168.0.4]" } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "ip_range" : { "gte": "192.168.0.3", "lte" : "192.168.0.4", "relation": "intersects" } } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "ip_range" : { "gte": "192.168.0.3", "lte" : "192.168.0.4", "relation": "contains" } } } } - - - match: { hits.total: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "ip_range" : { "gte": "192.168.0.3", "lte" : "192.168.0.4", "relation": "within" } } } } - - - match: { hits.total: 0 } - ---- -"Date range": - - - do: - index: - index: test - id: 1 - body: { "date_range" : { "gte": "2017-09-01", "lte": "2017-09-05" } } - - - do: - index: - index: test - id: 2 - body: { "date_range" : { "gte": "2017-09-01", "lte": "2017-09-03" } } - - - do: - index: - index: test - id: 3 - body: { "date_range" : { "gte": "2017-09-04", "lte": "2017-09-05" } } - - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "date_range" : { "gte": "2017-09-03", "lte" : "2017-09-04" } } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "query_string" : { "query" : "date_range:[2017-09-03 TO 2017-09-04]" } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "date_range" : { "gte": "2017-09-03", "lte" : "2017-09-04", "relation": "intersects" } } } } - - - match: { hits.total: 3 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "date_range" : { "gte": "2017-09-03", "lte" : "2017-09-04", "relation": "contains" } } } } - - - match: { hits.total: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "date_range" : { "gte": "2017-09-03", "lte" : "2017-09-04", "relation": "within" } } } } - - - match: { hits.total: 0 } - ---- -"Date range rounding": - - skip: - version: " - 7.6.99" - reason: "This part tests rounding behaviour changed in 7.7" - - - do: - index: - index: test - id: 1 - body: { "date_range" : { "gte": "2019-12-14T12:00:00.000Z", "lte": "2019-12-14T13:00:00.000Z" } } - - - do: - index: - index: test - id: 2 - body: { "date_range" : { "gte": "2019-12-15T12:00:00.000Z", "lte": "2019-12-15T13:00:00.000Z" } } - - - do: - index: - index: test - id: 3 - body: { "date_range" : { "gte": "2019-12-16T12:00:00.000Z", "lte": "2019-12-16T13:00:00.000Z" } } - - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "date_range" : { "gt": "2019-12-15||/d", "relation": "within" } } } } - - - match: { hits.total: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "date_range" : { "gte": "2019-12-15||/d", "relation": "within" } } } } - - - match: { hits.total: 2 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "date_range" : { "lt": "2019-12-15||/d", "relation": "within" } } } } - - - match: { hits.total: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "date_range" : { "lte": "2019-12-15||/d", "relation": "within" } } } } - - - match: { hits.total: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/scripts/20_get_script_context.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/scripts/20_get_script_context.yml deleted file mode 100644 index 64efeb7dfb4ba..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/scripts/20_get_script_context.yml +++ /dev/null @@ -1,10 +0,0 @@ -"Action to get all contexts": - - skip: - version: " - 7.6.0" - reason: "get_all_contexts introduced in 7.6.0" - - do: - get_script_context: {} - - - is_true: contexts.0.name - - is_true: contexts.0.methods.0.return_type - - match: { contexts.0.methods.0.name: "execute" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/scripts/25_get_script_languages.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/scripts/25_get_script_languages.yml deleted file mode 100644 index f4d764324e2dd..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/scripts/25_get_script_languages.yml +++ /dev/null @@ -1,9 +0,0 @@ -"Action to get script languages": - - skip: - version: " - 7.6.0" - reason: "get_script_languages introduced in 7.6.0" - - do: - get_script_languages: {} - - - match: { types_allowed.0: "inline" } - - match: { types_allowed.1: "stored" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/10_basic.yml deleted file mode 100644 index aa6d1e9841dd7..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/10_basic.yml +++ /dev/null @@ -1,345 +0,0 @@ ---- -"Basic scroll": - - do: - indices.create: - index: test_scroll - - do: - index: - index: test_scroll - id: 42 - body: { foo: 1 } - - - do: - index: - index: test_scroll - id: 43 - body: { foo: 2 } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - index: test_scroll - size: 1 - scroll: 1m - sort: foo - body: - query: - match_all: {} - - - set: {_scroll_id: scroll_id} - - match: {hits.total: 2 } - - length: {hits.hits: 1 } - - match: {hits.hits.0._id: "42" } - - - do: - index: - index: test_scroll - id: 44 - body: { foo: 3 } - - - do: - indices.refresh: {} - - - do: - scroll: - rest_total_hits_as_int: true - body: { "scroll_id": "$scroll_id", "scroll": "1m"} - - - match: {hits.total: 2 } - - length: {hits.hits: 1 } - - match: {hits.hits.0._id: "43" } - - - do: - scroll: - rest_total_hits_as_int: true - scroll_id: $scroll_id - scroll: 1m - - - match: {hits.total: 2 } - - length: {hits.hits: 0 } - - - do: - clear_scroll: - scroll_id: $scroll_id - ---- -"Basic scroll with 1 shard": - - do: - indices.create: - index: test_scroll - body: - settings: - index: - number_of_shards: 1 - - - do: - index: - index: test_scroll - id: 42 - body: { foo: 1 } - - - do: - index: - index: test_scroll - id: 43 - body: { foo: 2 } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - index: test_scroll - size: 1 - scroll: 1m - sort: foo - body: - query: - match_all: {} - - - set: {_scroll_id: scroll_id} - - match: {hits.total: 2 } - - length: {hits.hits: 1 } - - match: {hits.hits.0._id: "42" } - - - do: - index: - index: test_scroll - id: 44 - body: { foo: 3 } - - - do: - indices.refresh: {} - - - do: - scroll: - rest_total_hits_as_int: true - body: { "scroll_id": "$scroll_id", "scroll": "1m"} - - - match: {hits.total: 2 } - - length: {hits.hits: 1 } - - match: {hits.hits.0._id: "43" } - - - do: - scroll: - rest_total_hits_as_int: true - scroll_id: $scroll_id - scroll: 1m - - - match: {hits.total: 2 } - - length: {hits.hits: 0 } - - - do: - clear_scroll: - scroll_id: $scroll_id - ---- -"Body params override query string": - - do: - indices.create: - index: test_scroll - - do: - index: - index: test_scroll - id: 42 - body: { foo: 1 } - - - do: - index: - index: test_scroll - id: 43 - body: { foo: 2 } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - index: test_scroll - size: 1 - scroll: 1m - sort: foo - body: - query: - match_all: {} - - - set: {_scroll_id: scroll_id} - - match: {hits.total: 2 } - - length: {hits.hits: 1 } - - match: {hits.hits.0._id: "42" } - - - do: - index: - index: test_scroll - id: 44 - body: { foo: 3 } - - - do: - indices.refresh: {} - - - do: - scroll: - rest_total_hits_as_int: true - scroll_id: invalid_scroll_id - body: { "scroll_id": "$scroll_id", "scroll": "1m"} - - - match: {hits.total: 2 } - - length: {hits.hits: 1 } - - match: {hits.hits.0._id: "43" } - - - do: - clear_scroll: - scroll_id: $scroll_id - ---- -"Scroll cannot used the request cache": - - skip: - version: " - 6.99.99" - reason: the error message has been added in v7.0.0 - - do: - indices.create: - index: test_scroll - - do: - catch: /\[request_cache\] cannot be used in a scroll context/ - search: - rest_total_hits_as_int: true - index: test_scroll - scroll: 1m - request_cache: true - body: - query: - match_all: {} - ---- -"Scroll with size 0": - - skip: - version: " - 6.1.99" - reason: the error message has been added in v6.2.0 - - do: - indices.create: - index: test_scroll - - do: - catch: /\[size\] cannot be \[0\] in a scroll context/ - search: - rest_total_hits_as_int: true - index: test_scroll - scroll: 1m - request_cache: true - body: - query: - match_all: {} - size: 0 - ---- -"Scroll max_score is null": - - skip: - version: " - 6.99.99" - reason: max_score was set to 0 rather than null before 7.0 - - - do: - indices.create: - index: test_scroll - - do: - index: - index: test_scroll - id: 42 - body: { foo: 1 } - - - do: - index: - index: test_scroll - id: 43 - body: { foo: 2 } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - index: test_scroll - size: 1 - scroll: 1m - sort: foo - body: - query: - match_all: {} - - - set: {_scroll_id: scroll_id} - - length: {hits.hits: 1 } - - match: { hits.max_score: null } - - - do: - scroll: - rest_total_hits_as_int: true - scroll_id: $scroll_id - scroll: 1m - - - length: {hits.hits: 1 } - - match: { hits.max_score: null } - ---- -"Scroll with new response format": - - skip: - version: " - 6.9.99" - reason: hits.total is returned as an object in 7.0.0 - - do: - indices.create: - index: test_scroll - - do: - index: - index: test_scroll - id: 42 - body: { foo: 1 } - - - do: - index: - index: test_scroll - id: 43 - body: { foo: 2 } - - - do: - indices.refresh: {} - - - do: - search: - index: test_scroll - size: 1 - scroll: 1m - sort: foo - body: - query: - match_all: {} - - - set: {_scroll_id: scroll_id} - - match: {hits.total.value: 2 } - - match: {hits.total.relation: eq } - - length: {hits.hits: 1 } - - match: {hits.hits.0._id: "42" } - - - do: - scroll: - body: { "scroll_id": "$scroll_id", "scroll": "1m"} - - - match: {hits.total.value: 2 } - - match: {hits.total.relation: eq } - - length: {hits.hits: 1 } - - match: {hits.hits.0._id: "43" } - - - do: - scroll: - scroll_id: $scroll_id - scroll: 1m - - - match: {hits.total.value: 2 } - - match: {hits.total.relation: eq } - - length: {hits.hits: 0 } - - - do: - clear_scroll: - scroll_id: $scroll_id diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/11_clear.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/11_clear.yml deleted file mode 100644 index 97a13dd0c2c5f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/11_clear.yml +++ /dev/null @@ -1,121 +0,0 @@ ---- -"Clear scroll": - - do: - indices.create: - index: test_scroll - - do: - index: - index: test_scroll - id: 42 - body: { foo: bar } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - index: test_scroll - scroll: 1m - body: - query: - match_all: {} - - - set: {_scroll_id: scroll_id1} - - - do: - clear_scroll: - scroll_id: $scroll_id1 - - - do: - catch: missing - scroll: - rest_total_hits_as_int: true - scroll_id: $scroll_id1 - - - do: - catch: missing - clear_scroll: - scroll_id: $scroll_id1 - ---- -"Body params with array param override query string": - - do: - indices.create: - index: test_scroll - - do: - index: - index: test_scroll - id: 42 - body: { foo: bar } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - index: test_scroll - scroll: 1m - body: - query: - match_all: {} - - - set: {_scroll_id: scroll_id1} - - - do: - clear_scroll: - scroll_id: "invalid_scroll_id" - body: { "scroll_id": [ "$scroll_id1" ]} - - - do: - catch: missing - scroll: - rest_total_hits_as_int: true - scroll_id: $scroll_id1 - - - do: - catch: missing - clear_scroll: - scroll_id: $scroll_id1 - ---- -"Body params with string param scroll id override query string": - - do: - indices.create: - index: test_scroll - - do: - index: - index: test_scroll - id: 42 - body: { foo: bar } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - index: test_scroll - scroll: 1m - body: - query: - match_all: {} - - - set: {_scroll_id: scroll_id1} - - - do: - clear_scroll: - scroll_id: "invalid_scroll_id" - body: { "scroll_id": "$scroll_id1" } - - - do: - catch: missing - scroll: - rest_total_hits_as_int: true - scroll_id: $scroll_id1 - - - do: - catch: missing - clear_scroll: - scroll_id: $scroll_id1 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/12_slices.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/12_slices.yml deleted file mode 100644 index f655b43b98949..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/12_slices.yml +++ /dev/null @@ -1,147 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test_sliced_scroll - body: - settings: - number_of_shards: 5 - number_of_routing_shards: 5 - - - do: - index: - index: test_sliced_scroll - id: 1 - body: { foo: 1 } - - - do: - index: - index: test_sliced_scroll - id: 2 - body: { foo: 2 } - - - do: - index: - index: test_sliced_scroll - id: 3 - body: { foo: 3 } - - - do: - index: - index: test_sliced_scroll - id: 4 - body: { foo: 4 } - - - do: - indices.refresh: {} - ---- -"Sliced scroll": - - do: - search: - rest_total_hits_as_int: true - index: test_sliced_scroll - scroll: 1m - sort: foo - body: - slice: - id: 0 - max: 2 - query: - match_all: {} - - - set: {_scroll_id: scroll_id} - - match: {hits.total: 3 } - - length: {hits.hits: 3 } - - match: {hits.hits.0._id: "2" } - - match: {hits.hits.1._id: "3" } - - match: {hits.hits.2._id: "4" } - - - do: - scroll: - rest_total_hits_as_int: true - scroll_id: $scroll_id - scroll: 1m - - - match: {hits.total: 3 } - - length: {hits.hits: 0 } - - - do: - clear_scroll: - scroll_id: $scroll_id - - - do: - search: - rest_total_hits_as_int: true - index: test_sliced_scroll - scroll: 1m - sort: foo - body: - slice: - id: 1 - max: 2 - query: - match_all: {} - - - set: {_scroll_id: scroll_id} - - match: {hits.total: 1 } - - length: {hits.hits: 1 } - - match: {hits.hits.0._id: "1" } - - - do: - scroll: - rest_total_hits_as_int: true - scroll_id: $scroll_id - scroll: 1m - - - match: {hits.total: 1 } - - length: {hits.hits: 0 } - - - do: - clear_scroll: - scroll_id: $scroll_id - ---- -"Sliced scroll with invalid arguments": - - skip: - version: " - 6.99.99" - reason: Prior versions return 500 rather than 404 - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - index: test_sliced_scroll - size: 1 - scroll: 1m - body: - slice: - id: 0 - max: 1025 - query: - match_all: {} - - - do: - indices.put_settings: - index: test_sliced_scroll - body: - index.max_slices_per_scroll: 1025 - - - do: - search: - rest_total_hits_as_int: true - index: test_sliced_scroll - size: 1 - scroll: 1m - body: - slice: - id: 0 - max: 1025 - query: - match_all: {} - - - set: {_scroll_id: scroll_id} - - - do: - clear_scroll: - scroll_id: $scroll_id diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/20_keep_alive.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/20_keep_alive.yml deleted file mode 100644 index 6217f66c2648e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/scroll/20_keep_alive.yml +++ /dev/null @@ -1,71 +0,0 @@ ---- - teardown: - - - do: - cluster.put_settings: - body: - transient: - search.max_keep_alive: null - search.default_keep_alive: null - ---- -"Max keep alive": - - skip: - version: " - 6.99.99" - reason: search.max_keep_alive was added in 7.0.0 - - - do: - index: - index: test_scroll - id: 1 - body: { foo: 1 } - - - do: - index: - index: test_scroll - id: 2 - body: { foo: 1 } - - - do: - indices.refresh: {} - - - do: - cluster.put_settings: - body: - transient: - search.default_keep_alive: "1m" - search.max_keep_alive: "1m" - - - do: - catch: /.*Keep alive for scroll.*is too large.*/ - search: - rest_total_hits_as_int: true - index: test_scroll - size: 1 - scroll: 2m - sort: foo - body: - query: - match_all: {} - - - do: - search: - rest_total_hits_as_int: true - index: test_scroll - size: 1 - scroll: 1m - sort: foo - body: - query: - match_all: {} - - - set: {_scroll_id: scroll_id} - - match: {hits.total: 2 } - - length: {hits.hits: 1 } - - - do: - catch: /.*Keep alive for scroll.*is too large.*/ - scroll: - rest_total_hits_as_int: true - scroll_id: $scroll_id - scroll: 3m diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/100_avg_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/100_avg_metric.yml deleted file mode 100644 index 0e57bb9abd667..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/100_avg_metric.yml +++ /dev/null @@ -1,177 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - int_field: - type : integer - double_field: - type : double - string_field: - type: keyword - - - do: - bulk: - refresh: true - body: - - index: - _index: test_1 - _id: 1 - - int_field: 1 - double_field: 1.0 - string_field: foo - - index: - _index: test_1 - _id: 2 - - int_field: 51 - double_field: 51.0 - string_field: foo - - index: - _index: test_1 - _id: 3 - - int_field: 101 - double_field: 101.0 - string_field: foo - - index: - _index: test_1 - _id: 4 - - int_field: 151 - double_field: 151.0 - string_field: foo - ---- -"Basic test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_avg: - avg: - field: int_field - the_double_avg: - avg: - field: double_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_avg.value: 76.0 } - - match: { aggregations.the_double_avg.value: 76.0 } - ---- -"Only aggs test": - - - do: - search: - rest_total_hits_as_int: true - body: - size: 0 - aggs: - the_int_avg: - avg: - field: int_field - the_double_avg: - avg: - field: double_field - - - match: { hits.total: 4 } - - length: { hits.hits: 0 } - - match: { aggregations.the_int_avg.value: 76.0 } - - match: { aggregations.the_double_avg.value: 76.0 } - ---- -"Filtered test": - - - do: - search: - rest_total_hits_as_int: true - body: - query: - constant_score: - filter: - range: - int_field: - gte: 50 - aggs: - the_int_avg: - avg: - field: int_field - the_double_avg: - avg: - field: double_field - - - match: { hits.total: 3 } - - length: { hits.hits: 3 } - - match: { aggregations.the_int_avg.value: 101.0 } - - match: { aggregations.the_double_avg.value: 101.0 } - - ---- -"Missing field with missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_missing_avg: - avg: - field: foo - missing: 1 - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_missing_avg.value: 1 } - ---- -"Missing field without missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_missing_avg: - avg: - field: foo - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - is_false: aggregations.the_missing_avg.value - ---- -"Metadata test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_avg: - meta: - foo: bar - avg: - field: int_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_avg.value: 76.0 } - - match: { aggregations.the_int_avg.meta.foo: "bar" } - ---- -"Aggregating wrong datatype test": - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - body: - aggs: - the_string_avg: - avg: - field: string_field diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/10_histogram.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/10_histogram.yml deleted file mode 100644 index 694335b6677f5..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/10_histogram.yml +++ /dev/null @@ -1,492 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - number: - type: integer - date: - type: date - - do: - cluster.health: - wait_for_status: green - ---- -"Basic test": - - do: - index: - index: test_1 - id: 1 - body: { "number" : 1 } - - - do: - index: - index: test_1 - id: 2 - body: { "number" : 51 } - - - do: - index: - index: test_1 - id: 3 - body: { "number" : 101 } - - - do: - index: - index: test_1 - id: 4 - body: { "number" : 151 } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "aggs" : { "histo" : { "histogram" : { "field" : "number", "interval" : 50 } } } } - - - match: { hits.total: 4 } - - - length: { aggregations.histo.buckets: 4 } - - - match: { aggregations.histo.buckets.0.key: 0 } - - - is_false: aggregations.histo.buckets.0.key_as_string - - - match: { aggregations.histo.buckets.0.doc_count: 1 } - - - match: { aggregations.histo.buckets.1.key: 50 } - - - is_false: aggregations.histo.buckets.1.key_as_string - - - match: { aggregations.histo.buckets.1.doc_count: 1 } - - - match: { aggregations.histo.buckets.2.key: 100 } - - - is_false: aggregations.histo.buckets.2.key_as_string - - - match: { aggregations.histo.buckets.2.doc_count: 1 } - - - match: { aggregations.histo.buckets.3.key: 150 } - - - is_false: aggregations.histo.buckets.3.key_as_string - - - match: { aggregations.histo.buckets.3.doc_count: 1 } - ---- -"Format test": - - do: - index: - index: test_1 - id: 1 - body: { "number" : 1 } - - - do: - index: - index: test_1 - id: 2 - body: { "number" : 51 } - - - do: - index: - index: test_1 - id: 3 - body: { "number" : 101 } - - - do: - index: - index: test_1 - id: 4 - body: { "number" : 151 } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "aggs" : { "histo" : { "histogram" : { "field" : "number", "interval" : 50, "format" : "Value is ##0.0" } } } } - - - match: { hits.total: 4 } - - - length: { aggregations.histo.buckets: 4 } - - - match: { aggregations.histo.buckets.0.key: 0 } - - - match: { aggregations.histo.buckets.0.key_as_string: "Value is 0.0" } - - - match: { aggregations.histo.buckets.0.doc_count: 1 } - - - match: { aggregations.histo.buckets.1.key: 50 } - - - match: { aggregations.histo.buckets.1.key_as_string: "Value is 50.0" } - - - match: { aggregations.histo.buckets.1.doc_count: 1 } - - - match: { aggregations.histo.buckets.2.key: 100 } - - - match: { aggregations.histo.buckets.2.key_as_string: "Value is 100.0" } - - - match: { aggregations.histo.buckets.2.doc_count: 1 } - - - match: { aggregations.histo.buckets.3.key: 150 } - - - match: { aggregations.histo.buckets.3.key_as_string: "Value is 150.0" } - - - match: { aggregations.histo.buckets.3.doc_count: 1 } - ---- -"Deprecated _time order": - - - skip: - version: " - 7.1.99" - reason: _time order deprecated in 6.0, replaced by _key. Calendar_interval added in 7.2 - features: "warnings" - - - do: - index: - index: test_1 - id: 1 - body: { "date" : "2016-01-01" } - - - do: - index: - index: test_1 - id: 2 - body: { "date" : "2016-01-02" } - - - do: - index: - index: test_1 - id: 3 - body: { "date" : "2016-02-01" } - - - do: - index: - index: test_1 - id: 4 - body: { "date" : "2016-03-01" } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "aggs" : { "histo" : { "date_histogram" : { "field" : "date", "calendar_interval" : "month", "order" : { "_time" : "desc" } } } } } - warnings: - - "Deprecated aggregation order key [_time] used, replaced by [_key]" - - - match: { hits.total: 4 } - - - length: { aggregations.histo.buckets: 3 } - - - match: { aggregations.histo.buckets.0.key_as_string: "2016-03-01T00:00:00.000Z" } - - - match: { aggregations.histo.buckets.0.doc_count: 1 } - - - match: { aggregations.histo.buckets.1.key_as_string: "2016-02-01T00:00:00.000Z" } - - - match: { aggregations.histo.buckets.1.doc_count: 1 } - - - match: { aggregations.histo.buckets.2.key_as_string: "2016-01-01T00:00:00.000Z" } - - - match: { aggregations.histo.buckets.2.doc_count: 2 } - ---- -"date_histogram": - - skip: - version: " - 7.1.99" - reason: calendar_interval introduced in 7.2.0 - - - do: - indices.create: - index: test_2 - body: - settings: - # There was a BWC issue that only showed up on empty shards. This - # test has 4 docs and 5 shards makes sure we get one empty. - number_of_shards: 5 - mappings: - properties: - date: - type: date - fields: - nanos: - type: date_nanos - - - do: - bulk: - index: test_2 - refresh: true - body: - - '{"index": {}}' - - '{"date": "2016-01-01"}' - - '{"index": {}}' - - '{"date": "2016-01-02"}' - - '{"index": {}}' - - '{"date": "2016-02-01"}' - - '{"index": {}}' - - '{"date": "2016-03-01"}' - - - do: - search: - body: - size: 0 - aggs: - histo: - date_histogram: - field: date - calendar_interval: month - - match: { hits.total.value: 4 } - - length: { aggregations.histo.buckets: 3 } - - match: { aggregations.histo.buckets.0.key_as_string: "2016-01-01T00:00:00.000Z" } - - match: { aggregations.histo.buckets.0.doc_count: 2 } - - match: { aggregations.histo.buckets.1.key_as_string: "2016-02-01T00:00:00.000Z" } - - match: { aggregations.histo.buckets.1.doc_count: 1 } - - match: { aggregations.histo.buckets.2.key_as_string: "2016-03-01T00:00:00.000Z" } - - match: { aggregations.histo.buckets.2.doc_count: 1 } - - - do: - search: - body: - size: 0 - aggs: - histo: - date_histogram: - field: date.nanos - calendar_interval: month - - match: { hits.total.value: 4 } - - length: { aggregations.histo.buckets: 3 } - - match: { aggregations.histo.buckets.0.key_as_string: "2016-01-01T00:00:00.000Z" } - - match: { aggregations.histo.buckets.0.doc_count: 2 } - - match: { aggregations.histo.buckets.1.key_as_string: "2016-02-01T00:00:00.000Z" } - - match: { aggregations.histo.buckets.1.doc_count: 1 } - - match: { aggregations.histo.buckets.2.key_as_string: "2016-03-01T00:00:00.000Z" } - - match: { aggregations.histo.buckets.2.doc_count: 1 } - ---- -"date_histogram with offset": - - skip: - version: "all" - reason: "AwaitsFix https://github.com/elastic/elasticsearch/issues/51525" - # When fixed, reinstate these lines - #version: " - 7.1.99" - #reason: calendar_interval introduced in 7.2.0 - - - do: - indices.create: - index: test_2 - body: - settings: - # There was a BWC issue that only showed up on empty shards. This - # test has 4 docs and 5 shards makes sure we get one empty. - number_of_shards: 5 - mappings: - properties: - date: - type : date - - - do: - bulk: - index: test_2 - refresh: true - body: - - '{"index": {}}' - - '{"date": "2016-01-01"}' - - '{"index": {}}' - - '{"date": "2016-01-02"}' - - '{"index": {}}' - - '{"date": "2016-02-01"}' - - '{"index": {}}' - - '{"date": "2016-03-01"}' - - - do: - search: - body: - size: 0 - aggs: - histo: - date_histogram: - field: date - calendar_interval: month - offset: +1d - - - match: { hits.total.value: 4 } - - length: { aggregations.histo.buckets: 3 } - - match: { aggregations.histo.buckets.0.key_as_string: "2015-12-02T00:00:00.000Z" } - - match: { aggregations.histo.buckets.0.doc_count: 1 } - - match: { aggregations.histo.buckets.1.key_as_string: "2016-01-02T00:00:00.000Z" } - - match: { aggregations.histo.buckets.1.doc_count: 2 } - - match: { aggregations.histo.buckets.2.key_as_string: "2016-02-02T00:00:00.000Z" } - - match: { aggregations.histo.buckets.2.doc_count: 1 } - - ---- -"date_histogram on range": - - skip: - version: " - 7.4.1" - reason: doc values on ranges implemented in 7.4.1 - - - do: - indices.create: - index: test_2 - body: - settings: - # There was a BWC issue that only showed up on empty shards. This - # test has 4 docs and 5 shards makes sure we get one empty. - number_of_shards: 5 - mappings: - properties: - range: - type : date_range - - - do: - bulk: - index: test_2 - refresh: true - body: - - '{"index": {}}' - - '{"range": {"gte": "2016-01-01", "lt": "2016-01-02"}}' - - '{"index": {}}' - - '{"range": {"gte": "2016-01-02", "lt": "2016-01-03"}}' - - '{"index": {}}' - - '{"range": {"gte": "2016-02-01", "lt": "2016-02-02"}}' - - '{"index": {}}' - - '{"range": {"gte": "2016-03-01", "lt": "2016-03-02"}}' - - - do: - search: - body: - size: 0 - aggs: - histo: - date_histogram: - field: range - calendar_interval: month - - - match: { hits.total.value: 4 } - - length: { aggregations.histo.buckets: 3 } - - match: { aggregations.histo.buckets.0.key_as_string: "2016-01-01T00:00:00.000Z" } - - match: { aggregations.histo.buckets.0.doc_count: 2 } - - match: { aggregations.histo.buckets.1.key_as_string: "2016-02-01T00:00:00.000Z" } - - match: { aggregations.histo.buckets.1.doc_count: 1 } - - match: { aggregations.histo.buckets.2.key_as_string: "2016-03-01T00:00:00.000Z" } - - match: { aggregations.histo.buckets.2.doc_count: 1 } - ---- -"date_histogram on range with offset": - - skip: - version: " - 7.4.1" - reason: doc values on ranges implemented in 7.4.1 - - - do: - indices.create: - index: test_2 - body: - settings: - # There was a BWC issue that only showed up on empty shards. This - # test has 4 docs and 5 shards makes sure we get one empty. - number_of_shards: 5 - mappings: - properties: - range: - type : date_range - - - do: - bulk: - index: test_2 - refresh: true - body: - - '{"index": {}}' - - '{"range": {"gte": "2016-01-01", "lt": "2016-01-02"}}' - - '{"index": {}}' - - '{"range": {"gte": "2016-01-02", "lt": "2016-01-03"}}' - - '{"index": {}}' - - '{"range": {"gte": "2016-02-01", "lt": "2016-02-02"}}' - - '{"index": {}}' - - '{"range": {"gte": "2016-03-01", "lt": "2016-03-02"}}' - - - do: - search: - body: - size: 0 - aggs: - histo: - date_histogram: - field: range - calendar_interval: month - offset: +1d - - - match: { hits.total.value: 4 } - - length: { aggregations.histo.buckets: 3 } - - match: { aggregations.histo.buckets.0.key_as_string: "2015-12-02T00:00:00.000Z" } - - match: { aggregations.histo.buckets.0.doc_count: 1 } - - match: { aggregations.histo.buckets.1.key_as_string: "2016-01-02T00:00:00.000Z" } - - match: { aggregations.histo.buckets.1.doc_count: 2 } - - match: { aggregations.histo.buckets.2.key_as_string: "2016-02-02T00:00:00.000Z" } - - match: { aggregations.histo.buckets.2.doc_count: 1 } - ---- -"date_histogram with pre-epoch daylight savings time transition": - - skip: - version: " - 7.6.1" - reason: bug fixed in 7.6.1. - # Add date_nanos to the mapping. We couldn't do it during setup because that - # is run against 6.8 which doesn't have date_nanos - - do: - indices.put_mapping: - index: test_1 - body: - properties: - number: - type: integer - date: - type: date - fields: - nanos: - type: date_nanos - - - do: - bulk: - index: test_1 - refresh: true - body: - - '{"index": {}}' - - '{"date": "2016-01-01"}' - - - do: - search: - body: - size: 0 - aggs: - histo: - date_histogram: - field: date - fixed_interval: 1ms - time_zone: America/Phoenix - - - match: { hits.total.value: 1 } - - length: { aggregations.histo.buckets: 1 } - - match: { aggregations.histo.buckets.0.key_as_string: "2015-12-31T17:00:00.000-07:00" } - - match: { aggregations.histo.buckets.0.doc_count: 1 } - - - do: - search: - body: - size: 0 - aggs: - histo: - date_histogram: - field: date.nanos - fixed_interval: 1ms - time_zone: America/Phoenix - - - match: { hits.total.value: 1 } - - length: { aggregations.histo.buckets: 1 } - - match: { aggregations.histo.buckets.0.key_as_string: "2015-12-31T17:00:00.000-07:00" } - - match: { aggregations.histo.buckets.0.doc_count: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/110_max_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/110_max_metric.yml deleted file mode 100644 index 4235679746115..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/110_max_metric.yml +++ /dev/null @@ -1,177 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - int_field: - type : integer - double_field: - type : double - string_field: - type: keyword - - - do: - bulk: - refresh: true - body: - - index: - _index: test_1 - _id: 1 - - int_field: 1 - double_field: 1.0 - string_field: foo - - index: - _index: test_1 - _id: 2 - - int_field: 51 - double_field: 51.0 - string_field: foo - - index: - _index: test_1 - _id: 3 - - int_field: 101 - double_field: 101.0 - string_field: foo - - index: - _index: test_1 - _id: 4 - - int_field: 151 - double_field: 151.0 - string_field: foo - ---- -"Basic test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_max: - max: - field: int_field - the_double_max: - max: - field: double_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_max.value: 151.0 } - - match: { aggregations.the_double_max.value: 151.0 } - ---- -"Only aggs test": - - - do: - search: - rest_total_hits_as_int: true - body: - size: 0 - aggs: - the_int_max: - max: - field: int_field - the_double_max: - max: - field: double_field - - - match: { hits.total: 4 } - - length: { hits.hits: 0 } - - match: { aggregations.the_int_max.value: 151.0 } - - match: { aggregations.the_double_max.value: 151.0 } - ---- -"Filtered test": - - - do: - search: - rest_total_hits_as_int: true - body: - query: - constant_score: - filter: - range: - int_field: - lte: 60 - aggs: - the_int_max: - max: - field: int_field - the_double_max: - max: - field: double_field - - - match: { hits.total: 2 } - - length: { hits.hits: 2 } - - match: { aggregations.the_int_max.value: 51.0 } - - match: { aggregations.the_double_max.value: 51.0 } - - ---- -"Missing field with missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_missing_max: - max: - field: foo - missing: 1 - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_missing_max.value: 1 } - ---- -"Missing field without missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_missing_max: - max: - field: foo - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - is_false: aggregations.the_missing_max.value - ---- -"Metadata test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_max: - meta: - foo: bar - max: - field: int_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_max.value: 151.0 } - - match: { aggregations.the_int_max.meta.foo: "bar" } - ---- -"Aggregating wrong datatype test": - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - body: - aggs: - the_string_avg: - avg: - field: string_field diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/120_min_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/120_min_metric.yml deleted file mode 100644 index eb68357258507..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/120_min_metric.yml +++ /dev/null @@ -1,177 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - int_field: - type : integer - double_field: - type : double - string_field: - type: keyword - - - do: - bulk: - refresh: true - body: - - index: - _index: test_1 - _id: 1 - - int_field: 1 - double_field: 1.0 - string_field: foo - - index: - _index: test_1 - _id: 2 - - int_field: 51 - double_field: 51.0 - string_field: foo - - index: - _index: test_1 - _id: 3 - - int_field: 101 - double_field: 101.0 - string_field: foo - - index: - _index: test_1 - _id: 4 - - int_field: 151 - double_field: 151.0 - string_field: foo - ---- -"Basic test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_min: - min: - field: int_field - the_double_min: - min: - field: double_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_min.value: 1.0 } - - match: { aggregations.the_double_min.value: 1.0 } - ---- -"Only aggs test": - - - do: - search: - rest_total_hits_as_int: true - body: - size: 0 - aggs: - the_int_min: - min: - field: int_field - the_double_min: - min: - field: double_field - - - match: { hits.total: 4 } - - length: { hits.hits: 0 } - - match: { aggregations.the_int_min.value: 1.0 } - - match: { aggregations.the_double_min.value: 1.0 } - ---- -"Filtered test": - - - do: - search: - rest_total_hits_as_int: true - body: - query: - constant_score: - filter: - range: - int_field: - gte: 50 - aggs: - the_int_min: - min: - field: int_field - the_double_min: - min: - field: double_field - - - match: { hits.total: 3 } - - length: { hits.hits: 3 } - - match: { aggregations.the_int_min.value: 51.0 } - - match: { aggregations.the_double_min.value: 51.0 } - - ---- -"Missing field with missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_missing_min: - min: - field: foo - missing: 1 - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_missing_min.value: 1.0 } - ---- -"Missing field without missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_missing_min: - min: - field: foo - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - is_false: aggregations.the_missing_min.value - ---- -"Metadata test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_min: - meta: - foo: bar - min: - field: int_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_min.value: 1.0 } - - match: { aggregations.the_int_min.meta.foo: "bar" } - ---- -"Aggregating wrong datatype test": - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - body: - aggs: - the_string_min: - min: - field: string_field diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/130_sum_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/130_sum_metric.yml deleted file mode 100644 index 3221543276115..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/130_sum_metric.yml +++ /dev/null @@ -1,177 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - int_field: - type : integer - double_field: - type : double - string_field: - type: keyword - - - do: - bulk: - refresh: true - body: - - index: - _index: test_1 - _id: 1 - - int_field: 1 - double_field: 1.0 - string_field: foo - - index: - _index: test_1 - _id: 2 - - int_field: 51 - double_field: 51.0 - string_field: foo - - index: - _index: test_1 - _id: 3 - - int_field: 101 - double_field: 101.0 - string_field: foo - - index: - _index: test_1 - _id: 4 - - int_field: 151 - double_field: 151.0 - string_field: foo - ---- -"Basic test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_sum: - sum: - field: int_field - the_double_sum: - sum: - field: double_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_sum.value: 304.0 } - - match: { aggregations.the_double_sum.value: 304.0 } - ---- -"Only aggs test": - - - do: - search: - rest_total_hits_as_int: true - body: - size: 0 - aggs: - the_int_sum: - sum: - field: int_field - the_double_sum: - sum: - field: double_field - - - match: { hits.total: 4 } - - length: { hits.hits: 0 } - - match: { aggregations.the_int_sum.value: 304.0 } - - match: { aggregations.the_double_sum.value: 304.0 } - ---- -"Filtered test": - - - do: - search: - rest_total_hits_as_int: true - body: - query: - constant_score: - filter: - range: - int_field: - gte: 50 - aggs: - the_int_sum: - sum: - field: int_field - the_double_sum: - sum: - field: double_field - - - match: { hits.total: 3 } - - length: { hits.hits: 3 } - - match: { aggregations.the_int_sum.value: 303.0 } - - match: { aggregations.the_double_sum.value: 303.0 } - - ---- -"Missing field with missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_missing_sum: - sum: - field: foo - missing: 1 - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_missing_sum.value: 4.0 } - ---- -"Missing field without missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_missing_sum: - sum: - field: foo - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_missing_sum.value: 0.0 } - ---- -"Metadata test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_sum: - meta: - foo: bar - sum: - field: int_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_sum.value: 304.0 } - - match: { aggregations.the_int_sum.meta.foo: "bar" } - ---- -"Aggregating wrong datatype test": - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - body: - aggs: - the_string_sum: - sum: - field: string_field diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/140_value_count_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/140_value_count_metric.yml deleted file mode 100644 index b5ac7d2e5db01..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/140_value_count_metric.yml +++ /dev/null @@ -1,176 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - int_field: - type : integer - double_field: - type : double - string_field: - type: keyword - - - do: - bulk: - refresh: true - body: - - index: - _index: test_1 - _id: 1 - - int_field: 1 - double_field: 1.0 - string_field: foo - - index: - _index: test_1 - _id: 2 - - int_field: 51 - double_field: 51.0 - string_field: foo - - index: - _index: test_1 - _id: 3 - - int_field: 101 - double_field: 101.0 - string_field: foo - - index: - _index: test_1 - _id: 4 - - int_field: 151 - double_field: 151.0 - string_field: foo - ---- -"Basic test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_value_count: - value_count: - field: int_field - the_double_value_count: - value_count: - field: double_field - the_string_value_count: - value_count: - field: string_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_value_count.value: 4 } - - match: { aggregations.the_double_value_count.value: 4 } - - match: { aggregations.the_string_value_count.value: 4 } - ---- -"Only aggs test": - - - do: - search: - rest_total_hits_as_int: true - body: - size: 0 - aggs: - the_int_value_count: - value_count: - field: int_field - the_double_value_count: - value_count: - field: double_field - the_string_value_count: - value_count: - field: string_field - - - match: { hits.total: 4 } - - length: { hits.hits: 0 } - - match: { aggregations.the_int_value_count.value: 4 } - - match: { aggregations.the_double_value_count.value: 4 } - - match: { aggregations.the_string_value_count.value: 4 } - ---- -"Filtered test": - - - do: - search: - rest_total_hits_as_int: true - body: - query: - constant_score: - filter: - range: - int_field: - gte: 50 - aggs: - the_int_value_count: - value_count: - field: int_field - the_double_value_count: - value_count: - field: double_field - the_string_value_count: - value_count: - field: string_field - - - match: { hits.total: 3 } - - length: { hits.hits: 3 } - - match: { aggregations.the_int_value_count.value: 3 } - - match: { aggregations.the_double_value_count.value: 3 } - - match: { aggregations.the_string_value_count.value: 3 } - - ---- -"Missing field with missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_missing_value_count: - value_count: - field: foo - missing: 1 - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_missing_value_count.value: 4 } - ---- -"Missing field without missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_missing_value_count: - value_count: - field: foo - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - is_false: aggregations.the_missing_value_count.value - ---- -"Metadata test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_value_count: - meta: - foo: bar - value_count: - field: int_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_value_count.value: 4 } - - match: { aggregations.the_int_value_count.meta.foo: "bar" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/150_stats_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/150_stats_metric.yml deleted file mode 100644 index 2afad21e61421..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/150_stats_metric.yml +++ /dev/null @@ -1,195 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - int_field: - type : integer - double_field: - type : double - string_field: - type: keyword - - - do: - bulk: - refresh: true - body: - - index: - _index: test_1 - _id: 1 - - int_field: 1 - double_field: 1.0 - string_field: foo - - index: - _index: test_1 - _id: 2 - - int_field: 51 - double_field: 51.0 - string_field: foo - - index: - _index: test_1 - _id: 3 - - int_field: 101 - double_field: 101.0 - string_field: foo - - index: - _index: test_1 - _id: 4 - - int_field: 151 - double_field: 151.0 - string_field: foo - ---- -"Basic test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_stats: - stats: - field: int_field - the_double_stats: - stats: - field: double_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_stats.count: 4 } - - match: { aggregations.the_int_stats.min: 1.0 } - - match: { aggregations.the_int_stats.max: 151.0 } - - match: { aggregations.the_int_stats.avg: 76.0 } - - match: { aggregations.the_int_stats.sum: 304.0 } - - match: { aggregations.the_double_stats.count: 4 } - - match: { aggregations.the_double_stats.min: 1.0 } - - match: { aggregations.the_double_stats.max: 151.0 } - - match: { aggregations.the_double_stats.avg: 76.0 } - - match: { aggregations.the_double_stats.sum: 304.0 } - ---- -"Only aggs test": - - - do: - search: - rest_total_hits_as_int: true - body: - size: 0 - aggs: - the_int_stats: - stats: - field: int_field - the_double_stats: - stats: - field: double_field - - - match: { hits.total: 4 } - - length: { hits.hits: 0 } - - match: { aggregations.the_int_stats.count: 4 } - - match: { aggregations.the_int_stats.min: 1.0 } - - match: { aggregations.the_int_stats.max: 151.0 } - - match: { aggregations.the_int_stats.avg: 76.0 } - - match: { aggregations.the_int_stats.sum: 304.0 } - - match: { aggregations.the_double_stats.count: 4 } - - match: { aggregations.the_double_stats.min: 1.0 } - - match: { aggregations.the_double_stats.max: 151.0 } - - match: { aggregations.the_double_stats.avg: 76.0 } - - match: { aggregations.the_double_stats.sum: 304.0 } - ---- -"Filtered test": - - - do: - search: - rest_total_hits_as_int: true - body: - query: - constant_score: - filter: - range: - int_field: - gte: 50 - aggs: - the_int_stats: - stats: - field: int_field - the_double_stats: - stats: - field: double_field - - - match: { hits.total: 3 } - - length: { hits.hits: 3 } - - match: { aggregations.the_int_stats.count: 3 } - - match: { aggregations.the_int_stats.min: 51.0 } - - match: { aggregations.the_int_stats.max: 151.0 } - - match: { aggregations.the_int_stats.avg: 101.0 } - - match: { aggregations.the_int_stats.sum: 303.0 } - - match: { aggregations.the_double_stats.count: 3 } - - match: { aggregations.the_double_stats.min: 51.0 } - - match: { aggregations.the_double_stats.max: 151.0 } - - match: { aggregations.the_double_stats.avg: 101.0 } - - match: { aggregations.the_double_stats.sum: 303.0 } - - ---- -"Missing field with missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_missing_stats: - stats: - field: foo - missing: 1 - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_missing_stats.count: 4 } - - match: { aggregations.the_missing_stats.min: 1.0 } - - match: { aggregations.the_missing_stats.max: 1.0 } - - match: { aggregations.the_missing_stats.avg: 1.0 } - - match: { aggregations.the_missing_stats.sum: 4.0 } - ---- -"Missing field without missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_missing_stats: - stats: - field: foo - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - is_false: aggregations.the_missing_stats.value - ---- -"Metadata test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_stats: - meta: - foo: bar - stats: - field: int_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_stats.count: 4 } - - match: { aggregations.the_int_stats.min: 1.0 } - - match: { aggregations.the_int_stats.max: 151.0 } - - match: { aggregations.the_int_stats.avg: 76.0 } - - match: { aggregations.the_int_stats.sum: 304.0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/160_extended_stats_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/160_extended_stats_metric.yml deleted file mode 100644 index c70ca3356767a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/160_extended_stats_metric.yml +++ /dev/null @@ -1,295 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - int_field: - type : integer - double_field: - type : double - string_field: - type: keyword - - - do: - bulk: - refresh: true - body: - - index: - _index: test_1 - _id: 1 - - int_field: 1 - double_field: 1.0 - string_field: foo - - index: - _index: test_1 - _id: 2 - - int_field: 51 - double_field: 51.0 - string_field: foo - - index: - _index: test_1 - _id: 3 - - int_field: 101 - double_field: 101.0 - string_field: foo - - index: - _index: test_1 - _id: 4 - - int_field: 151 - double_field: 151.0 - string_field: foo - ---- -"Basic test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_extended_stats: - extended_stats: - field: int_field - the_double_extended_stats: - extended_stats: - field: double_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_extended_stats.count: 4 } - - match: { aggregations.the_int_extended_stats.min: 1.0 } - - match: { aggregations.the_int_extended_stats.max: 151.0 } - - match: { aggregations.the_int_extended_stats.avg: 76.0 } - - match: { aggregations.the_int_extended_stats.sum: 304.0 } - - match: { aggregations.the_int_extended_stats.sum_of_squares: 35604.0 } - - match: { aggregations.the_int_extended_stats.std_deviation: 55.90169943749474 } - - match: { aggregations.the_int_extended_stats.std_deviation_bounds.upper: 187.80339887498948 } - - match: { aggregations.the_int_extended_stats.std_deviation_bounds.lower: -35.80339887498948 } - - match: { aggregations.the_double_extended_stats.count: 4 } - - match: { aggregations.the_double_extended_stats.min: 1.0 } - - match: { aggregations.the_double_extended_stats.max: 151.0 } - - match: { aggregations.the_double_extended_stats.avg: 76.0 } - - match: { aggregations.the_double_extended_stats.sum: 304.0 } - - match: { aggregations.the_double_extended_stats.sum_of_squares: 35604.0 } - - match: { aggregations.the_double_extended_stats.std_deviation: 55.90169943749474 } - - match: { aggregations.the_double_extended_stats.std_deviation_bounds.upper: 187.80339887498948 } - - match: { aggregations.the_double_extended_stats.std_deviation_bounds.lower: -35.80339887498948 } - ---- -"Only aggs test": - - - do: - search: - rest_total_hits_as_int: true - body: - size: 0 - aggs: - the_int_extended_stats: - extended_stats: - field: int_field - the_double_extended_stats: - extended_stats: - field: double_field - - - match: { hits.total: 4 } - - length: { hits.hits: 0 } - - match: { aggregations.the_int_extended_stats.count: 4 } - - match: { aggregations.the_int_extended_stats.min: 1.0 } - - match: { aggregations.the_int_extended_stats.max: 151.0 } - - match: { aggregations.the_int_extended_stats.avg: 76.0 } - - match: { aggregations.the_int_extended_stats.sum: 304.0 } - - match: { aggregations.the_int_extended_stats.sum_of_squares: 35604.0 } - - match: { aggregations.the_int_extended_stats.std_deviation: 55.90169943749474 } - - match: { aggregations.the_int_extended_stats.variance: 3125.0 } - - match: { aggregations.the_int_extended_stats.std_deviation_bounds.upper: 187.80339887498948 } - - match: { aggregations.the_int_extended_stats.std_deviation_bounds.lower: -35.80339887498948 } - - match: { aggregations.the_double_extended_stats.count: 4 } - - match: { aggregations.the_double_extended_stats.min: 1.0 } - - match: { aggregations.the_double_extended_stats.max: 151.0 } - - match: { aggregations.the_double_extended_stats.avg: 76.0 } - - match: { aggregations.the_double_extended_stats.sum: 304.0 } - - match: { aggregations.the_double_extended_stats.sum_of_squares: 35604.0 } - - match: { aggregations.the_double_extended_stats.std_deviation: 55.90169943749474 } - - match: { aggregations.the_double_extended_stats.variance: 3125.0 } - - match: { aggregations.the_double_extended_stats.std_deviation_bounds.upper: 187.80339887498948 } - - match: { aggregations.the_double_extended_stats.std_deviation_bounds.lower: -35.80339887498948 } - ---- -"Filtered test": - - - do: - search: - rest_total_hits_as_int: true - body: - query: - constant_score: - filter: - range: - int_field: - gte: 50 - aggs: - the_int_extended_stats: - extended_stats: - field: int_field - the_double_extended_stats: - extended_stats: - field: double_field - - - match: { hits.total: 3 } - - length: { hits.hits: 3 } - - match: { aggregations.the_int_extended_stats.count: 3 } - - match: { aggregations.the_int_extended_stats.min: 51.0 } - - match: { aggregations.the_int_extended_stats.max: 151.0 } - - match: { aggregations.the_int_extended_stats.avg: 101.0 } - - match: { aggregations.the_int_extended_stats.sum: 303.0 } - - match: { aggregations.the_int_extended_stats.sum_of_squares: 35603.0 } - - match: { aggregations.the_int_extended_stats.variance: 1666.6666666666667 } - - match: { aggregations.the_int_extended_stats.std_deviation: 40.824829046386306 } - - match: { aggregations.the_int_extended_stats.std_deviation_bounds.upper: 182.6496580927726 } - - match: { aggregations.the_int_extended_stats.std_deviation_bounds.lower: 19.35034190722739 } - - match: { aggregations.the_double_extended_stats.count: 3 } - - match: { aggregations.the_double_extended_stats.min: 51.0 } - - match: { aggregations.the_double_extended_stats.max: 151.0 } - - match: { aggregations.the_double_extended_stats.avg: 101.0 } - - match: { aggregations.the_double_extended_stats.sum: 303.0 } - - match: { aggregations.the_double_extended_stats.sum_of_squares: 35603.0 } - - match: { aggregations.the_double_extended_stats.variance: 1666.6666666666667 } - - match: { aggregations.the_double_extended_stats.std_deviation: 40.824829046386306 } - - match: { aggregations.the_double_extended_stats.std_deviation_bounds.upper: 182.6496580927726 } - - match: { aggregations.the_double_extended_stats.std_deviation_bounds.lower: 19.35034190722739 } - - ---- -"Missing field with missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_missing_extended_stats: - extended_stats: - field: foo - missing: 1 - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_missing_extended_stats.count: 4 } - - match: { aggregations.the_missing_extended_stats.min: 1.0 } - - match: { aggregations.the_missing_extended_stats.max: 1.0 } - - match: { aggregations.the_missing_extended_stats.avg: 1.0 } - - match: { aggregations.the_missing_extended_stats.sum: 4.0 } - - match: { aggregations.the_missing_extended_stats.sum_of_squares: 4.0 } - - match: { aggregations.the_missing_extended_stats.variance: 0.0 } - - match: { aggregations.the_missing_extended_stats.std_deviation: 0.0 } - - match: { aggregations.the_missing_extended_stats.std_deviation_bounds.upper: 1.0 } - - match: { aggregations.the_missing_extended_stats.std_deviation_bounds.lower: 1.0 } - ---- -"Missing field without missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_missing_extended_stats: - extended_stats: - field: foo - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - is_false: aggregations.the_missing_extended_stats.value - ---- -"Metadata test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_extended_stats: - meta: - foo: bar - extended_stats: - field: int_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_extended_stats.count: 4 } - - match: { aggregations.the_int_extended_stats.min: 1.0 } - - match: { aggregations.the_int_extended_stats.max: 151.0 } - - match: { aggregations.the_int_extended_stats.avg: 76.0 } - - match: { aggregations.the_int_extended_stats.sum: 304.0 } - - match: { aggregations.the_int_extended_stats.sum_of_squares: 35604.0 } - - match: { aggregations.the_int_extended_stats.std_deviation: 55.90169943749474 } - - match: { aggregations.the_int_extended_stats.std_deviation_bounds.upper: 187.80339887498948 } - - match: { aggregations.the_int_extended_stats.std_deviation_bounds.lower: -35.80339887498948 } - ---- -"Sigma test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_extended_stats: - extended_stats: - field: int_field - sigma: 3 - the_double_extended_stats: - extended_stats: - field: double_field - sigma: 3 - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_extended_stats.count: 4 } - - match: { aggregations.the_int_extended_stats.min: 1.0 } - - match: { aggregations.the_int_extended_stats.max: 151.0 } - - match: { aggregations.the_int_extended_stats.avg: 76.0 } - - match: { aggregations.the_int_extended_stats.sum: 304.0 } - - match: { aggregations.the_int_extended_stats.sum_of_squares: 35604.0 } - - match: { aggregations.the_int_extended_stats.std_deviation: 55.90169943749474 } - - match: { aggregations.the_int_extended_stats.std_deviation_bounds.upper: 243.7050983124842 } - - match: { aggregations.the_int_extended_stats.std_deviation_bounds.lower: -91.70509831248421 } - - match: { aggregations.the_double_extended_stats.count: 4 } - - match: { aggregations.the_double_extended_stats.min: 1.0 } - - match: { aggregations.the_double_extended_stats.max: 151.0 } - - match: { aggregations.the_double_extended_stats.avg: 76.0 } - - match: { aggregations.the_double_extended_stats.sum: 304.0 } - - match: { aggregations.the_double_extended_stats.sum_of_squares: 35604.0 } - - match: { aggregations.the_double_extended_stats.std_deviation: 55.90169943749474 } - - match: { aggregations.the_double_extended_stats.std_deviation_bounds.upper: 243.7050983124842 } - - match: { aggregations.the_double_extended_stats.std_deviation_bounds.lower: -91.70509831248421 } - ---- -"Bad sigma test": - - - do: - catch: /\[sigma\] must be greater than or equal to 0. Found \[-1.0\] in \[the_int_extended_stats\]/ - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_extended_stats: - extended_stats: - field: int_field - sigma: -1 - - - do: - catch: /x_content_parse_exception/ - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_extended_stats: - extended_stats: - field: int_field - sigma: "foo" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/170_cardinality_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/170_cardinality_metric.yml deleted file mode 100644 index 482ab05291a4d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/170_cardinality_metric.yml +++ /dev/null @@ -1,214 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - int_field: - type : integer - double_field: - type : double - string_field: - type: keyword - - - do: - bulk: - refresh: true - body: - - index: - _index: test_1 - _id: 1 - - int_field: 1 - double_field: 1.0 - string_field: foo - - index: - _index: test_1 - _id: 2 - - int_field: 51 - double_field: 51.0 - string_field: foo - - index: - _index: test_1 - _id: 3 - - int_field: 101 - double_field: 101.0 - string_field: foo - - index: - _index: test_1 - _id: 4 - - int_field: 151 - double_field: 151.0 - string_field: foo - ---- -"Basic test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - distinct_int: - cardinality: - field: int_field - distinct_double: - cardinality: - field: double_field - distinct_string: - cardinality: - field: string_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.distinct_int.value: 4 } - - match: { aggregations.distinct_double.value: 4 } - - match: { aggregations.distinct_string.value: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - distinct_int: - cardinality: - field: int_field - precision_threshold: 100 - distinct_double: - cardinality: - field: double_field - precision_threshold: 100 - distinct_string: - cardinality: - field: string_field - precision_threshold: 100 - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.distinct_int.value: 4 } - - match: { aggregations.distinct_double.value: 4 } - - match: { aggregations.distinct_string.value: 1 } - ---- -"Only aggs test": - - - do: - search: - rest_total_hits_as_int: true - body: - size: 0 - aggs: - distinct_int: - cardinality: - field: int_field - distinct_double: - cardinality: - field: double_field - distinct_string: - cardinality: - field: string_field - - - match: { hits.total: 4 } - - length: { hits.hits: 0 } - - match: { aggregations.distinct_int.value: 4 } - - match: { aggregations.distinct_double.value: 4 } - - match: { aggregations.distinct_string.value: 1 } - ---- -"Filtered test": - - - do: - search: - rest_total_hits_as_int: true - body: - query: - constant_score: - filter: - range: - int_field: - gte: 50 - aggs: - distinct_int: - cardinality: - field: int_field - distinct_double: - cardinality: - field: double_field - distinct_string: - cardinality: - field: string_field - - - match: { hits.total: 3 } - - length: { hits.hits: 3 } - - match: { aggregations.distinct_int.value: 3 } - - match: { aggregations.distinct_double.value: 3 } - - match: { aggregations.distinct_string.value: 1 } - - ---- -"Missing field with missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - distinct_missing: - cardinality: - field: missing_field - missing: "foo" - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.distinct_missing.value: 1 } - ---- -"Missing field without missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - distinct_missing: - cardinality: - field: missing_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - is_false: aggregations.distinct_missing.value - ---- -"Metadata test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - distinct_missing: - meta: - foo: bar - cardinality: - field: int_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.distinct_missing.value: 4 } - - match: { aggregations.distinct_missing.meta.foo: "bar" } - ---- -"Invalid Precision test": - - - do: - catch: /\[precisionThreshold\] must be greater than or equal to 0. Found \[-1\] in \[distinct_int\]/ - search: - rest_total_hits_as_int: true - body: - aggs: - distinct_int: - cardinality: - field: int_field - precision_threshold: -1 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/180_percentiles_tdigest_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/180_percentiles_tdigest_metric.yml deleted file mode 100644 index faae9c1ccda82..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/180_percentiles_tdigest_metric.yml +++ /dev/null @@ -1,371 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - int_field: - type : integer - double_field: - type : double - string_field: - type: keyword - - - do: - bulk: - refresh: true - body: - - index: - _index: test_1 - _id: 1 - - int_field: 1 - double_field: 1.0 - string_field: foo - - index: - _index: test_1 - _id: 2 - - int_field: 51 - double_field: 51.0 - string_field: foo - - index: - _index: test_1 - _id: 3 - - int_field: 101 - double_field: 101.0 - string_field: foo - - index: - _index: test_1 - _id: 4 - - int_field: 151 - double_field: 151.0 - string_field: foo - ---- -"Basic test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - percentiles_double: - percentiles: - field: double_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - - match: { aggregations.percentiles_int.values.1\.0: 1.0 } - - match: { aggregations.percentiles_int.values.5\.0: 1.0 } - - match: { aggregations.percentiles_int.values.25\.0: 26.0 } - - match: { aggregations.percentiles_int.values.50\.0: 76.0 } - - match: { aggregations.percentiles_int.values.75\.0: 126.0 } - - match: { aggregations.percentiles_int.values.95\.0: 151.0 } - - match: { aggregations.percentiles_int.values.99\.0: 151.0 } - - - match: { aggregations.percentiles_double.values.1\.0: 1.0 } - - match: { aggregations.percentiles_double.values.5\.0: 1.0 } - - match: { aggregations.percentiles_double.values.25\.0: 26.0 } - - match: { aggregations.percentiles_double.values.50\.0: 76.0 } - - match: { aggregations.percentiles_double.values.75\.0: 126.0 } - - match: { aggregations.percentiles_double.values.95\.0: 151.0 } - - match: { aggregations.percentiles_double.values.99\.0: 151.0 } - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - tdigest: - compression: 200 - percentiles_double: - percentiles: - field: double_field - tdigest: - compression: 200 - - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - - match: { aggregations.percentiles_int.values.1\.0: 1.0 } - - match: { aggregations.percentiles_int.values.5\.0: 1.0 } - - match: { aggregations.percentiles_int.values.25\.0: 26.0 } - - match: { aggregations.percentiles_int.values.50\.0: 76.0 } - - match: { aggregations.percentiles_int.values.75\.0: 126.0 } - - match: { aggregations.percentiles_int.values.95\.0: 151.0 } - - match: { aggregations.percentiles_int.values.99\.0: 151.0 } - - - match: { aggregations.percentiles_double.values.1\.0: 1.0 } - - match: { aggregations.percentiles_double.values.5\.0: 1.0 } - - match: { aggregations.percentiles_double.values.25\.0: 26.0 } - - match: { aggregations.percentiles_double.values.50\.0: 76.0 } - - match: { aggregations.percentiles_double.values.75\.0: 126.0 } - - match: { aggregations.percentiles_double.values.95\.0: 151.0 } - - match: { aggregations.percentiles_double.values.99\.0: 151.0 } - - ---- -"Only aggs test": - - - do: - search: - rest_total_hits_as_int: true - body: - size: 0 - aggs: - percentiles_int: - percentiles: - field: int_field - percentiles_double: - percentiles: - field: double_field - - - match: { hits.total: 4 } - - length: { hits.hits: 0 } - - - match: { aggregations.percentiles_int.values.1\.0: 1.0 } - - match: { aggregations.percentiles_int.values.5\.0: 1.0 } - - match: { aggregations.percentiles_int.values.25\.0: 26.0 } - - match: { aggregations.percentiles_int.values.50\.0: 76.0 } - - match: { aggregations.percentiles_int.values.75\.0: 126.0 } - - match: { aggregations.percentiles_int.values.95\.0: 151.0 } - - match: { aggregations.percentiles_int.values.99\.0: 151.0 } - - - match: { aggregations.percentiles_double.values.1\.0: 1.0 } - - match: { aggregations.percentiles_double.values.5\.0: 1.0 } - - match: { aggregations.percentiles_double.values.25\.0: 26.0 } - - match: { aggregations.percentiles_double.values.50\.0: 76.0 } - - match: { aggregations.percentiles_double.values.75\.0: 126.0 } - - match: { aggregations.percentiles_double.values.95\.0: 151.0 } - - match: { aggregations.percentiles_double.values.99\.0: 151.0 } - - - ---- -"Filtered test": - - - do: - search: - rest_total_hits_as_int: true - body: - query: - constant_score: - filter: - range: - int_field: - gte: 50 - aggs: - percentiles_int: - percentiles: - field: int_field - percentiles_double: - percentiles: - field: double_field - - - match: { hits.total: 3 } - - length: { hits.hits: 3 } - - - match: { aggregations.percentiles_int.values.1\.0: 51.0 } - - match: { aggregations.percentiles_int.values.5\.0: 51.0 } - - match: { aggregations.percentiles_int.values.25\.0: 63.5 } - - match: { aggregations.percentiles_int.values.50\.0: 101.0 } - - match: { aggregations.percentiles_int.values.75\.0: 138.5 } - - match: { aggregations.percentiles_int.values.95\.0: 151.0 } - - match: { aggregations.percentiles_int.values.99\.0: 151.0 } - - - match: { aggregations.percentiles_double.values.1\.0: 51.0 } - - match: { aggregations.percentiles_double.values.5\.0: 51.0 } - - match: { aggregations.percentiles_double.values.25\.0: 63.5 } - - match: { aggregations.percentiles_double.values.50\.0: 101.0 } - - match: { aggregations.percentiles_double.values.75\.0: 138.5 } - - match: { aggregations.percentiles_double.values.95\.0: 151.0 } - - match: { aggregations.percentiles_double.values.99\.0: 151.0 } - ---- -"Missing field with missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_missing: - percentiles: - field: missing_field - missing: 1.0 - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - - match: { aggregations.percentiles_missing.values.1\.0: 1.0 } - - match: { aggregations.percentiles_missing.values.5\.0: 1.0 } - - match: { aggregations.percentiles_missing.values.25\.0: 1.0 } - - match: { aggregations.percentiles_missing.values.50\.0: 1.0 } - - match: { aggregations.percentiles_missing.values.75\.0: 1.0 } - - match: { aggregations.percentiles_missing.values.95\.0: 1.0 } - - match: { aggregations.percentiles_missing.values.99\.0: 1.0 } - ---- -"Missing field without missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_missing: - percentiles: - field: missing_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - is_false: aggregations.percentiles_missing.value - ---- -"Metadata test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - meta: - foo: bar - percentiles: - field: int_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.percentiles_int.meta.foo: "bar" } - - - - match: { aggregations.percentiles_int.values.1\.0: 1.0 } - - match: { aggregations.percentiles_int.values.5\.0: 1.0 } - - match: { aggregations.percentiles_int.values.25\.0: 26.0 } - - match: { aggregations.percentiles_int.values.50\.0: 76.0 } - - match: { aggregations.percentiles_int.values.75\.0: 126.0 } - - match: { aggregations.percentiles_int.values.95\.0: 151.0 } - - match: { aggregations.percentiles_int.values.99\.0: 151.0 } - ---- -"Invalid params test": - - - do: - catch: /\[compression\] must be greater than or equal to 0. Found \[-1.0\] in \[percentiles_int\]/ - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - tdigest: - compression: -1 - - - do: - catch: /\[percents\] must not be empty/ - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - percents: [] - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - percents: null - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - percents: ["foo"] - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_string: - percentiles: - field: string_field - ---- -"Explicit Percents test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - percents: [5.0, 25.0, 50.0] - percentiles_double: - percentiles: - field: double_field - percents: [5.0, 25.0, 50.0] - - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - - match: { aggregations.percentiles_int.values.5\.0: 1.0 } - - match: { aggregations.percentiles_int.values.25\.0: 26.0 } - - match: { aggregations.percentiles_int.values.50\.0: 76.0 } - - - match: { aggregations.percentiles_double.values.5\.0: 1.0 } - - match: { aggregations.percentiles_double.values.25\.0: 26.0 } - - match: { aggregations.percentiles_double.values.50\.0: 76.0 } - ---- -"Non-keyed test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - percents: [5.0, 25.0, 50.0] - keyed: false - - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - - match: { aggregations.percentiles_int.values.0.key: 5.0 } - - match: { aggregations.percentiles_int.values.0.value: 1.0 } - - match: { aggregations.percentiles_int.values.1.key: 25.0 } - - match: { aggregations.percentiles_int.values.1.value: 26.0 } - - match: { aggregations.percentiles_int.values.2.key: 50.0 } - - match: { aggregations.percentiles_int.values.2.value: 76.0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/190_percentiles_hdr_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/190_percentiles_hdr_metric.yml deleted file mode 100644 index 809e18458f0bd..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/190_percentiles_hdr_metric.yml +++ /dev/null @@ -1,450 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - number_of_shards: 5 - number_of_routing_shards: 5 - mappings: - properties: - int_field: - type : integer - double_field: - type : double - string_field: - type: keyword - - - do: - bulk: - refresh: true - body: - - index: - _index: test_1 - _id: 1 - - int_field: 1 - double_field: 1.0 - string_field: foo - - index: - _index: test_1 - _id: 2 - - int_field: 51 - double_field: 51.0 - string_field: foo - - index: - _index: test_1 - _id: 3 - - int_field: 101 - double_field: 101.0 - string_field: foo - - index: - _index: test_1 - _id: 4 - - int_field: 151 - double_field: 151.0 - string_field: foo - ---- -"Basic test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - hdr: {} - percentiles_double: - percentiles: - field: double_field - hdr: {} - - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - - match: { aggregations.percentiles_int.values.1\.0: 1.0 } - - match: { aggregations.percentiles_int.values.5\.0: 1.0 } - - match: { aggregations.percentiles_int.values.25\.0: 1.0 } - - match: { aggregations.percentiles_int.values.50\.0: 51.0302734375 } - - match: { aggregations.percentiles_int.values.75\.0: 101.0615234375 } - - match: { aggregations.percentiles_int.values.95\.0: 151.1240234375 } - - match: { aggregations.percentiles_int.values.99\.0: 151.1240234375 } - - - match: { aggregations.percentiles_double.values.1\.0: 1.0 } - - match: { aggregations.percentiles_double.values.5\.0: 1.0 } - - match: { aggregations.percentiles_double.values.25\.0: 1.0 } - - match: { aggregations.percentiles_double.values.50\.0: 51.0302734375 } - - match: { aggregations.percentiles_double.values.75\.0: 101.0615234375 } - - match: { aggregations.percentiles_double.values.95\.0: 151.1240234375 } - - match: { aggregations.percentiles_double.values.99\.0: 151.1240234375 } - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - hdr: - number_of_significant_value_digits: 3 - percentiles_double: - percentiles: - field: double_field - hdr: - number_of_significant_value_digits: 3 - - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - - match: { aggregations.percentiles_int.values.1\.0: 1.0 } - - match: { aggregations.percentiles_int.values.5\.0: 1.0 } - - match: { aggregations.percentiles_int.values.25\.0: 1.0 } - - match: { aggregations.percentiles_int.values.50\.0: 51.0302734375 } - - match: { aggregations.percentiles_int.values.75\.0: 101.0615234375 } - - match: { aggregations.percentiles_int.values.95\.0: 151.1240234375 } - - match: { aggregations.percentiles_int.values.99\.0: 151.1240234375 } - - - match: { aggregations.percentiles_double.values.1\.0: 1.0 } - - match: { aggregations.percentiles_double.values.5\.0: 1.0 } - - match: { aggregations.percentiles_double.values.25\.0: 1.0 } - - match: { aggregations.percentiles_double.values.50\.0: 51.0302734375 } - - match: { aggregations.percentiles_double.values.75\.0: 101.0615234375 } - - match: { aggregations.percentiles_double.values.95\.0: 151.1240234375 } - - match: { aggregations.percentiles_double.values.99\.0: 151.1240234375 } - - ---- -"Only aggs test": - - - do: - search: - rest_total_hits_as_int: true - body: - size: 0 - aggs: - percentiles_int: - percentiles: - field: int_field - hdr: {} - percentiles_double: - percentiles: - field: double_field - hdr: {} - - - match: { hits.total: 4 } - - length: { hits.hits: 0 } - - - match: { aggregations.percentiles_int.values.1\.0: 1.0 } - - match: { aggregations.percentiles_int.values.5\.0: 1.0 } - - match: { aggregations.percentiles_int.values.25\.0: 1.0 } - - match: { aggregations.percentiles_int.values.50\.0: 51.0302734375 } - - match: { aggregations.percentiles_int.values.75\.0: 101.0615234375 } - - match: { aggregations.percentiles_int.values.95\.0: 151.1240234375 } - - match: { aggregations.percentiles_int.values.99\.0: 151.1240234375 } - - - match: { aggregations.percentiles_double.values.1\.0: 1.0 } - - match: { aggregations.percentiles_double.values.5\.0: 1.0 } - - match: { aggregations.percentiles_double.values.25\.0: 1.0 } - - match: { aggregations.percentiles_double.values.50\.0: 51.0302734375 } - - match: { aggregations.percentiles_double.values.75\.0: 101.0615234375 } - - match: { aggregations.percentiles_double.values.95\.0: 151.1240234375 } - - match: { aggregations.percentiles_double.values.99\.0: 151.1240234375 } - - ---- -"Filtered test": - - - do: - search: - rest_total_hits_as_int: true - body: - query: - constant_score: - filter: - range: - int_field: - gte: 50 - aggs: - percentiles_int: - percentiles: - field: int_field - hdr: {} - percentiles_double: - percentiles: - field: double_field - hdr: {} - - - match: { hits.total: 3 } - - length: { hits.hits: 3 } - - - match: { aggregations.percentiles_int.values.1\.0: 51.0 } - - match: { aggregations.percentiles_int.values.5\.0: 51.0 } - - match: { aggregations.percentiles_int.values.25\.0: 51.0 } - - match: { aggregations.percentiles_int.values.50\.0: 101.03125 } - - match: { aggregations.percentiles_int.values.75\.0: 101.03125 } - - match: { aggregations.percentiles_int.values.95\.0: 151.09375 } - - match: { aggregations.percentiles_int.values.99\.0: 151.09375 } - - - match: { aggregations.percentiles_double.values.1\.0: 51.0 } - - match: { aggregations.percentiles_double.values.5\.0: 51.0 } - - match: { aggregations.percentiles_double.values.25\.0: 51.0 } - - match: { aggregations.percentiles_double.values.50\.0: 101.03125 } - - match: { aggregations.percentiles_double.values.75\.0: 101.03125 } - - match: { aggregations.percentiles_double.values.95\.0: 151.09375 } - - match: { aggregations.percentiles_double.values.99\.0: 151.09375 } - - ---- -"Missing field with missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_missing: - percentiles: - field: missing_field - missing: 1.0 - hdr: {} - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - - match: { aggregations.percentiles_missing.values.1\.0: 1.0 } - - match: { aggregations.percentiles_missing.values.5\.0: 1.0 } - - match: { aggregations.percentiles_missing.values.25\.0: 1.0 } - - match: { aggregations.percentiles_missing.values.50\.0: 1.0 } - - match: { aggregations.percentiles_missing.values.75\.0: 1.0 } - - match: { aggregations.percentiles_missing.values.95\.0: 1.0 } - - match: { aggregations.percentiles_missing.values.99\.0: 1.0 } - ---- -"Missing field without missing param": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_missing: - percentiles: - field: missing_field - hdr: {} - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - is_false: aggregations.percentiles_missing.value - ---- -"Metadata test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - meta: - foo: bar - percentiles: - field: int_field - hdr: {} - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.percentiles_int.meta.foo: "bar" } - - - match: { aggregations.percentiles_int.values.1\.0: 1.0 } - - match: { aggregations.percentiles_int.values.5\.0: 1.0 } - - match: { aggregations.percentiles_int.values.25\.0: 1.0 } - - match: { aggregations.percentiles_int.values.50\.0: 51.0302734375 } - - match: { aggregations.percentiles_int.values.75\.0: 101.0615234375 } - - match: { aggregations.percentiles_int.values.95\.0: 151.1240234375 } - - match: { aggregations.percentiles_int.values.99\.0: 151.1240234375 } - ---- -"Invalid params test": - - - do: - catch: /\[numberOfSignificantValueDigits\] must be between 0 and 5/ - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - hdr: - number_of_significant_value_digits: -1 - - - do: - catch: /\[numberOfSignificantValueDigits\] must be between 0 and 5/ - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - hdr: - number_of_significant_value_digits: 10 - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - hdr: - number_of_significant_value_digits: null - - - do: - catch: /\[percents\] must not be empty/ - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - hdr: {} - percents: [] - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - hdr: {} - percents: null - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - hdr: {} - percents: ["foo"] - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_string: - percentiles: - field: string_field - hdr: {} - ---- -"Explicit Percents test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - percents: [5.0, 25.0, 50.0] - hdr: {} - percentiles_double: - percentiles: - field: double_field - percents: [5.0, 25.0, 50.0] - hdr: {} - - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - - match: { aggregations.percentiles_int.values.5\.0: 1.0 } - - match: { aggregations.percentiles_int.values.25\.0: 1.0 } - - match: { aggregations.percentiles_int.values.50\.0: 51.0302734375 } - - - - match: { aggregations.percentiles_double.values.5\.0: 1.0 } - - match: { aggregations.percentiles_double.values.25\.0: 1.0 } - - match: { aggregations.percentiles_double.values.50\.0: 51.0302734375 } - - ---- -"Non-keyed test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - percents: [5.0, 25.0, 50.0] - keyed: false - hdr: {} - - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - - - match: { aggregations.percentiles_int.values.0.key: 5.0 } - - match: { aggregations.percentiles_int.values.0.value: 1.0 } - - match: { aggregations.percentiles_int.values.1.key: 25.0 } - - match: { aggregations.percentiles_int.values.1.value: 1.0 } - - match: { aggregations.percentiles_int.values.2.key: 50.0 } - - match: { aggregations.percentiles_int.values.2.value: 51.0302734375 } - - ---- -"Negative values test": - - - do: - index: - index: test_1 - id: 5 - refresh: true - body: { int_field: -10 } - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - percentiles_int: - percentiles: - field: int_field - hdr: {} - - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - - match: { aggregations.percentiles_int.values.1\.0: 1.0 } - - match: { aggregations.percentiles_int.values.5\.0: 1.0 } - - match: { aggregations.percentiles_int.values.25\.0: 1.0 } - - match: { aggregations.percentiles_int.values.50\.0: 51.0302734375 } - - match: { aggregations.percentiles_int.values.75\.0: 101.0615234375 } - - match: { aggregations.percentiles_int.values.95\.0: 151.1240234375 } - - match: { aggregations.percentiles_int.values.99\.0: 151.1240234375 } - - match: { _shards.failures.0.reason.type: array_index_out_of_bounds_exception } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/200_top_hits_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/200_top_hits_metric.yml deleted file mode 100644 index 11e3d5906d7e9..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/200_top_hits_metric.yml +++ /dev/null @@ -1,111 +0,0 @@ -setup: - - do: - indices.create: - index: my-index - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - properties: - users: - type: nested - - - do: - index: - index: my-index - id: 1 - refresh: true - body: | - { - "group" : "fans", - "users" : [ - { - "first" : "John", - "last" : "Smith" - }, - { - "first" : "Alice", - "last" : "White" - } - ] - } - - - do: - index: - index: my-index - id: 2 - refresh: true - body: | - { - "group" : "fans", - "users" : [ - { - "first" : "Mark", - "last" : "Doe" - } - ] - } - ---- -"top_hits aggregation with nested documents": - - skip: - version: " - 6.1.99" - reason: "<= 6.1 nodes don't always include index or id in nested top hits" - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - to-users: - nested: - path: users - aggs: - users: - top_hits: - sort: "users.last.keyword" - - - match: { hits.total: 2 } - - length: { aggregations.to-users.users.hits.hits: 3 } - - match: { aggregations.to-users.users.hits.hits.0._id: "2" } - - match: { aggregations.to-users.users.hits.hits.0._index: my-index } - - match: { aggregations.to-users.users.hits.hits.0._nested.field: users } - - match: { aggregations.to-users.users.hits.hits.0._nested.offset: 0 } - - match: { aggregations.to-users.users.hits.hits.1._id: "1" } - - match: { aggregations.to-users.users.hits.hits.1._index: my-index } - - match: { aggregations.to-users.users.hits.hits.1._nested.field: users } - - match: { aggregations.to-users.users.hits.hits.1._nested.offset: 0 } - - match: { aggregations.to-users.users.hits.hits.2._id: "1" } - - match: { aggregations.to-users.users.hits.hits.2._index: my-index } - - match: { aggregations.to-users.users.hits.hits.2._nested.field: users } - - match: { aggregations.to-users.users.hits.hits.2._nested.offset: 1 } - - ---- -"top_hits aggregation with sequence numbers": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - groups: - terms: - field: group.keyword - aggs: - users: - top_hits: - sort: "users.last.keyword" - seq_no_primary_term: true - - - match: { hits.total: 2 } - - length: { aggregations.groups.buckets.0.users.hits.hits: 2 } - - match: { aggregations.groups.buckets.0.users.hits.hits.0._id: "1" } - - match: { aggregations.groups.buckets.0.users.hits.hits.0._index: my-index } - - gte: { aggregations.groups.buckets.0.users.hits.hits.0._seq_no: 0 } - - gte: { aggregations.groups.buckets.0.users.hits.hits.0._primary_term: 1 } - - match: { aggregations.groups.buckets.0.users.hits.hits.1._id: "2" } - - match: { aggregations.groups.buckets.0.users.hits.hits.1._index: my-index } - - gte: { aggregations.groups.buckets.0.users.hits.hits.1._seq_no: 0 } - - gte: { aggregations.groups.buckets.0.users.hits.hits.1._primary_term: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/20_terms.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/20_terms.yml deleted file mode 100644 index 3d9f8a9c8af60..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/20_terms.yml +++ /dev/null @@ -1,771 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - str: - type: keyword - ip: - type: ip - boolean: - type: boolean - integer: - type: long - double: - type: double - number: - type: long - date: - type: date - - - do: - indices.create: - index: test_2 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - number: - type: double - - - do: - cluster.health: - wait_for_status: green - ---- -"Basic test": - - do: - index: - index: test_1 - id: 1 - body: { "str" : "abc" } - - - do: - index: - index: test_1 - id: 2 - body: { "str": "abc" } - - - do: - index: - index: test_1 - id: 3 - body: { "str": "bcd" } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str" } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.str_terms.buckets: 2 } - - - match: { aggregations.str_terms.buckets.0.key: "abc" } - - - is_false: aggregations.str_terms.buckets.0.key_as_string - - - match: { aggregations.str_terms.buckets.0.doc_count: 2 } - - - match: { aggregations.str_terms.buckets.1.key: "bcd" } - - - is_false: aggregations.str_terms.buckets.1.key_as_string - - - match: { aggregations.str_terms.buckets.1.doc_count: 1 } - ---- -"IP test": - - do: - index: - index: test_1 - id: 1 - body: { "ip": "::1" } - - - do: - index: - index: test_1 - id: 2 - body: { "ip": "127.0.0.1" } - - - do: - index: - index: test_1 - id: 3 - body: { "ip": "::1" } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "ip_terms" : { "terms" : { "field" : "ip" } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.ip_terms.buckets: 2 } - - - match: { aggregations.ip_terms.buckets.0.key: "::1" } - - - is_false: aggregations.ip_terms.buckets.0.key_as_string - - - match: { aggregations.ip_terms.buckets.0.doc_count: 2 } - - - match: { aggregations.ip_terms.buckets.1.key: "127.0.0.1" } - - - is_false: aggregations.ip_terms.buckets.1.key_as_string - - - match: { aggregations.ip_terms.buckets.1.doc_count: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "ip_terms" : { "terms" : { "field" : "ip", "include" : [ "127.0.0.1" ] } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.ip_terms.buckets: 1 } - - - match: { aggregations.ip_terms.buckets.0.key: "127.0.0.1" } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "ip_terms" : { "terms" : { "field" : "ip", "exclude" : [ "127.0.0.1" ] } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.ip_terms.buckets: 1 } - - - match: { aggregations.ip_terms.buckets.0.key: "::1" } - - - do: - catch: request - search: - rest_total_hits_as_int: true - index: test_1 - body: { "size" : 0, "aggs" : { "ip_terms" : { "terms" : { "field" : "ip", "exclude" : "127.*" } } } } - - - ---- -"Boolean test": - - do: - index: - index: test_1 - id: 1 - body: { "boolean": true } - - - do: - index: - index: test_1 - id: 2 - body: { "boolean": false } - - - do: - index: - index: test_1 - id: 3 - body: { "boolean": true } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "boolean_terms" : { "terms" : { "field" : "boolean" } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.boolean_terms.buckets: 2 } - - - match: { aggregations.boolean_terms.buckets.0.key: 1 } - - - match: { aggregations.boolean_terms.buckets.0.key_as_string: "true" } - - - match: { aggregations.boolean_terms.buckets.0.doc_count: 2 } - - - match: { aggregations.boolean_terms.buckets.1.key: 0 } - - - match: { aggregations.boolean_terms.buckets.1.key_as_string: "false" } - - - match: { aggregations.boolean_terms.buckets.1.doc_count: 1 } - ---- -"Integer test": - - do: - index: - index: test_1 - id: 1 - body: { "integer": 1234 } - - - do: - index: - index: test_1 - id: 2 - body: { "integer": 5678 } - - - do: - index: - index: test_1 - id: 3 - body: { "integer": 1234 } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "integer_terms" : { "terms" : { "field" : "integer" } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.integer_terms.buckets: 2 } - - - match: { aggregations.integer_terms.buckets.0.key: 1234 } - - - is_false: aggregations.integer_terms.buckets.0.key_as_string - - - match: { aggregations.integer_terms.buckets.0.doc_count: 2 } - - - match: { aggregations.integer_terms.buckets.1.key: 5678 } - - - is_false: aggregations.integer_terms.buckets.1.key_as_string - - - match: { aggregations.integer_terms.buckets.1.doc_count: 1 } - ---- -"Double test": - - do: - index: - index: test_1 - id: 1 - body: { "double": 1234.5 } - - - do: - index: - index: test_1 - id: 2 - body: { "double": 5678.5 } - - - do: - index: - index: test_1 - id: 3 - body: { "double": 1234.5 } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "double_terms" : { "terms" : { "field" : "double" } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.double_terms.buckets: 2 } - - - match: { aggregations.double_terms.buckets.0.key: 1234.5 } - - - is_false: aggregations.double_terms.buckets.0.key_as_string - - - match: { aggregations.double_terms.buckets.0.doc_count: 2 } - - - match: { aggregations.double_terms.buckets.1.key: 5678.5 } - - - is_false: aggregations.double_terms.buckets.1.key_as_string - - - match: { aggregations.double_terms.buckets.1.doc_count: 1 } - ---- -"Date test": - - do: - index: - index: test_1 - id: 1 - body: { "date": "2016-05-03" } - - - do: - index: - index: test_1 - id: 2 - body: { "date": "2014-09-01" } - - - do: - index: - index: test_1 - id: 3 - body: { "date": "2016-05-03" } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "date_terms" : { "terms" : { "field" : "date" } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.date_terms.buckets: 2 } - - - match: { aggregations.date_terms.buckets.0.key: 1462233600000 } - - - match: { aggregations.date_terms.buckets.0.key_as_string: "2016-05-03T00:00:00.000Z" } - - - match: { aggregations.date_terms.buckets.0.doc_count: 2 } - - - match: { aggregations.date_terms.buckets.1.key: 1409529600000 } - - - match: { aggregations.date_terms.buckets.1.key_as_string: "2014-09-01T00:00:00.000Z" } - - - match: { aggregations.date_terms.buckets.1.doc_count: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "date_terms" : { "terms" : { "field" : "date", "include" : [ "2016-05-03" ] } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.date_terms.buckets: 1 } - - - match: { aggregations.date_terms.buckets.0.key_as_string: "2016-05-03T00:00:00.000Z" } - - - match: { aggregations.date_terms.buckets.0.doc_count: 2 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "date_terms" : { "terms" : { "field" : "date", "exclude" : [ "2016-05-03" ] } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.date_terms.buckets: 1 } - - - match: { aggregations.date_terms.buckets.0.key_as_string: "2014-09-01T00:00:00.000Z" } - - - match: { aggregations.date_terms.buckets.0.doc_count: 1 } - ---- -"Partitioned string test": - - - do: - index: - index: test_1 - id: 1 - body: { "str" : "abc" } - - - do: - index: - index: test_1 - id: 2 - body: { "str": "abc" } - - - do: - index: - index: test_1 - id: 3 - body: { "str": "bcd" } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str", "include" : {"partition": 0, "num_partitions": 2 } } } } } - - - match: { hits.total : 3 } - - - length: { aggregations.str_terms.buckets: 1 } - - - match: { aggregations.str_terms.buckets.0.key: "bcd" } - - - is_false: aggregations.str_terms.buckets.0.key_as_string - - - match: { aggregations.str_terms.buckets.0.doc_count: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str", "include" : {"partition": 1, "num_partitions": 2 } } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.str_terms.buckets: 1 } - - - match: { aggregations.str_terms.buckets.0.key: "abc" } - - - is_false: aggregations.str_terms.buckets.0.key_as_string - - - match: { aggregations.str_terms.buckets.0.doc_count: 2 } - ---- -"Partitioned integer test": - - - do: - index: - index: test_1 - id: 1 - body: { "integer": 1234 } - - - do: - index: - index: test_1 - id: 2 - body: { "integer": 5678 } - - - do: - index: - index: test_1 - id: 3 - body: { "integer": 1234 } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "integer", "include" : {"partition": 0, "num_partitions": 2 } } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.str_terms.buckets: 1 } - - - match: { aggregations.str_terms.buckets.0.key: 5678 } - - - match: { aggregations.str_terms.buckets.0.doc_count: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "integer", "include" : {"partition": 1, "num_partitions": 2 } } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.str_terms.buckets: 1 } - - - match: { aggregations.str_terms.buckets.0.key: 1234 } - - - match: { aggregations.str_terms.buckets.0.doc_count: 2 } - ---- -"Unmapped strings": - - - do: - index: - index: test_1 - id: 1 - body: {} - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "string_terms" : { "terms" : { "field" : "unmapped_string", "value_type" : "string", "missing": "abc" } } } } - - - match: { hits.total: 1 } - - - length: { aggregations.string_terms.buckets: 1 } - - - match: { aggregations.string_terms.buckets.0.key: "abc" } - - - match: { aggregations.string_terms.buckets.0.doc_count: 1 } - ---- -"Unmapped booleans": - - - do: - index: - index: test_1 - id: 1 - body: {} - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "boolean_terms" : { "terms" : { "field" : "unmapped_boolean", "value_type" : "boolean", "missing": true } } } } - - - match: { hits.total: 1 } - - - length: { aggregations.boolean_terms.buckets: 1 } - - - match: { aggregations.boolean_terms.buckets.0.key: 1 } - - - match: { aggregations.boolean_terms.buckets.0.key_as_string: "true" } - - - match: { aggregations.boolean_terms.buckets.0.doc_count: 1 } - ---- -"Unmapped dates": - - - do: - index: - index: test_1 - id: 1 - body: {} - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "date_terms" : { "terms" : { "field" : "unmapped_date", "value_type" : "date", "missing": "2016-05-11" } } } } - - - match: { hits.total: 1 } - - - length: { aggregations.date_terms.buckets: 1 } - - - match: { aggregations.date_terms.buckets.0.key: 1462924800000 } - - - match: { aggregations.date_terms.buckets.0.key_as_string: "2016-05-11T00:00:00.000Z" } - - - match: { aggregations.date_terms.buckets.0.doc_count: 1 } - ---- -"Unmapped longs": - - - do: - index: - index: test_1 - id: 1 - body: {} - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "long_terms" : { "terms" : { "field" : "unmapped_long", "value_type" : "long", "missing": 3 } } } } - - - match: { hits.total: 1 } - - - length: { aggregations.long_terms.buckets: 1 } - - - match: { aggregations.long_terms.buckets.0.key: 3 } - - - match: { aggregations.long_terms.buckets.0.doc_count: 1 } - ---- -"Unmapped doubles": - - - do: - index: - index: test_1 - id: 1 - body: {} - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "double_terms" : { "terms" : { "field" : "unmapped_double", "value_type" : "double", "missing": 3.5 } } } } - - - match: { hits.total: 1 } - - - length: { aggregations.double_terms.buckets: 1 } - - - match: { aggregations.double_terms.buckets.0.key: 3.5 } - - - match: { aggregations.double_terms.buckets.0.doc_count: 1 } - ---- -"Mixing longs and doubles": - - - do: - index: - index: test_1 - id: 1 - body: {"number": 100} - - - do: - index: - index: test_1 - id: 2 - body: {"number": 10} - - - do: - index: - index: test_2 - id: 3 - body: {"number": 100.0} - - - do: - index: - index: test_2 - id: 1 - body: {"number": 10.0} - - - do: - index: - index: test_2 - id: 2 - body: {"number": 14.6} - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "number_terms" : { "terms" : { "field" : "number" } } } } - - - match: { hits.total: 5 } - - - length: { aggregations.number_terms.buckets: 3 } - - - match: { aggregations.number_terms.buckets.0.key: 10.0 } - - - match: { aggregations.number_terms.buckets.0.doc_count: 2 } - - - match: { aggregations.number_terms.buckets.1.key: 100.0 } - - - match: { aggregations.number_terms.buckets.1.doc_count: 2 } - - - match: { aggregations.number_terms.buckets.2.key: 14.6 } - - - match: { aggregations.number_terms.buckets.2.doc_count: 1 } - ---- -"Deprecated _term order": - - - skip: - reason: _term order deprecated in 6.0, replaced by _key - features: "warnings" - - - do: - index: - index: test_1 - id: 1 - body: { "str": "abc" } - - - do: - index: - index: test_1 - id: 2 - body: { "str": "abc" } - - - do: - index: - index: test_1 - id: 3 - body: { "str": "bcd" } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str", "order" : { "_term" : "desc" } } } } } - warnings: - - "Deprecated aggregation order key [_term] used, replaced by [_key]" - - - match: { hits.total: 3 } - - - length: { aggregations.str_terms.buckets: 2 } - - - match: { aggregations.str_terms.buckets.0.key: "bcd" } - - - is_false: aggregations.str_terms.buckets.0.key_as_string - - - match: { aggregations.str_terms.buckets.0.doc_count: 1 } - - - match: { aggregations.str_terms.buckets.1.key: "abc" } - - - is_false: aggregations.str_terms.buckets.1.key_as_string - - - match: { aggregations.str_terms.buckets.1.doc_count: 2 } - ---- -"Global ordinals are not loaded with the map execution hint": - - - skip: - version: " - 6.99.99" - reason: bug fixed in 7.0 - - - do: - index: - refresh: true - index: test_1 - id: 1 - routing: 1 - body: { "str": "abc" } - - - do: - index: - refresh: true - index: test_1 - id: 2 - routing: 1 - body: { "str": "abc" } - - - do: - index: - refresh: true - index: test_1 - id: 3 - routing: 1 - body: { "str": "bcd" } - - - do: - indices.refresh: {} - - - do: - search: - index: test_1 - body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str", "execution_hint" : "map" } } } } - - - match: { hits.total.value: 3} - - length: { aggregations.str_terms.buckets: 2 } - - - do: - indices.stats: - index: test_1 - metric: fielddata - fielddata_fields: str - - - match: { indices.test_1.total.fielddata.memory_size_in_bytes: 0} - - - do: - search: - index: test_1 - body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str", "execution_hint" : "global_ordinals" } } } } - - - match: { hits.total.value: 3} - - length: { aggregations.str_terms.buckets: 2 } - - - do: - indices.stats: - index: test_1 - metric: fielddata - fielddata_fields: str - - - gt: { indices.test_1.total.fielddata.memory_size_in_bytes: 0} - - - - - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/220_filters_bucket.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/220_filters_bucket.yml deleted file mode 100644 index e0183f0c54f66..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/220_filters_bucket.yml +++ /dev/null @@ -1,274 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - int_field: - type : integer - double_field: - type : double - string_field: - type: keyword - - - do: - bulk: - refresh: true - body: - - index: - _index: test_1 - _id: 1 - - int_field: 1 - double_field: 1.0 - string_field: foo - - index: - _index: test_1 - _id: 2 - - int_field: 51 - double_field: 51.0 - string_field: foo - - index: - _index: test_1 - _id: 3 - - int_field: 101 - double_field: 101.0 - string_field: foo - - index: - _index: test_1 - _id: 4 - - int_field: 151 - double_field: 151.0 - string_field: foo - ---- -"Basic test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_filter: - filters: - filters: - first_filter: - match: - int_field: 101 - second_filter: - match: - int_field: 151 - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_filter.buckets.first_filter.doc_count: 1 } - - match: { aggregations.the_filter.buckets.second_filter.doc_count: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_filter: - filters: - filters: - first_filter: - match: - int_field: 101 - second_filter: - match: - int_field: 151 - aggs: - the_avg: - avg: - field: int_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_filter.buckets.first_filter.doc_count: 1 } - - match: { aggregations.the_filter.buckets.first_filter.the_avg.value: 101.0 } - - match: { aggregations.the_filter.buckets.second_filter.doc_count: 1 } - - match: { aggregations.the_filter.buckets.second_filter.the_avg.value: 151.0 } - ---- -"Anonymous filters test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_filter: - filters: - filters: - - match: - int_field: 101 - - match: - int_field: 151 - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_filter.buckets.0.doc_count: 1 } - - match: { aggregations.the_filter.buckets.1.doc_count: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_filter: - filters: - filters: - - match: - int_field: 101 - - match: - int_field: 151 - aggs: - the_avg: - avg: - field: int_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_filter.buckets.0.doc_count: 1 } - - match: { aggregations.the_filter.buckets.0.the_avg.value: 101.0 } - - match: { aggregations.the_filter.buckets.1.doc_count: 1 } - - match: { aggregations.the_filter.buckets.1.the_avg.value: 151.0 } - ---- -"Only aggs test": - - - do: - search: - rest_total_hits_as_int: true - body: - size: 0 - aggs: - the_filter: - filters: - filters: - first_filter: - match: - int_field: 101 - second_filter: - match: - int_field: 151 - - - match: { hits.total: 4 } - - length: { hits.hits: 0 } - - match: { aggregations.the_filter.buckets.first_filter.doc_count: 1 } - - match: { aggregations.the_filter.buckets.second_filter.doc_count: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_filter: - filters: - filters: - first_filter: - match: - int_field: 101 - second_filter: - match: - int_field: 151 - aggs: - the_avg: - avg: - field: int_field - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_filter.buckets.first_filter.doc_count: 1 } - - match: { aggregations.the_filter.buckets.first_filter.the_avg.value: 101.0 } - - match: { aggregations.the_filter.buckets.second_filter.doc_count: 1 } - - match: { aggregations.the_filter.buckets.second_filter.the_avg.value: 151.0 } - ---- -"Filtered test": - - - do: - search: - rest_total_hits_as_int: true - body: - query: - constant_score: - filter: - range: - int_field: - gte: 110 - aggs: - the_filter: - filters: - filters: - first_filter: - match: - int_field: 101 - second_filter: - match: - int_field: 151 - aggs: - the_avg: - avg: - field: int_field - - - match: { hits.total: 1 } - - length: { hits.hits: 1 } - - match: { aggregations.the_filter.buckets.first_filter.doc_count: 0 } - - is_false: aggregations.the_filter.buckets.first_filter.the_avg.value - - match: { aggregations.the_filter.buckets.second_filter.doc_count: 1 } - - match: { aggregations.the_filter.buckets.second_filter.the_avg.value: 151.0 } - - ---- -"Metadata test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_filter: - meta: - foo: bar - filters: - filters: - first_filter: - match: - int_field: 101 - second_filter: - match: - int_field: 151 - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_filter.buckets.first_filter.doc_count: 1 } - - match: { aggregations.the_filter.buckets.second_filter.doc_count: 1 } - - match: { aggregations.the_filter.meta.foo: "bar" } - ---- -"Bad params": - - skip: - version: " - 7.1.99" - reason: "empty bodies throws exception starting in 7.2" - - do: - catch: /\[filters\] cannot be empty/ - search: - rest_total_hits_as_int: true - body: - aggs: - the_filter: - filters: {} - - - do: - catch: /\[filters\] cannot be empty/ - search: - rest_total_hits_as_int: true - body: - aggs: - the_filter: - filters: - filters: [] diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/230_composite.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/230_composite.yml deleted file mode 100644 index bfb067b8c2084..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/230_composite.yml +++ /dev/null @@ -1,1032 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test - body: - mappings: - properties: - date: - type: date - keyword: - type: keyword - long: - type: long - geo_point: - type: geo_point - nested: - type: nested - properties: - nested_long: - type: long - - - do: - indices.create: - index: other - body: - mappings: - properties: - date: - type: date - long: - type: long - nested: - type: nested - properties: - nested_long: - type: long - - - do: - index: - index: test - id: 1 - body: { "keyword": "foo", "long": [10, 20], "geo_point": "37.2343,-115.8067", "nested": [{"nested_long": 10}, {"nested_long": 20}] } - - - do: - index: - index: test - id: 2 - body: { "keyword": ["foo", "bar"], "geo_point": "41.12,-71.34" } - - - do: - index: - index: test - id: 3 - body: { "keyword": "bar", "long": [100, 0], "geo_point": "90.0,0.0", "nested": [{"nested_long": 10}, {"nested_long": 0}] } - - - do: - index: - index: test - id: 4 - body: { "keyword": "bar", "long": [1000, 0], "geo_point": "41.12,-71.34", "nested": [{"nested_long": 1000}, {"nested_long": 20}] } - - - do: - index: - index: test - id: 5 - body: { "date": "2017-10-20T03:08:45" } - - - do: - index: - index: test - id: 6 - body: { "date": "2017-10-21T07:00:00" } - - - do: - index: - index: other - id: 0 - body: { "date": "2017-10-20T03:08:45" } - - - do: - indices.refresh: - index: [test, other] - ---- -"Simple Composite aggregation": - - skip: - version: " - 6.0.99" - reason: this uses a new API that has been added in 6.1 - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - composite: - sources: [ - "kw": { - "terms": { - "field": "keyword" - } - } - ] - - - match: {hits.total: 6} - - length: { aggregations.test.buckets: 2 } - - match: { aggregations.test.buckets.0.key.kw: "bar" } - - match: { aggregations.test.buckets.0.doc_count: 3 } - - match: { aggregations.test.buckets.1.key.kw: "foo" } - - match: { aggregations.test.buckets.1.doc_count: 2 } - ---- -"Nested Composite aggregation": - - skip: - version: " - 6.0.99" - reason: this uses a new API that has been added in 6.1 - - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - composite: - sources: [ - { - "long": { - "terms": { - "field": "long" - } - } - }, - { - "kw": { - "terms": { - "field": "keyword" - } - } - } - ] - - - match: {hits.total: 6} - - length: { aggregations.test.buckets: 5 } - - match: { aggregations.test.buckets.0.key.long: 0} - - match: { aggregations.test.buckets.0.key.kw: "bar" } - - match: { aggregations.test.buckets.0.doc_count: 2 } - - match: { aggregations.test.buckets.1.key.long: 10 } - - match: { aggregations.test.buckets.1.key.kw: "foo"} - - match: { aggregations.test.buckets.1.doc_count: 1 } - - match: { aggregations.test.buckets.2.key.long: 20 } - - match: { aggregations.test.buckets.2.key.kw: "foo" } - - match: { aggregations.test.buckets.2.doc_count: 1 } - - match: { aggregations.test.buckets.3.key.long: 100} - - match: { aggregations.test.buckets.3.key.kw: "bar" } - - match: { aggregations.test.buckets.3.doc_count: 1 } - - match: { aggregations.test.buckets.4.key.long: 1000 } - - match: { aggregations.test.buckets.4.key.kw: "bar" } - - match: { aggregations.test.buckets.4.doc_count: 1 } - ---- -"Aggregate After": - - skip: - version: " - 6.0.99" - reason: this uses a new API that has been added in 6.1 - - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - composite: - sources: [ - { - "long": { - "terms": { - "field": "long" - } - } - }, - { - "kw": { - "terms": { - "field": "keyword" - } - } - } - ] - after: { "long": 20, "kw": "foo" } - - - match: {hits.total: 6} - - length: { aggregations.test.buckets: 2 } - - match: { aggregations.test.buckets.0.key.long: 100 } - - match: { aggregations.test.buckets.0.key.kw: "bar" } - - match: { aggregations.test.buckets.0.doc_count: 1 } - - match: { aggregations.test.buckets.1.key.long: 1000 } - - match: { aggregations.test.buckets.1.key.kw: "bar" } - - match: { aggregations.test.buckets.1.doc_count: 1 } - ---- -"Aggregate After Missing": - - skip: - version: " - 6.1.99" - reason: bug fixed in 6.2.0 - - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - composite: - sources: [ - { - "kw": { - "terms": { - "field": "keyword" - } - } - } - ] - after: { "kw": "delta" } - - - match: {hits.total: 6} - - length: { aggregations.test.buckets: 1 } - - match: { aggregations.test.buckets.0.key.kw: "foo" } - - match: { aggregations.test.buckets.0.doc_count: 2 } - ---- -"Invalid Composite aggregation": - - skip: - version: " - 6.0.99" - reason: this uses a new API that has been added in 6.1 - - - do: - catch: /\[composite\] aggregation cannot be used with a parent aggregation/ - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - terms: - field: long - aggs: - nested: - composite: - sources: [ - { - "kw": { - "terms": { - "field": "keyword" - } - } - } - ] - ---- -"Composite aggregation with format": - - skip: - version: " - 7.1.99" - reason: calendar_interval introduced in 7.2.0 - features: warnings - - - do: - warnings: - - '[interval] on [date_histogram] is deprecated, use [fixed_interval] or [calendar_interval] in the future.' - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - composite: - sources: [ - { - "date": { - "date_histogram": { - "field": "date", - "interval": "1d", - "format": "strict_date" - } - } - } - ] - - - match: {hits.total: 6} - - length: { aggregations.test.buckets: 2 } - - match: { aggregations.test.buckets.0.key.date: "2017-10-20" } - - match: { aggregations.test.buckets.0.doc_count: 1 } - - match: { aggregations.test.buckets.1.key.date: "2017-10-21" } - - match: { aggregations.test.buckets.1.doc_count: 1 } - - - do: - warnings: - - '[interval] on [date_histogram] is deprecated, use [fixed_interval] or [calendar_interval] in the future.' - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - composite: - after: { - date: "2017-10-20" - } - sources: [ - { - "date": { - "date_histogram": { - "field": "date", - "interval": "1d", - "format": "strict_date" - } - } - } - ] - - - match: {hits.total: 6} - - length: { aggregations.test.buckets: 1 } - - match: { aggregations.test.buckets.0.key.date: "2017-10-21" } - - match: { aggregations.test.buckets.0.doc_count: 1 } - ---- -"Composite aggregation with format and calendar_interval": - - skip: - version: " - 7.1.99" - reason: calendar_interval introduced in 7.2.0 - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - composite: - sources: [ - { - "date": { - "date_histogram": { - "field": "date", - "calendar_interval": "1d", - "format": "strict_date" - } - } - } - ] - - - match: {hits.total: 6} - - length: { aggregations.test.buckets: 2 } - - match: { aggregations.test.buckets.0.key.date: "2017-10-20" } - - match: { aggregations.test.buckets.0.doc_count: 1 } - - match: { aggregations.test.buckets.1.key.date: "2017-10-21" } - - match: { aggregations.test.buckets.1.doc_count: 1 } - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - composite: - after: { - date: "2017-10-20" - } - sources: [ - { - "date": { - "date_histogram": { - "field": "date", - "calendar_interval": "1d", - "format": "strict_date" - } - } - } - ] - - - match: {hits.total: 6} - - length: { aggregations.test.buckets: 1 } - - match: { aggregations.test.buckets.0.key.date: "2017-10-21" } - - match: { aggregations.test.buckets.0.doc_count: 1 } - ---- -"Composite aggregation with date_histogram offset": - - skip: - version: " - 7.5.99" - reason: offset introduced in 7.6.0 - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - composite: - sources: [ - { - "date": { - "date_histogram": { - "field": "date", - "calendar_interval": "1d", - "offset": "4h", - "format": "iso8601" # Format makes the comparisons a little more obvious - } - } - } - ] - - - match: {hits.total: 6} - - length: { aggregations.test.buckets: 2 } - - match: { aggregations.test.buckets.0.key.date: "2017-10-19T04:00:00.000Z" } - - match: { aggregations.test.buckets.0.doc_count: 1 } - - match: { aggregations.test.buckets.1.key.date: "2017-10-21T04:00:00.000Z" } - - match: { aggregations.test.buckets.1.doc_count: 1 } - ---- -"Composite aggregation with after_key in the response": - - skip: - version: " - 6.2.99" - reason: starting in 6.3.0 after_key is returned in the response - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - composite: - sources: [ - { - "keyword": { - "terms": { - "field": "keyword", - } - } - } - ] - - - match: {hits.total: 6} - - length: { aggregations.test.buckets: 2 } - - length: { aggregations.test.after_key: 1 } - - match: { aggregations.test.after_key.keyword: "foo" } - ---- -"Composite aggregation and array size": - - skip: - version: " - 6.99.99" - reason: starting in 7.0 the composite aggregation throws an execption if the provided size is greater than search.max_buckets. - - - do: - catch: /.*Trying to create too many buckets.*/ - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - composite: - size: 1000000000 - sources: [ - { - "keyword": { - "terms": { - "field": "keyword", - } - } - } - ] - ---- -"Composite aggregation with nested parent": - - skip: - version: " - 6.99.99" - reason: the ability to set a nested parent aggregation was added in 7.0. - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - 1: - nested: - path: nested - aggs: - 2: - composite: - sources: [ - "nested": { - "terms": { - "field": "nested.nested_long" - } - } - ] - - - match: {hits.total: 6} - - length: { aggregations.1.2.buckets: 4 } - - match: { aggregations.1.2.buckets.0.key.nested: 0 } - - match: { aggregations.1.2.buckets.0.doc_count: 1 } - - match: { aggregations.1.2.buckets.1.key.nested: 10 } - - match: { aggregations.1.2.buckets.1.doc_count: 2 } - - match: { aggregations.1.2.buckets.2.key.nested: 20 } - - match: { aggregations.1.2.buckets.2.doc_count: 2 } - - match: { aggregations.1.2.buckets.3.key.nested: 1000 } - - match: { aggregations.1.2.buckets.3.doc_count: 1 } - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - 1: - nested: - path: nested - aggs: - 2: - composite: - after: { "nested": 10 } - sources: [ - "nested": { - "terms": { - "field": "nested.nested_long" - } - } - ] - - - match: {hits.total: 6} - - length: { aggregations.1.2.buckets: 2 } - - match: { aggregations.1.2.buckets.0.key.nested: 20 } - - match: { aggregations.1.2.buckets.0.doc_count: 2 } - - match: { aggregations.1.2.buckets.1.key.nested: 1000 } - - match: { aggregations.1.2.buckets.1.doc_count: 1 } - ---- -"Composite aggregation with unmapped field": - - skip: - version: " - 7.1.99" - reason: starting in 7.2 the composite aggregation handles unmapped fields as keywords - - - do: - search: - rest_total_hits_as_int: true - index: [test, other] - body: - aggregations: - test: - composite: - sources: [ - { - "long": { - "terms": { - "field": "long" - } - } - }, - { - "kw": { - "terms": { - "field": "keyword" - } - } - } - ] - - - match: {hits.total: 7} - - length: { aggregations.test.buckets: 5 } - - match: { aggregations.test.buckets.0.key.long: 0} - - match: { aggregations.test.buckets.0.key.kw: "bar" } - - match: { aggregations.test.buckets.0.doc_count: 2 } - - match: { aggregations.test.buckets.1.key.long: 10 } - - match: { aggregations.test.buckets.1.key.kw: "foo"} - - match: { aggregations.test.buckets.1.doc_count: 1 } - - match: { aggregations.test.buckets.2.key.long: 20 } - - match: { aggregations.test.buckets.2.key.kw: "foo" } - - match: { aggregations.test.buckets.2.doc_count: 1 } - - match: { aggregations.test.buckets.3.key.long: 100} - - match: { aggregations.test.buckets.3.key.kw: "bar" } - - match: { aggregations.test.buckets.3.doc_count: 1 } - - match: { aggregations.test.buckets.4.key.long: 1000 } - - match: { aggregations.test.buckets.4.key.kw: "bar" } - - match: { aggregations.test.buckets.4.doc_count: 1 } - - - do: - search: - rest_total_hits_as_int: true - index: [test, other] - body: - aggregations: - test: - composite: - after: { "long": 100, "kw": "bar" } - sources: [ - { - "long": { - "terms": { - "field": "long" - } - } - }, - { - "kw": { - "terms": { - "field": "keyword" - } - } - } - ] - - - match: {hits.total: 7} - - length: { aggregations.test.buckets: 1 } - - match: { aggregations.test.buckets.0.key.long: 1000 } - - match: { aggregations.test.buckets.0.key.kw: "bar" } - - match: { aggregations.test.buckets.0.doc_count: 1 } - ---- -"Missing source": - - skip: - version: " - 7.1.99" - reason: null/empty sources disallowed in 7.2 - - - do: - catch: /Composite \[sources\] cannot be null or empty/ - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - composite: - sources: [] - - - do: - catch: /Required \[sources\]/ - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - composite: - size: 1 - - ---- -"Duplicate sources": - - skip: - version: " - 7.1.99" - reason: duplicate names disallowed in 7.2 - - - do: - catch: /Composite source names must be unique, found duplicates[:] \[keyword\]/ - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - composite: - sources: [ - { - "keyword": { - "terms": { - "field": "keyword", - } - } - }, - { - "keyword": { - "terms": { - "field": "keyword", - } - } - } - ] - ---- -"Simple Composite aggregation with GeoTile grid": - - skip: - version: " - 7.4.99" - reason: geotile_grid is not supported until 7.5.0 - - do: - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - composite: - sources: [ - "geo": { - "geotile_grid": { - "field": "geo_point", - "precision": 12 - } - }, - { - "kw": { - "terms": { - "field": "keyword" - } - } - } - ] - - - match: {hits.total: 6} - - length: { aggregations.test.buckets: 4 } - - match: { aggregations.test.buckets.0.key.geo: "12/730/1590" } - - match: { aggregations.test.buckets.0.key.kw: "foo" } - - match: { aggregations.test.buckets.0.doc_count: 1 } - - match: { aggregations.test.buckets.1.key.geo: "12/1236/1533" } - - match: { aggregations.test.buckets.1.key.kw: "bar" } - - match: { aggregations.test.buckets.1.doc_count: 2 } - - match: { aggregations.test.buckets.2.key.geo: "12/1236/1533" } - - match: { aggregations.test.buckets.2.key.kw: "foo" } - - match: { aggregations.test.buckets.2.doc_count: 1 } - - match: { aggregations.test.buckets.3.key.geo: "12/2048/0" } - - match: { aggregations.test.buckets.3.key.kw: "bar" } - - match: { aggregations.test.buckets.3.doc_count: 1 } - ---- -"Simple Composite aggregation with geotile grid add aggregate after": - - skip: - version: " - 7.4.99" - reason: geotile_grid is not supported until 7.5.0 - - do: - search: - index: test - body: - aggregations: - test: - composite: - sources: [ - "geo": { - "geotile_grid": { - "field": "geo_point", - "precision": 12 - } - }, - { - "kw": { - "terms": { - "field": "keyword" - } - } - } - ] - after: { "geo": "12/730/1590", "kw": "foo" } - - - match: { hits.total.value: 6 } - - match: { hits.total.relation: "eq" } - - length: { aggregations.test.buckets: 3 } - - match: { aggregations.test.buckets.0.key.geo: "12/1236/1533" } - - match: { aggregations.test.buckets.0.key.kw: "bar" } - - match: { aggregations.test.buckets.0.doc_count: 2 } - - match: { aggregations.test.buckets.1.key.geo: "12/1236/1533" } - - match: { aggregations.test.buckets.1.key.kw: "foo" } - - match: { aggregations.test.buckets.1.doc_count: 1 } - - match: { aggregations.test.buckets.2.key.geo: "12/2048/0" } - - match: { aggregations.test.buckets.2.key.kw: "bar" } - - match: { aggregations.test.buckets.2.doc_count: 1 } - ---- -"Mixed ip and unmapped fields": - - skip: - version: " - 7.5.99" - reason: This will fail against 7.x until the fix is backported there - # It is important that the index *without* the ip field be sorted *before* - # the index *with* the ip field because that has caused bugs in the past. - - do: - indices.create: - index: test_1 - - do: - indices.create: - index: test_2 - body: - mappings: - properties: - f: - type: ip - - do: - index: - index: test_2 - id: 1 - body: { "f": "192.168.0.1" } - refresh: true - - - do: - search: - index: test_* - body: - aggregations: - test: - composite: - sources: [ - "f": { - "terms": { - "field": "f" - } - } - ] - - - match: { hits.total.value: 1 } - - match: { hits.total.relation: eq } - - length: { aggregations.test.buckets: 1 } - - match: { aggregations.test.buckets.0.key.f: "192.168.0.1" } - - match: { aggregations.test.buckets.0.doc_count: 1 } - ---- -"date_histogram with time_zone": - - skip: - version: " - 7.6.0" - reason: Fixed in 7.6.0 - - do: - index: - index: test - id: 7 - body: { "date": "2017-10-22T01:00:00" } - refresh: true - - do: - search: - index: test - body: - aggregations: - test: - composite: - sources: [ - { - "date": { - "date_histogram": { - "field": "date", - "calendar_interval": "1d", - "time_zone": "-02:00", - "format": "iso8601" # Format makes the comparisons a little more obvious - } - } - } - ] - - - match: { hits.total.value: 7 } - - match: { hits.total.relation: eq } - - length: { aggregations.test.buckets: 2 } - - match: { aggregations.test.buckets.0.key.date: "2017-10-20T00:00:00.000-02:00" } - - match: { aggregations.test.buckets.0.doc_count: 1 } - - match: { aggregations.test.buckets.1.key.date: "2017-10-21T00:00:00.000-02:00" } - - match: { aggregations.test.buckets.1.doc_count: 2 } - - - do: - search: - index: test - body: - aggregations: - test: - composite: - after: { - date: "2017-10-20" - } - sources: [ - { - "date": { - "date_histogram": { - "field": "date", - "calendar_interval": "1d", - "time_zone": "-02:00", - "format": "iso8601" # Format makes the comparisons a little more obvious - } - } - } - ] - - - match: { hits.total.value: 7 } - - match: { hits.total.relation: eq } - - length: { aggregations.test.buckets: 1 } - - match: { aggregations.test.buckets.0.key.date: "2017-10-21T00:00:00.000-02:00" } - - match: { aggregations.test.buckets.0.doc_count: 2 } - ---- -"date_histogram on date_nanos": - - skip: - version: " - 7.6.99" - reason: Fixed in 7.7.0 - - do: - indices.create: - index: test_nanos - body: - mappings: - properties: - date_nanos: - type: date_nanos - - - do: - index: - index: test_nanos - id: 7 - body: { "date_nanos": "2017-11-21T01:00:00" } - refresh: true - - do: - index: - index: test_nanos - id: 8 - body: { "date_nanos": "2017-11-22T01:00:00" } - refresh: true - - do: - index: - index: test_nanos - id: 9 - body: { "date_nanos": "2017-11-22T02:00:00" } - refresh: true - - do: - search: - index: test_nanos - body: - aggregations: - test: - composite: - sources: - - date: - date_histogram: - field: date_nanos - calendar_interval: 1d - format: iso8601 # Format makes the comparisons a little more obvious - aggregations: - avg: - avg: - field: date_nanos - - - match: { hits.total.value: 3 } - - match: { hits.total.relation: eq } - - length: { aggregations.test.buckets: 2 } - - match: { aggregations.test.buckets.0.key.date: "2017-11-21T00:00:00.000Z" } - - match: { aggregations.test.buckets.0.doc_count: 1 } - - match: { aggregations.test.buckets.0.avg.value_as_string: "2017-11-21T01:00:00.000Z" } - - match: { aggregations.test.buckets.1.key.date: "2017-11-22T00:00:00.000Z" } - - match: { aggregations.test.buckets.1.doc_count: 2 } - - match: { aggregations.test.buckets.1.avg.value_as_string: "2017-11-22T01:30:00.000Z" } - ---- -"Terms source from sorted": - - do: - indices.create: - index: sorted_test - body: - settings: - sort.field: keyword - mappings: - properties: - keyword: - type: keyword - long: - type: long - - - - do: - index: - index: sorted_test - id: 2 - refresh: true - body: { "keyword": "foo", "long": 1 } - - - do: - search: - index: sorted_test - rest_total_hits_as_int: true - body: - aggregations: - test: - composite: - sources: - - keyword: - terms: - field: keyword - - - match: {hits.total: 1} - - length: { aggregations.test.buckets: 1 } - - match: { aggregations.test.buckets.0.key.keyword: "foo" } - - match: { aggregations.test.buckets.0.doc_count: 1 } - ---- -"Terms source from part of sorted": - - skip: - version: " - 7.6.99" - reason: fixed in 7.7.0 - - - do: - indices.create: - index: sorted_test - body: - settings: - sort.field: [keyword, long] - mappings: - properties: - keyword: - type: keyword - long: - type: long - - - - do: - index: - index: sorted_test - id: 2 - refresh: true - body: { "keyword": "foo", "long": 1 } - - - do: - search: - index: sorted_test - body: - aggregations: - test: - composite: - sources: - - keyword: - terms: - field: keyword - - - match: {hits.total.value: 1} - - length: { aggregations.test.buckets: 1 } - - match: { aggregations.test.buckets.0.key.keyword: "foo" } - - match: { aggregations.test.buckets.0.doc_count: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml deleted file mode 100644 index 1b23eea01b75b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml +++ /dev/null @@ -1,121 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test - body: - mappings: - properties: - keyword: - type: keyword - date: - type: date - - - do: - index: - index: test - id: 1 - body: { "date": "2014-03-03T00:00:00", "keyword": "dgx" } - - - do: - index: - index: test - id: 2 - body: { "date": "2015-03-03T00:00:00", "keyword": "dfs" } - - - do: - index: - index: test - id: 3 - body: { "date": "2016-03-03T00:00:00", "keyword": "foobar" } - - - do: - index: - index: test - id: 4 - body: { "date": "2017-03-03T00:00:00", "keyword": "foo" } - - - do: - index: - index: test - id: 5 - body: { "date": "2018-03-03T00:00:00", "keyword": "bar" } - - - do: - index: - index: test - id: 6 - body: { "date": "2019-03-03T00:00:00", "keyword": "baz" } - - - do: - index: - index: test - id: 7 - body: { "date": "2020-03-03T00:00:00", "keyword": "qux" } - - - do: - index: - index: test - id: 8 - body: { "date": "2021-03-03T00:00:00", "keyword": "quux" } - - - - do: - indices.refresh: - index: [test] - ---- - teardown: - - - do: - cluster.put_settings: - body: - transient: - search.max_buckets: null - ---- -"Max bucket": - - skip: - version: " - 6.99.99" - reason: search.max_buckets limit has been added in 7.0 - - - do: - cluster.put_settings: - body: - transient: - search.max_buckets: 3 - - - do: - catch: /.*Trying to create too many buckets.*/ - search: - rest_total_hits_as_int: true - allow_partial_search_results: false - index: test - body: - aggregations: - test: - terms: - field: keyword - - - do: - cluster.put_settings: - body: - transient: - search.max_buckets: 6 - - - do: - catch: /.*Trying to create too many buckets.*/ - search: - rest_total_hits_as_int: true - allow_partial_search_results: false - index: test - body: - aggregations: - test: - terms: - field: keyword - aggs: - 2: - terms: - field: date - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/250_moving_fn.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/250_moving_fn.yml deleted file mode 100644 index 14e626b94e79a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/250_moving_fn.yml +++ /dev/null @@ -1,82 +0,0 @@ -setup: - - skip: - version: " - 6.3.99" - reason: "moving_fn added in 6.4.0" - ---- -"Bad window": - - - skip: - version: " - 7.1.99" - reason: "calendar_interval added in 7.2" - - - do: - catch: /\[window\] must be a positive, non-zero integer\./ - search: - rest_total_hits_as_int: true - body: - size: 0 - aggs: - the_histo: - date_histogram: - field: "date" - calendar_interval: "1d" - aggs: - the_avg: - avg: - field: "value_field" - the_mov_fn: - moving_fn: - buckets_path: "the_avg" - window: -1 - script: "MovingFunctions.windowMax(values)" - ---- -"Bad window deprecated interval": - - - skip: - version: " - 7.1.99" - reason: "interval deprecation added in 7.2" - features: "warnings" - - - do: - catch: /\[window\] must be a positive, non-zero integer\./ - warnings: - - "[interval] on [date_histogram] is deprecated, use [fixed_interval] or [calendar_interval] in the future." - search: - rest_total_hits_as_int: true - body: - size: 0 - aggs: - the_histo: - date_histogram: - field: "date" - interval: "1d" - aggs: - the_avg: - avg: - field: "value_field" - the_mov_fn: - moving_fn: - buckets_path: "the_avg" - window: -1 - script: "MovingFunctions.windowMax(values)" ---- -"Not under date_histo": - - - do: - catch: /\[window\] must be a positive, non-zero integer\./ - search: - rest_total_hits_as_int: true - body: - size: 0 - aggs: - the_avg: - avg: - field: "value_field" - the_mov_fn: - moving_fn: - buckets_path: "the_avg" - window: -1 - script: "MovingFunctions.windowMax(values)" - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/260_weighted_avg.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/260_weighted_avg.yml deleted file mode 100644 index c5988fc9e5dc4..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/260_weighted_avg.yml +++ /dev/null @@ -1,69 +0,0 @@ -setup: - - skip: - version: " - 6.3.99" - reason: weighted_avg is only available as of 6.4.0 - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - int_field: - type : integer - double_field: - type : double - string_field: - type: keyword - - - do: - bulk: - refresh: true - body: - - index: - _index: test_1 - _id: 1 - - int_field: 1 - double_field: 1.0 - - index: - _index: test_1 - _id: 2 - - int_field: 2 - double_field: 2.0 - - index: - _index: test_1 - _id: 3 - - int_field: 3 - double_field: 3.0 - - index: - _index: test_1 - _id: 4 - - int_field: 4 - double_field: 4.0 - ---- -"Basic test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - the_int_avg: - weighted_avg: - value: - field: "int_field" - weight: - field: "int_field" - the_double_avg: - weighted_avg: - value: - field: "double_field" - weight: - field: "double_field" - - - match: { hits.total: 4 } - - length: { hits.hits: 4 } - - match: { aggregations.the_int_avg.value: 3.0 } - - match: { aggregations.the_double_avg.value: 3.0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/270_median_absolute_deviation_metric.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/270_median_absolute_deviation_metric.yml deleted file mode 100644 index 0cba08fccae9b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/270_median_absolute_deviation_metric.yml +++ /dev/null @@ -1,145 +0,0 @@ -setup: - - skip: - version: " - 6.5.99" - reason: "added in 6.6.0" - - do: - indices.create: - index: test - body: - settings: - number_of_replicas: 0 - mappings: - properties: - int_field: - type: integer - double_field: - type: double - incomplete_field: - type: integer - - do: - bulk: - refresh: true - body: - - index: - _index: test - - int_field: 100 - double_field: 100.0 - incomplete_field: 1000 - - index: - _index: test - - int_field: 200 - double_field: 200.0 - incomplete_field: 2000 - - index: - _index: test - - int_field: 300 - double_field: 300.0 - ---- -"basic test": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - mad_int: - median_absolute_deviation: - field: int_field - mad_double: - median_absolute_deviation: - field: double_field - - - match: { hits.total: 3 } - - length: { hits.hits: 3 } - - - match: { aggregations.mad_int.value: 100 } - - match: { aggregations.mad_double.value: 100 } - ---- -"with setting compression": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - mad_int: - median_absolute_deviation: - field: int_field - compression: 500 - mad_double: - median_absolute_deviation: - field: double_field - compression: 500 - - - match: { hits.total: 3 } - - length: { hits.hits: 3 } - - - match: { aggregations.mad_int.value: 100 } - - match: { aggregations.mad_double.value: 100 } - ---- -"no documents": - - - do: - search: - rest_total_hits_as_int: true - body: - query: - bool: - filter: - term: - non_existent_field: non_existent_value - aggs: - mad_no_docs: - median_absolute_deviation: - field: non_existent_field - - - match: { hits.total: 0 } - - length: { hits.hits: 0 } - - - match: { aggregations.mad_no_docs.value: null } - ---- -"missing value": - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - mad_missing: - median_absolute_deviation: - field: incomplete_field - missing: 3000 - - - match: { hits.total: 3 } - - length: { hits.hits: 3 } - - - match: { aggregations.mad_missing.value: 1000 } - ---- -"bad arguments": - - - do: - catch: /\[compression\] must be greater than 0. Found \[0.0\] in \[mad\]/ - search: - rest_total_hits_as_int: true - body: - aggs: - mad: - median_absolute_deviation: - field: int_field - compression: 0 - - - do: - catch: /\[compression\] must be greater than 0. Found \[-1.0\] in \[mad\]/ - search: - rest_total_hits_as_int: true - body: - aggs: - mad: - median_absolute_deviation: - field: int_field - compression: -1 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_geohash_grid.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_geohash_grid.yml deleted file mode 100644 index 534e552fc0ea2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_geohash_grid.yml +++ /dev/null @@ -1,62 +0,0 @@ -setup: - - do: - indices.create: - include_type_name: false - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - location: - type: geo_point - ---- -"Basic test": - - do: - bulk: - refresh: true - body: - - index: - _index: test_1 - _id: 1 - - location: "52.374081,4.912350" - - index: - _index: test_1 - _id: 2 - - location: "52.369219,4.901618" - - index: - _index: test_1 - _id: 3 - - location: "52.371667,4.914722" - - index: - _index: test_1 - _id: 4 - - location: "51.222900,4.405200" - - index: - _index: test_1 - _id: 5 - - location: "48.861111,2.336389" - - index: - _index: test_1 - _id: 6 - - location: "48.860000,2.327000" - - - do: - search: - rest_total_hits_as_int: true - body: - aggregations: - grid: - geohash_grid: - field: location - precision: 3 - - - - match: { hits.total: 6 } - - match: { aggregations.grid.buckets.0.key: u17 } - - match: { aggregations.grid.buckets.0.doc_count: 3 } - - match: { aggregations.grid.buckets.1.key: u09 } - - match: { aggregations.grid.buckets.1.doc_count: 2 } - - match: { aggregations.grid.buckets.2.key: u15 } - - match: { aggregations.grid.buckets.2.doc_count: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_rare_terms.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_rare_terms.yml deleted file mode 100644 index 6d1e2d606a4b2..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/280_rare_terms.yml +++ /dev/null @@ -1,362 +0,0 @@ -setup: - - skip: - version: " - 7.2.99" - reason: RareTerms added in 7.3.0 - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - str: - type: keyword - ip: - type: ip - boolean: - type: boolean - integer: - type: long - number: - type: long - date: - type: date - - - - do: - cluster.health: - wait_for_status: green - ---- -"Basic test": - - do: - index: - index: test_1 - id: 1 - body: { "str" : "abc" } - - - do: - index: - index: test_1 - id: 2 - body: { "str": "abc" } - - - do: - index: - index: test_1 - id: 3 - body: { "str": "bcd" } - - - do: - indices.refresh: {} - - - do: - search: - body: { "size" : 0, "aggs" : { "str_terms" : { "rare_terms" : { "field" : "str", "max_doc_count" : 1 } } } } - - - match: { hits.total.value: 3 } - - length: { aggregations.str_terms.buckets: 1 } - - match: { aggregations.str_terms.buckets.0.key: "bcd" } - - is_false: aggregations.str_terms.buckets.0.key_as_string - - match: { aggregations.str_terms.buckets.0.doc_count: 1 } - ---- -"IP test": - - do: - index: - index: test_1 - id: 1 - body: { "ip": "::1" } - - - do: - index: - index: test_1 - id: 2 - body: { "ip": "127.0.0.1" } - - - do: - index: - index: test_1 - id: 3 - body: { "ip": "::1" } - - - do: - indices.refresh: {} - - - do: - search: - body: { "size" : 0, "aggs" : { "ip_terms" : { "rare_terms" : { "field" : "ip" } } } } - - - match: { hits.total.value: 3 } - - length: { aggregations.ip_terms.buckets: 1 } - - match: { aggregations.ip_terms.buckets.0.key: "127.0.0.1" } - - is_false: aggregations.ip_terms.buckets.0.key_as_string - - match: { aggregations.ip_terms.buckets.0.doc_count: 1 } - - - do: - search: - body: { "size" : 0, "aggs" : { "ip_terms" : { "rare_terms" : { "field" : "ip", "include" : [ "127.0.0.1" ] } } } } - - - match: { hits.total.value: 3 } - - length: { aggregations.ip_terms.buckets: 1 } - - match: { aggregations.ip_terms.buckets.0.key: "127.0.0.1" } - - is_false: aggregations.ip_terms.buckets.0.key_as_string - - match: { aggregations.ip_terms.buckets.0.doc_count: 1 } - - - do: - search: - body: { "size" : 0, "aggs" : { "ip_terms" : { "rare_terms" : { "field" : "ip", "exclude" : [ "127.0.0.1" ] } } } } - - - match: { hits.total.value: 3 } - - length: { aggregations.ip_terms.buckets: 0 } - - - do: - catch: request - search: - index: test_1 - body: { "size" : 0, "aggs" : { "ip_terms" : { "rare_terms" : { "field" : "ip", "exclude" : "127.*" } } } } - - - ---- -"Boolean test": - - do: - index: - index: test_1 - id: 1 - body: { "boolean": true } - - - do: - index: - index: test_1 - id: 2 - body: { "boolean": false } - - - do: - index: - index: test_1 - id: 3 - body: { "boolean": true } - - - do: - indices.refresh: {} - - - do: - search: - body: { "size" : 0, "aggs" : { "boolean_terms" : { "rare_terms" : { "field" : "boolean" } } } } - - - match: { hits.total.value: 3 } - - length: { aggregations.boolean_terms.buckets: 1 } - - match: { aggregations.boolean_terms.buckets.0.key: 0 } - - match: { aggregations.boolean_terms.buckets.0.key_as_string: "false" } - - match: { aggregations.boolean_terms.buckets.0.doc_count: 1 } - ---- -"Integer test": - - do: - index: - index: test_1 - id: 1 - body: { "integer": 1234 } - - - do: - index: - index: test_1 - id: 2 - body: { "integer": 5678 } - - - do: - index: - index: test_1 - id: 3 - body: { "integer": 1234 } - - - do: - indices.refresh: {} - - - do: - search: - body: { "size" : 0, "aggs" : { "integer_terms" : { "rare_terms" : { "field" : "integer" } } } } - - - match: { hits.total.value: 3 } - - - length: { aggregations.integer_terms.buckets: 1 } - - - match: { aggregations.integer_terms.buckets.0.key: 5678 } - - is_false: aggregations.integer_terms.buckets.0.key_as_string - - match: { aggregations.integer_terms.buckets.0.doc_count: 1 } - ---- -"Date test": - - do: - index: - index: test_1 - id: 1 - body: { "date": "2016-05-03" } - - - do: - index: - index: test_1 - id: 2 - body: { "date": "2014-09-01" } - - - do: - index: - index: test_1 - id: 3 - body: { "date": "2016-05-03" } - - - do: - indices.refresh: {} - - - do: - search: - body: { "size" : 0, "aggs" : { "date_terms" : { "rare_terms" : { "field" : "date" } } } } - - - match: { hits.total.value: 3 } - - - length: { aggregations.date_terms.buckets: 1 } - - match: { aggregations.date_terms.buckets.0.key: 1409529600000 } - - match: { aggregations.date_terms.buckets.0.key_as_string: "2014-09-01T00:00:00.000Z" } - - match: { aggregations.date_terms.buckets.0.doc_count: 1 } - - - do: - search: - body: { "size" : 0, "aggs" : { "date_terms" : { "rare_terms" : { "field" : "date", "include" : [ "2014-09-01" ] } } } } - - - match: { hits.total.value: 3 } - - length: { aggregations.date_terms.buckets: 1 } - - match: { aggregations.date_terms.buckets.0.key_as_string: "2014-09-01T00:00:00.000Z" } - - match: { aggregations.date_terms.buckets.0.doc_count: 1 } - - - do: - search: - body: { "size" : 0, "aggs" : { "date_terms" : { "rare_terms" : { "field" : "date", "exclude" : [ "2014-09-01" ] } } } } - - - match: { hits.total.value: 3 } - - length: { aggregations.date_terms.buckets: 0 } - ---- -"Unmapped strings": - - - do: - index: - index: test_1 - id: 1 - body: {} - - - do: - indices.refresh: {} - - - do: - search: - body: { "size" : 0, "aggs" : { "string_terms" : { "rare_terms" : { "field" : "unmapped_string"} } } } - - - match: { hits.total.value: 1 } - - length: { aggregations.string_terms.buckets: 0 } - ---- -"Unmapped booleans": - - - do: - index: - index: test_1 - id: 1 - body: {} - - - do: - indices.refresh: {} - - - do: - search: - body: { "size" : 0, "aggs" : { "boolean_terms" : { "rare_terms" : { "field" : "unmapped_boolean" } } } } - - - match: { hits.total.value: 1 } - - length: { aggregations.boolean_terms.buckets: 0 } - ---- -"Unmapped dates": - - - do: - index: - index: test_1 - id: 1 - body: {} - - - do: - indices.refresh: {} - - - do: - search: - body: { "size" : 0, "aggs" : { "date_terms" : { "rare_terms" : { "field" : "unmapped_date"} } } } - - - match: { hits.total.value: 1 } - - length: { aggregations.date_terms.buckets: 0 } - ---- -"Unmapped longs": - - - do: - index: - index: test_1 - id: 1 - body: {} - - - do: - indices.refresh: {} - - - do: - search: - body: { "size" : 0, "aggs" : { "long_terms" : { "rare_terms" : { "field" : "unmapped_long", "value_type" : "long" } } } } - - - match: { hits.total.value: 1 } - - length: { aggregations.long_terms.buckets: 0 } - ---- -"sub aggs": - - skip: - version: " - 7.6.1" - reason: Sub aggs fixed in 7.6.1 - - - do: - index: - refresh: true - index: test_1 - id: 1 - body: { "str" : "abc", "number": 1 } - - - do: - index: - refresh: true - index: test_1 - id: 2 - body: { "str": "abc", "number": 2 } - - - do: - index: - refresh: true - index: test_1 - id: 3 - body: { "str": "bcd", "number": 3 } - - - do: - search: - body: - size: 0 - aggs: - str_terms: - rare_terms: - field: str - max_doc_count: 1 - aggs: - max_n: - max: - field: number - - - match: { hits.total.value: 3 } - - length: { aggregations.str_terms.buckets: 1 } - - match: { aggregations.str_terms.buckets.0.key: "bcd" } - - is_false: aggregations.str_terms.buckets.0.key_as_string - - match: { aggregations.str_terms.buckets.0.doc_count: 1 } - - match: { aggregations.str_terms.buckets.0.max_n.value: 3.0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/290_geotile_grid.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/290_geotile_grid.yml deleted file mode 100644 index 2db498a0cacf0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/290_geotile_grid.yml +++ /dev/null @@ -1,65 +0,0 @@ -setup: - - skip: - version: " - 6.99.99" - reason: "added in 7.0.0" - - do: - indices.create: - include_type_name: false - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - location: - type: geo_point - ---- -"Basic test": - - do: - bulk: - refresh: true - body: - - index: - _index: test_1 - _id: 1 - - location: "52.374081,4.912350" - - index: - _index: test_1 - _id: 2 - - location: "52.369219,4.901618" - - index: - _index: test_1 - _id: 3 - - location: "52.371667,4.914722" - - index: - _index: test_1 - _id: 4 - - location: "51.222900,4.405200" - - index: - _index: test_1 - _id: 5 - - location: "48.861111,2.336389" - - index: - _index: test_1 - _id: 6 - - location: "48.860000,2.327000" - - - do: - search: - rest_total_hits_as_int: true - body: - aggregations: - grid: - geotile_grid: - field: location - precision: 8 - - - - match: { hits.total: 6 } - - match: { aggregations.grid.buckets.0.key: "8/131/84" } - - match: { aggregations.grid.buckets.0.doc_count: 3 } - - match: { aggregations.grid.buckets.1.key: "8/129/88" } - - match: { aggregations.grid.buckets.1.doc_count: 2 } - - match: { aggregations.grid.buckets.2.key: "8/131/85" } - - match: { aggregations.grid.buckets.2.doc_count: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/300_pipeline.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/300_pipeline.yml deleted file mode 100644 index 2e3d796383a7a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/300_pipeline.yml +++ /dev/null @@ -1,100 +0,0 @@ -setup: - - skip: - version: " - 7.1.99" - reason: These new error messages were added in 7.2 - - - do: - indices.create: - index: test_1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - int_field: - type : integer - - - do: - bulk: - refresh: true - body: - - index: - _index: test_1 - _id: 1 - - int_field: 1 - - index: - _index: test_1 - _id: 2 - - int_field: 2 - - index: - _index: test_1 - _id: 3 - - int_field: 3 - - index: - _index: test_1 - _id: 4 - - int_field: 4 - ---- -"Max pipeline through terms agg": - - - do: - catch: /\[Object\[\]\] at aggregation \[the_terms_2\]/ - search: - rest_total_hits_as_int: true - body: - aggs: - the_terms: - terms: - field: "int_field" - aggs: - the_terms_2: - terms: - field: "int_field" - aggs: - the_max: - max: - field: "int_field" - the_bad_max: - max_bucket: - buckets_path: "the_terms>the_terms_2>the_max" - ---- -"Max pipeline on terms agg": - - - do: - catch: /\[LongTerms\] at aggregation \[the_terms_2\]/ - search: - rest_total_hits_as_int: true - body: - aggs: - the_terms: - terms: - field: "int_field" - aggs: - the_terms_2: - terms: - field: "int_field" - the_bad_max: - max_bucket: - buckets_path: "the_terms>the_terms_2" - ---- -"Max pipeline on percentiles agg without specifying percent": - - - do: - catch: /buckets_path must reference either a number value or a single value numeric metric aggregation, but \[the_percentiles\] contains multiple values. Please specify which to use\./ - search: - rest_total_hits_as_int: true - body: - aggs: - the_terms: - terms: - field: "int_field" - aggs: - the_percentiles: - percentiles: - field: "int_field" - the_bad_max: - max_bucket: - buckets_path: "the_terms>the_percentiles" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/30_sig_terms.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/30_sig_terms.yml deleted file mode 100644 index dabd4aebf815d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/30_sig_terms.yml +++ /dev/null @@ -1,154 +0,0 @@ ---- -"Default index": - - do: - indices.create: - index: goodbad - body: - settings: - number_of_shards: "1" - mappings: - properties: - text: - type: text - fielddata: true - class: - type: keyword - - - do: - index: - index: goodbad - id: 1 - body: { text: "good", class: "good" } - - do: - index: - index: goodbad - id: 2 - body: { text: "good", class: "good" } - - do: - index: - index: goodbad - id: 3 - body: { text: "bad", class: "bad" } - - do: - index: - index: goodbad - id: 4 - body: { text: "bad", class: "bad" } - - do: - index: - index: goodbad - id: 5 - body: { text: "good bad", class: "good" } - - do: - index: - index: goodbad - id: 6 - body: { text: "good bad", class: "bad" } - - do: - index: - index: goodbad - id: 7 - body: { text: "bad", class: "bad" } - - - - - do: - indices.refresh: - index: [goodbad] - - - do: - search: - rest_total_hits_as_int: true - index: goodbad - - - match: {hits.total: 7} - - - do: - search: - rest_total_hits_as_int: true - index: goodbad - body: {"aggs": {"class": {"terms": {"field": "class"},"aggs": {"sig_terms": {"significant_terms": {"field": "text"}}}}}} - - - match: {aggregations.class.buckets.0.sig_terms.buckets.0.key: "bad"} - - match: {aggregations.class.buckets.1.sig_terms.buckets.0.key: "good"} - ---- -"IP test": - - do: - indices.create: - index: ip_index - body: - mappings: - properties: - ip: - type: ip - - - do: - index: - index: ip_index - id: 1 - body: { ip: "::1" } - - do: - index: - index: ip_index - id: 2 - body: { } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "query" : { "exists" : { "field" : "ip" } }, "aggs" : { "ip_terms" : { "significant_terms" : { "field" : "ip", "min_doc_count" : 1 } } } } - - - match: { hits.total: 1 } - - - length: { aggregations.ip_terms.buckets: 1 } - - - match: { aggregations.ip_terms.buckets.0.key: "::1" } - - - is_false: aggregations.ip_terms.buckets.0.key_as_string - - - match: { aggregations.ip_terms.buckets.0.doc_count: 1 } - - - do: - search: - rest_total_hits_as_int: true - body: { "query" : { "exists" : { "field" : "ip" } }, "aggs" : { "ip_terms" : { "significant_terms" : { "field" : "ip", "min_doc_count" : 1, "include" : [ "::1" ] } } } } - - - match: { hits.total: 1 } - - - length: { aggregations.ip_terms.buckets: 1 } - - - match: { aggregations.ip_terms.buckets.0.key: "::1" } - - - do: - search: - rest_total_hits_as_int: true - body: { "query" : { "exists" : { "field" : "ip" } }, "aggs" : { "ip_terms" : { "significant_terms" : { "field" : "ip", "min_doc_count" : 1, "exclude" : [ "::1" ] } } } } - - - match: { hits.total: 1 } - - - length: { aggregations.ip_terms.buckets: 0 } - - - do: - catch: request - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "ip_terms" : { "significant_terms" : { "field" : "ip", "exclude" : "127.*" } } } } - ---- -'Misspelled fields get "did you mean"': - - skip: - version: " - 7.6.99" - reason: Implemented in 8.0 (to be backported to 7.7) - - do: - catch: /\[significant_terms\] unknown field \[jlp\] did you mean \[jlh\]\?/ - search: - body: - aggs: - foo: - significant_terms: - field: foo - jlp: {} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/310_date_agg_per_day_of_week.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/310_date_agg_per_day_of_week.yml deleted file mode 100644 index 10037bf737a7b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/310_date_agg_per_day_of_week.yml +++ /dev/null @@ -1,44 +0,0 @@ - -setup: - - skip: - version: " - 7.6.99" - reason: "Start of the week Monday was enabled in a backport to 7.7 PR#50916" - features: "spi_on_classpath_jdk9" - - - do: - indices.create: - index: test - body: - mappings: - properties: - date: - type: date - - do: - index: - index: test - id: 1 - body: { "date": "2009-11-15T14:12:12" } - - do: - indices.refresh: - index: [test] ---- -# The inserted document has a field date=2009-11-15T14:12:12 which is Sunday. -# When aggregating per day of the week this should be considered as last day of the week (7) -# and this value should be used in 'key_as_string' -"Date aggregation per day of week": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - aggregations: - test: - "date_histogram": { - "field": "date", - "calendar_interval": "day", - "format": "e", - "offset": 0 - } - - match: {hits.total: 1} - - length: { aggregations.test.buckets: 1 } - - match: { aggregations.test.buckets.0.key_as_string: "7" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/40_range.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/40_range.yml deleted file mode 100644 index b1f093c138048..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/40_range.yml +++ /dev/null @@ -1,337 +0,0 @@ -setup: - - do: - indices.create: - index: test - body: - settings: - number_of_replicas: 0 - mappings: - properties: - ip: - type: ip - double: - type: double - date: - type: date - format: epoch_second - - - do: - cluster.health: - wait_for_status: green - ---- -"Double range": - - do: - index: - index: test - id: 1 - body: { "double" : 42 } - - - do: - index: - index: test - id: 2 - body: { "double" : 100 } - - - do: - index: - index: test - id: 3 - body: { "double" : 50 } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "double_range" : { "range" : { "field" : "double", "ranges": [ { "to": 50 }, { "from": 50, "to": 150 }, { "from": 150 } ] } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.double_range.buckets: 3 } - - - match: { aggregations.double_range.buckets.0.key: "*-50.0" } - - - is_false: aggregations.double_range.buckets.0.from - - - match: { aggregations.double_range.buckets.0.to: 50.0 } - - - match: { aggregations.double_range.buckets.0.doc_count: 1 } - - - match: { aggregations.double_range.buckets.1.key: "50.0-150.0" } - - - match: { aggregations.double_range.buckets.1.from: 50.0 } - - - match: { aggregations.double_range.buckets.1.to: 150.0 } - - - match: { aggregations.double_range.buckets.1.doc_count: 2 } - - - match: { aggregations.double_range.buckets.2.key: "150.0-*" } - - - match: { aggregations.double_range.buckets.2.from: 150.0 } - - - is_false: aggregations.double_range.buckets.2.to - - - match: { aggregations.double_range.buckets.2.doc_count: 0 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "double_range" : { "range" : { "field" : "double", "ranges": [ { "from": null, "to": 50 }, { "from": 50, "to": 150 }, { "from": 150, "to": null } ] } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.double_range.buckets: 3 } - - - match: { aggregations.double_range.buckets.0.key: "*-50.0" } - - - is_false: aggregations.double_range.buckets.0.from - - - match: { aggregations.double_range.buckets.0.to: 50.0 } - - - match: { aggregations.double_range.buckets.0.doc_count: 1 } - - - match: { aggregations.double_range.buckets.1.key: "50.0-150.0" } - - - match: { aggregations.double_range.buckets.1.from: 50.0 } - - - match: { aggregations.double_range.buckets.1.to: 150.0 } - - - match: { aggregations.double_range.buckets.1.doc_count: 2 } - - - match: { aggregations.double_range.buckets.2.key: "150.0-*" } - - - match: { aggregations.double_range.buckets.2.from: 150.0 } - - - is_false: aggregations.double_range.buckets.2.to - - - match: { aggregations.double_range.buckets.2.doc_count: 0 } - ---- -"IP range": - - do: - index: - index: test - id: 1 - body: { "ip" : "::1" } - - - do: - index: - index: test - id: 2 - body: { "ip" : "192.168.0.1" } - - - do: - index: - index: test - id: 3 - body: { "ip" : "192.168.0.7" } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "ip_range" : { "ip_range" : { "field" : "ip", "ranges": [ { "to": "192.168.0.0" }, { "from": "192.168.0.0", "to": "192.169.0.0" }, { "from": "192.169.0.0" } ] } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.ip_range.buckets: 3 } - - - is_false: aggregations.ip_range.buckets.0.from - - - match: { aggregations.ip_range.buckets.0.to: "192.168.0.0" } - - - match: { aggregations.ip_range.buckets.0.doc_count: 1 } - - - match: { aggregations.ip_range.buckets.1.from: "192.168.0.0" } - - - match: { aggregations.ip_range.buckets.1.to: "192.169.0.0" } - - - match: { aggregations.ip_range.buckets.1.doc_count: 2 } - - - match: { aggregations.ip_range.buckets.2.from: "192.169.0.0" } - - - is_false: aggregations.ip_range.buckets.2.to - - - match: { aggregations.ip_range.buckets.2.doc_count: 0 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "ip_range" : { "ip_range" : { "field" : "ip", "ranges": [ { "from": null, "to": "192.168.0.0" }, { "from": "192.168.0.0", "to": "192.169.0.0" }, { "from": "192.169.0.0", "to": null } ] } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.ip_range.buckets: 3 } - - - is_false: aggregations.ip_range.buckets.0.from - - - match: { aggregations.ip_range.buckets.0.to: "192.168.0.0" } - - - match: { aggregations.ip_range.buckets.0.doc_count: 1 } - - - match: { aggregations.ip_range.buckets.1.from: "192.168.0.0" } - - - match: { aggregations.ip_range.buckets.1.to: "192.169.0.0" } - - - match: { aggregations.ip_range.buckets.1.doc_count: 2 } - - - match: { aggregations.ip_range.buckets.2.from: "192.169.0.0" } - - - is_false: aggregations.ip_range.buckets.2.to - - - match: { aggregations.ip_range.buckets.2.doc_count: 0 } - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "ip_range" : { "ip_range" : { "field" : "ip", "ranges": [ { "mask": "::/24" }, { "mask": "192.168.0.0/16" } ] } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.ip_range.buckets: 2 } - - - match: { aggregations.ip_range.buckets.0.key: "::/24" } - - - match: { aggregations.ip_range.buckets.0.to: "0:100::" } - - - match: { aggregations.ip_range.buckets.0.doc_count: 3 } - - - match: { aggregations.ip_range.buckets.1.key: "192.168.0.0/16" } - - - match: { aggregations.ip_range.buckets.1.from: "192.168.0.0" } - - - match: { aggregations.ip_range.buckets.1.to: "192.169.0.0" } - - - match: { aggregations.ip_range.buckets.1.doc_count: 2 } - ---- -"IP Range Key Generation": - - skip: - version: " - 6.3.99" - reason: "Before 6.4.0, ip_range did not always generate bucket keys (see #21045)." - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "ip_range" : { "ip_range" : { "field" : "ip", "ranges": [ { "to": "192.168.0.0" }, { "from": "192.168.0.0", "to": "192.169.0.0" }, { "from": "192.169.0.0" } ] } } } } - - - length: { aggregations.ip_range.buckets: 3 } - - match: { aggregations.ip_range.buckets.0.key: "*-192.168.0.0" } - - match: { aggregations.ip_range.buckets.1.key: "192.168.0.0-192.169.0.0" } - - match: { aggregations.ip_range.buckets.2.key: "192.169.0.0-*" } - ---- -"Date range": - - do: - index: - index: test - id: 1 - body: { "date" : 1000 } - - - do: - index: - index: test - id: 2 - body: { "date" : 2000 } - - - do: - index: - index: test - id: 3 - body: { "date" : 3000 } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "date_range" : { "date_range" : { "field" : "date", "ranges": [ { "from" : 1000, "to": 3000 }, { "from": 3000, "to": 4000 } ] } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.date_range.buckets: 2 } - - - match: { aggregations.date_range.buckets.0.doc_count: 2 } - - match: { aggregations.date_range.buckets.0.key: "1000-3000" } - - match: { aggregations.date_range.buckets.0.from: 1000000 } - - match: { aggregations.date_range.buckets.0.to: 3000000 } - - - match: { aggregations.date_range.buckets.1.doc_count: 1 } - - match: { aggregations.date_range.buckets.1.key: "3000-4000" } - - match: { aggregations.date_range.buckets.1.from: 3000000 } - - match: { aggregations.date_range.buckets.1.to: 4000000 } - ---- -"Date Range Missing": - - do: - index: - index: test - id: 1 - body: { "date" : "28800000000" } - - - do: - index: - index: test - id: 2 - body: { "date" : "315561600000" } - - - do: - index: - index: test - id: 3 - body: { "date" : "631180800000" } - - - do: - index: - index: test - id: 4 - body: { "date" : "10000" } - - - do: - index: - index: test - id: 5 - body: { "ip" : "192.168.0.1" } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: - aggs: - age_groups: - date_range: - field: date - missing: "0" - ranges: - - key: Generation Y - from: '315561600000' - to: '946713600000' - - key: Generation X - from: "200000" - to: '315561600000' - - key: Other - to: "200000" - - - match: { hits.total: 5 } - - - length: { aggregations.age_groups.buckets: 3 } - - - match: { aggregations.age_groups.buckets.0.key: "Other" } - - - match: { aggregations.age_groups.buckets.0.doc_count: 2 } - - - match: { aggregations.age_groups.buckets.1.key: "Generation X" } - - - match: { aggregations.age_groups.buckets.1.doc_count: 1 } - - - match: { aggregations.age_groups.buckets.2.key: "Generation Y" } - - - match: { aggregations.age_groups.buckets.2.doc_count: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/50_filter.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/50_filter.yml deleted file mode 100644 index bc4105af85e65..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/50_filter.yml +++ /dev/null @@ -1,156 +0,0 @@ -setup: - - do: - indices.create: - index: test - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - properties: - mentions: - type: keyword - notifications: - type: keyword - - - do: - index: - index: test - id: foo|bar|baz0 - body: { "notifications" : ["abc"] } - - - do: - index: - index: test - id: foo|bar|baz1 - body: { "mentions" : ["abc"] } - - - do: - indices.refresh: {} - ---- -"Filter aggs with terms lookup and ensure it's cached": - # Because the filter agg rewrites the terms lookup in the rewrite phase the request can be cached - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - search: - rest_total_hits_as_int: true - size: 0 - request_cache: true - body: {"aggs": { "itemsNotify": { "filter": { "terms": { "mentions": { "index": "test", "id": "foo|bar|baz0", "path": "notifications"}}}, "aggs": { "mentions" : {"terms" : { "field" : "mentions" }}}}}} - - # validate result - - match: { hits.total: 2 } - - match: { aggregations.itemsNotify.doc_count: 1 } - - length: { aggregations.itemsNotify.mentions.buckets: 1 } - - match: { aggregations.itemsNotify.mentions.buckets.0.key: "abc" } - # we are using a lookup - this should not cache - - do: - indices.stats: { index: test, metric: request_cache} - - match: { _shards.total: 1 } - - match: { _all.total.request_cache.hit_count: 0 } - - match: { _all.total.request_cache.miss_count: 1 } - - is_true: indices.test - ---- -"Filter aggs no lookup and ensure it's cached": - # now run without lookup and ensure we get cached or at least do the lookup - - do: - search: - rest_total_hits_as_int: true - size: 0 - request_cache: true - body: {"aggs": { "itemsNotify": { "filter": { "terms": { "mentions": ["abc"]}}, "aggs": { "mentions" : {"terms" : { "field" : "mentions" }}}}}} - - - match: { hits.total: 2 } - - match: { aggregations.itemsNotify.doc_count: 1 } - - length: { aggregations.itemsNotify.mentions.buckets: 1 } - - match: { aggregations.itemsNotify.mentions.buckets.0.key: "abc" } - - do: - indices.stats: { index: test, metric: request_cache} - - match: { _shards.total: 1 } - - match: { _all.total.request_cache.hit_count: 0 } - - match: { _all.total.request_cache.miss_count: 1 } - - is_true: indices.test - ---- -"As a child of terms": - - skip: - version: " - 6.99.99" - reason: the test is written for hits.total.value - - - do: - bulk: - refresh: true - index: test - body: | - {"index":{}} - {"category": "bar", "val": 8} - {"index":{}} - {"category": "bar", "val": 0} - - do: - search: - size: 0 - body: - aggs: - category: - terms: - field: category.keyword - aggs: - high: - filter: - range: - val: - gte: 7 - - - match: { hits.total.value: 4 } - - match: { aggregations.category.buckets.0.key: bar } - - match: { aggregations.category.buckets.0.doc_count: 2 } - - match: { aggregations.category.buckets.0.high.doc_count: 1 } - ---- -"Sorting terms": - - skip: - version: " - 7.6.99" - reason: fixed in 7.7.0 - - - do: - bulk: - refresh: true - index: test - body: | - {"index":{}} - {"category": "foo", "val": 7} - {"index":{}} - {"category": "bar", "val": 8} - {"index":{}} - {"category": "bar", "val": 9} - {"index":{}} - {"category": "bar", "val": 0} - - do: - search: - size: 0 - body: - aggs: - category: - terms: - field: category.keyword - order: - high.doc_count: desc - aggs: - high: - filter: - range: - val: - gte: 7 - - - match: { hits.total.value: 6 } - - match: { aggregations.category.buckets.0.key: bar } - - match: { aggregations.category.buckets.0.doc_count: 3 } - - match: { aggregations.category.buckets.0.high.doc_count: 2 } - - match: { aggregations.category.buckets.1.key: foo } - - match: { aggregations.category.buckets.1.doc_count: 1 } - - match: { aggregations.category.buckets.1.high.doc_count: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/51_filter_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/51_filter_with_types.yml deleted file mode 100644 index 54476ce6e65b1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/51_filter_with_types.yml +++ /dev/null @@ -1,60 +0,0 @@ -setup: - - do: - indices.create: - include_type_name: true - index: test - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - test: - properties: - mentions: - type: keyword - notifications: - type: keyword - - - do: - index: - index: test - type: test - id: foo|bar|baz0 - body: { "notifications" : ["abc"] } - - - do: - index: - index: test - type: test - id: foo|bar|baz1 - body: { "mentions" : ["abc"] } - - - do: - indices.refresh: {} - ---- -"Filter aggs with terms lookup and ensure it's cached": - # Because the filter agg rewrites the terms lookup in the rewrite phase the request can be cached - - skip: - features: allowed_warnings - - do: - allowed_warnings: - - "Deprecated field [type] used, this field is unused and will be removed entirely" - search: - rest_total_hits_as_int: true - size: 0 - request_cache: true - body: {"aggs": { "itemsNotify": { "filter": { "terms": { "mentions": { "index": "test", "type": "test", "id": "foo|bar|baz0", "path": "notifications"}}}, "aggs": { "mentions" : {"terms" : { "field" : "mentions" }}}}}} - - # validate result - - match: { hits.total: 2 } - - match: { aggregations.itemsNotify.doc_count: 1 } - - length: { aggregations.itemsNotify.mentions.buckets: 1 } - - match: { aggregations.itemsNotify.mentions.buckets.0.key: "abc" } - # we are using a lookup - this should not cache - - do: - indices.stats: { index: test, metric: request_cache} - - match: { _shards.total: 1 } - - match: { _all.total.request_cache.hit_count: 0 } - - match: { _all.total.request_cache.miss_count: 1 } - - is_true: indices.test diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/70_adjacency_matrix.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/70_adjacency_matrix.yml deleted file mode 100644 index 3394b9a5a602a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/70_adjacency_matrix.yml +++ /dev/null @@ -1,58 +0,0 @@ -setup: - - do: - indices.create: - index: test - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - properties: - num: - type: integer - - - do: - index: - index: test - id: 1 - body: { "num": [1, 2] } - - - do: - index: - index: test - id: 2 - body: { "num": [2, 3] } - - - do: - index: - index: test - id: 3 - body: { "num": [3, 4] } - - - do: - indices.refresh: {} - - ---- -"Filters intersections": - - - do: - search: - rest_total_hits_as_int: true - body: { "size": 0, "aggs": { "conns": { "adjacency_matrix": { "filters": { "1": { "term": { "num": 1 } }, "2": { "term": { "num": 2 } }, "4": { "term": { "num": 4 } } } } } } } - - - match: { hits.total: 3 } - - - length: { aggregations.conns.buckets: 4 } - - - match: { aggregations.conns.buckets.0.doc_count: 1 } - - match: { aggregations.conns.buckets.0.key: "1" } - - - match: { aggregations.conns.buckets.1.doc_count: 1 } - - match: { aggregations.conns.buckets.1.key: "1&2" } - - - match: { aggregations.conns.buckets.2.doc_count: 2 } - - match: { aggregations.conns.buckets.2.key: "2" } - - - match: { aggregations.conns.buckets.3.doc_count: 1 } - - match: { aggregations.conns.buckets.3.key: "4" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/80_typed_keys.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/80_typed_keys.yml deleted file mode 100644 index d041432556430..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/80_typed_keys.yml +++ /dev/null @@ -1,237 +0,0 @@ -setup: - - - do: - indices.create: - index: test - body: - settings: - number_of_replicas: 0 - mappings: - properties: - name: - type: keyword - num: - type: integer - created: - type: date - - - do: - bulk: - refresh: true - index: test - body: - - '{"index": {}}' - - '{"name": "one", "num": 1, "created": "2010-03-12T01:07:45"}' - - '{"index": {}}' - - '{"name": "two", "num": 2, "created": "2010-03-12T04:11:00"}' - - '{"index": {}}' - - '{"name": "three", "num": 3, "created": "2010-04-27T03:43:34"}' - ---- -"Test typed keys parameter for avg aggregation": - - do: - search: - rest_total_hits_as_int: true - typed_keys: true - body: - size: 0 - aggregations: - test_avg: - avg: - field: num - - is_true: aggregations.avg#test_avg - ---- -"Test typed keys parameter for cardinality aggregation": - - do: - search: - rest_total_hits_as_int: true - typed_keys: true - body: - size: 0 - aggregations: - test_cardinality: - cardinality: - field: name - - is_true: aggregations.cardinality#test_cardinality - ---- -"Test typed keys parameter for extended_stats aggregation": - - do: - search: - rest_total_hits_as_int: true - typed_keys: true - body: - size: 0 - aggregations: - test_extended_stats: - extended_stats: - field: num - - is_true: aggregations.extended_stats#test_extended_stats - ---- -"Test typed keys parameter for max aggregation": - - do: - search: - rest_total_hits_as_int: true - typed_keys: true - body: - size: 0 - aggregations: - test_max: - max: - field: num - - is_true: aggregations.max#test_max - ---- -"Test typed keys parameter for min aggregation": - - do: - search: - rest_total_hits_as_int: true - typed_keys: true - body: - size: 0 - aggregations: - test_min: - min: - field: num - - is_true: aggregations.min#test_min - ---- -"Test typed keys parameter for percentiles aggregation": - - do: - search: - rest_total_hits_as_int: true - typed_keys: true - body: - size: 0 - aggregations: - test_percentiles: - percentiles: - field: num - - is_true: aggregations.tdigest_percentiles#test_percentiles - ---- -"Test typed keys parameter for percentile_ranks aggregation": - - do: - search: - rest_total_hits_as_int: true - typed_keys: true - body: - size: 0 - aggregations: - test_percentile_ranks: - percentile_ranks: - field: num - values: [0,10] - - is_true: aggregations.tdigest_percentile_ranks#test_percentile_ranks - ---- -"Test typed keys parameter for stats aggregation": - - do: - search: - rest_total_hits_as_int: true - typed_keys: true - body: - size: 0 - aggregations: - test_stats: - stats: - field: num - - is_true: aggregations.stats#test_stats - ---- -"Test typed keys parameter for sum aggregation": - - do: - search: - rest_total_hits_as_int: true - typed_keys: true - body: - size: 0 - aggregations: - test_sum: - sum: - field: num - - is_true: aggregations.sum#test_sum - ---- -"Test typed keys parameter for terms and top_hits aggregation": - - do: - search: - rest_total_hits_as_int: true - typed_keys: true - body: - size: 0 - aggregations: - test_terms: - terms: - field: name - aggs: - test_top_hits: - top_hits: - sort: num - - is_true: aggregations.sterms#test_terms - - is_true: aggregations.sterms#test_terms.buckets.0.top_hits#test_top_hits - - is_true: aggregations.sterms#test_terms.buckets.1.top_hits#test_top_hits - - is_true: aggregations.sterms#test_terms.buckets.2.top_hits#test_top_hits - ---- -"Test typed keys parameter for terms aggregation": - - do: - search: - rest_total_hits_as_int: true - typed_keys: true - body: - size: 0 - aggregations: - test_terms: - terms: - field: num - - is_true: aggregations.lterms#test_terms - ---- -"Test typed keys parameter for value_count aggregation": - - do: - search: - rest_total_hits_as_int: true - typed_keys: true - body: - size: 0 - aggregations: - test_value_count: - value_count: - field: num - - is_true: aggregations.value_count#test_value_count - ---- -"Test typed keys parameter for date_histogram aggregation and max_bucket pipeline aggregation": - - skip: - version: " - 7.1.99" - reason: "calendar_interval added in 7.2" - - do: - search: - rest_total_hits_as_int: true - typed_keys: true - body: - size: 0 - aggregations: - test_created_histogram: - date_histogram: - field: created - calendar_interval: month - aggregations: - test_sum: - sum: - field: num - test_deriv: - derivative: - buckets_path: "test_sum" - test_max_bucket: - max_bucket: - buckets_path: "test_created_histogram>test_sum" - - - is_true: aggregations.date_histogram#test_created_histogram - - is_true: aggregations.date_histogram#test_created_histogram.buckets.0.sum#test_sum - - is_true: aggregations.date_histogram#test_created_histogram.buckets.1.sum#test_sum - - is_true: aggregations.date_histogram#test_created_histogram.buckets.1.derivative#test_deriv - - is_true: aggregations.bucket_metric_value#test_max_bucket diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/90_sig_text.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/90_sig_text.yml deleted file mode 100644 index 673d19e04cf22..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.aggregation/90_sig_text.yml +++ /dev/null @@ -1,151 +0,0 @@ ---- -"Default index": - - - do: - indices.create: - index: goodbad - body: - settings: - number_of_shards: "1" - mappings: - properties: - text: - type: text - fielddata: false - class: - type: keyword - - - do: - index: - index: goodbad - id: 1 - body: { text: "good", class: "good" } - - do: - index: - index: goodbad - id: 2 - body: { text: "good", class: "good" } - - do: - index: - index: goodbad - id: 3 - body: { text: "bad", class: "bad" } - - do: - index: - index: goodbad - id: 4 - body: { text: "bad", class: "bad" } - - do: - index: - index: goodbad - id: 5 - body: { text: "good bad", class: "good" } - - do: - index: - index: goodbad - id: 6 - body: { text: "good bad", class: "bad" } - - do: - index: - index: goodbad - id: 7 - body: { text: "bad", class: "bad" } - - - - - do: - indices.refresh: - index: [goodbad] - - - do: - search: - rest_total_hits_as_int: true - index: goodbad - - - match: {hits.total: 7} - - - do: - search: - rest_total_hits_as_int: true - index: goodbad - body: {"aggs": {"class": {"terms": {"field": "class"},"aggs": {"sig_text": {"significant_text": {"field": "text"}}}}}} - - - match: {aggregations.class.buckets.0.sig_text.buckets.0.key: "bad"} - - match: {aggregations.class.buckets.1.sig_text.buckets.0.key: "good"} - ---- -"Dedup noise": - - - do: - indices.create: - index: goodbad - body: - settings: - number_of_shards: "1" - mappings: - properties: - text: - type: text - fielddata: false - class: - type: keyword - - - do: - index: - index: goodbad - id: 1 - body: { text: "good noisewords1 g1 g2 g3 g4 g5 g6", class: "good" } - - do: - index: - index: goodbad - id: 2 - body: { text: "good noisewords2 g1 g2 g3 g4 g5 g6", class: "good" } - - do: - index: - index: goodbad - id: 3 - body: { text: "bad noisewords3 b1 b2 b3 b4 b5 b6", class: "bad" } - - do: - index: - index: goodbad - id: 4 - body: { text: "bad noisewords4 b1 b2 b3 b4 b5 b6", class: "bad" } - - do: - index: - index: goodbad - id: 5 - body: { text: "good bad noisewords5 gb1 gb2 gb3 gb4 gb5 gb6", class: "good" } - - do: - index: - index: goodbad - id: 6 - body: { text: "good bad noisewords6 gb1 gb2 gb3 gb4 gb5 gb6", class: "bad" } - - do: - index: - index: goodbad - id: 7 - body: { text: "bad noisewords7 b1 b2 b3 b4 b5 b6", class: "bad" } - - - - - do: - indices.refresh: - index: [goodbad] - - - do: - search: - rest_total_hits_as_int: true - index: goodbad - - - match: {hits.total: 7} - - - do: - search: - rest_total_hits_as_int: true - index: goodbad - body: {"aggs": {"class": {"terms": {"field": "class"},"aggs": {"sig_text": {"significant_text": {"field": "text", "filter_duplicate_text": true}}}}}} - - - match: {aggregations.class.buckets.0.sig_text.buckets.0.key: "bad"} - - length: { aggregations.class.buckets.0.sig_text.buckets: 1 } - - match: {aggregations.class.buckets.1.sig_text.buckets.0.key: "good"} - - length: { aggregations.class.buckets.1.sig_text.buckets: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/10_unified.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/10_unified.yml deleted file mode 100644 index edb1ba1b05934..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/10_unified.yml +++ /dev/null @@ -1,35 +0,0 @@ -setup: - - do: - indices.create: - index: test - body: - mappings: - "properties": - "text": - "type": "text" - "fields": - "fvh": - "type": "text" - "term_vector": "with_positions_offsets" - "postings": - "type": "text" - "index_options": "offsets" - - do: - index: - index: test - id: 1 - body: - "text" : "The quick brown fox is brown." - - do: - indices.refresh: {} - ---- -"Basic": - - do: - search: - rest_total_hits_as_int: true - body: { "query" : {"multi_match" : { "query" : "quick brown fox", "fields" : [ "text*"] } }, "highlight" : { "type" : "unified", "fields" : { "*" : {} } } } - - - match: {hits.hits.0.highlight.text.0: "The quick brown fox is brown."} - - match: {hits.hits.0.highlight.text\.fvh.0: "The quick brown fox is brown."} - - match: {hits.hits.0.highlight.text\.postings.0: "The quick brown fox is brown."} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/20_fvh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/20_fvh.yml deleted file mode 100644 index d411f55106d75..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/20_fvh.yml +++ /dev/null @@ -1,45 +0,0 @@ -setup: - - do: - indices.create: - index: test - body: - mappings: - "properties": - "title": - "type": "text" - "term_vector": "with_positions_offsets" - "description": - "type": "text" - "term_vector": "with_positions_offsets" - - do: - index: - index: test - id: 1 - body: - "title" : "The quick brown fox is brown" - "description" : "The quick pink panther is pink" - - do: - indices.refresh: {} - ---- -"Highlight query": - - do: - search: - rest_total_hits_as_int: true - body: - highlight: - type: fvh - fields: - description: - type: fvh - highlight_query: - prefix: - description: br - title: - type: fvh - highlight_query: - prefix: - title: br - - - match: {hits.hits.0.highlight.title.0: "The quick brown fox is brown"} - - is_false: hits.hits.0.highlight.description diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/30_max_analyzed_offset.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/30_max_analyzed_offset.yml deleted file mode 100644 index 334708b54b066..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/30_max_analyzed_offset.yml +++ /dev/null @@ -1,81 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test1 - body: - settings: - number_of_shards: 1 - index.highlight.max_analyzed_offset: 10 - mappings: - properties: - field1: - type: text - field2: - type: text - index_options: offsets - - - do: - index: - index: test1 - id: 1 - body: - "field1" : "The quick brown fox went to the forest and saw another fox." - "field2" : "The quick brown fox went to the forest and saw another fox." - - - do: - indices.refresh: {} - ---- -"Unified highlighter on a field WITHOUT OFFSETS exceeding index.highlight.max_analyzed_offset should FAIL": - - skip: - version: " - 6.99.99" - reason: index.highlight.max_analyzed_offset setting has been added in 7.0.0 - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - index: test1 - body: {"query" : {"match" : {"field1" : "fox"}}, "highlight" : {"type" : "unified", "fields" : {"field1" : {}}}} - - match: { error.root_cause.0.type: "illegal_argument_exception" } - - ---- -"Plain highlighter on a field WITHOUT OFFSETS exceeding index.highlight.max_analyzed_offset should FAIL": - - skip: - version: " - 6.99.99" - reason: index.highlight.max_analyzed_offset setting has been added in 7.0.0 - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - index: test1 - body: {"query" : {"match" : {"field1" : "fox"}}, "highlight" : {"type" : "unified", "fields" : {"field1" : {}}}} - - match: { error.root_cause.0.type: "illegal_argument_exception" } - - ---- -"Unified highlighter on a field WITH OFFSETS exceeding index.highlight.max_analyzed_offset should SUCCEED": - - skip: - version: " - 6.99.99" - reason: index.highligt.max_analyzed_offset setting has been added in 7.0.0 - - do: - search: - rest_total_hits_as_int: true - index: test1 - body: {"query" : {"match" : {"field2" : "fox"}}, "highlight" : {"type" : "unified", "fields" : {"field2" : {}}}} - - match: {hits.hits.0.highlight.field2.0: "The quick brown fox went to the forest and saw another fox."} - - ---- -"Plain highlighter on a field WITH OFFSETS exceeding index.highlight.max_analyzed_offset should FAIL": - - skip: - version: " - 6.99.99" - reason: index.highlight.max_analyzed_offset setting has been added in 7.0.0 - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - index: test1 - body: {"query" : {"match" : {"field2" : "fox"}}, "highlight" : {"type" : "plain", "fields" : {"field2" : {}}}} - - match: { error.root_cause.0.type: "illegal_argument_exception" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/40_keyword_ignore.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/40_keyword_ignore.yml deleted file mode 100644 index fe4f36364d2db..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.highlight/40_keyword_ignore.yml +++ /dev/null @@ -1,64 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test-index - body: - mappings: - "properties": - "k1": - "type": "keyword" - "k2": - "type": "keyword" - "ignore_above": 3 - - do: - bulk: - index: test-index - refresh: true - body: - - '{"index": {"_id": "1"}}' - - '{"k1": "123", "k2" : "123"}' - - '{"index": {"_id": "2"}}' - - '{"k1": "1234", "k2" : "1234"}' - ---- -"Plain Highligher should skip highlighting ignored keyword values": - - skip: - version: " - 7.6.99" - reason: "skip highlighting of ignored values was introduced in 7.7" - - do: - search: - index: test-index - body: - query: - prefix: - k1: "12" - highlight: - require_field_match: false - fields: - k2: - type: plain - - - match: {hits.hits.0.highlight.k2.0: "123"} - - is_false: hits.hits.1.highlight # no highlight for a value that was ignored - ---- -"Unified Highligher should skip highlighting ignored keyword values": - - skip: - version: " - 7.6.99" - reason: "skip highlighting of ignored values was introduced in 7.7" - - do: - search: - index: test-index - body: - query: - prefix: - k1: "12" - highlight: - require_field_match: false - fields: - k2: - type: unified - - - match: {hits.hits.0.highlight.k2.0: "123"} - - is_false: hits.hits.1.highlight # no highlight for a value that was ignored diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search.inner_hits/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search.inner_hits/10_basic.yml deleted file mode 100644 index 629a6d4de34a1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search.inner_hits/10_basic.yml +++ /dev/null @@ -1,94 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test - body: - mappings: - properties: - nested_field: - type: nested - ---- -"Nested inner hits": - - skip: - version: " - 6.1.99" - reason: "<= 6.1 nodes don't always include index or id in nested inner hits" - - do: - index: - index: test - id: 1 - body: - "nested_field" : [ { "foo": "bar" } ] - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "query" : { "nested" : { "path" : "nested_field", "query" : { "match_all" : {} }, "inner_hits" : {} } } } - - match: { hits.total: 1 } - - match: { hits.hits.0._index: "test" } - - match: { hits.hits.0._type: "_doc" } - - match: { hits.hits.0._id: "1" } - - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0._index: "test" } - - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0._type: "_doc" } - - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0._id: "1" } - - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0._nested.field: "nested_field" } - - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0._nested.offset: 0 } - - is_false: hits.hits.0.inner_hits.nested_field.hits.hits.0._nested.child - - ---- -"Nested doc version and seqIDs": - - - skip: - version: " - 6.99.99" - reason: "Triggers warnings before 7.0" - - - do: - index: - index: test - id: 1 - body: - "nested_field" : [ { "foo": "bar" } ] - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "query" : { "nested" : { "path" : "nested_field", "query" : { "match_all" : {} }, "inner_hits" : { version: true, "docvalue_fields": [ "_seq_no" ]} }}, "version": true, "docvalue_fields" : [ "_seq_no" ] } - - - match: { hits.total: 1 } - - match: { hits.hits.0._index: "test" } - - match: { hits.hits.0._type: "_doc" } - - match: { hits.hits.0._id: "1" } - - match: { hits.hits.0._version: 1 } - - match: { hits.hits.0.fields._seq_no: [0] } - - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0.fields._seq_no: [0] } - - - - do: - index: - index: test - id: 1 - body: - "nested_field" : [ { "foo": "baz" } ] - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "query" : { "nested" : { "path" : "nested_field", "query" : { "match_all" : {} }, "inner_hits" : { version: true, "docvalue_fields": [ "_seq_no" ]} }}, "version": true, "docvalue_fields" : [ "_seq_no" ] } - - - match: { hits.total: 1 } - - match: { hits.hits.0._index: "test" } - - match: { hits.hits.0._type: "_doc" } - - match: { hits.hits.0._id: "1" } - - match: { hits.hits.0._version: 2 } - - match: { hits.hits.0.fields._seq_no: [1] } - - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0._version: 2 } - - match: { hits.hits.0.inner_hits.nested_field.hits.hits.0.fields._seq_no: [1] } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/100_stored_fields.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/100_stored_fields.yml deleted file mode 100644 index a82d7fff480eb..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/100_stored_fields.yml +++ /dev/null @@ -1,44 +0,0 @@ -setup: - - do: - indices.create: - index: test - - do: - index: - index: test - id: 1 - body: { foo: bar } - - do: - indices.refresh: - index: [test] - ---- -"Stored fields": - - do: - search: - rest_total_hits_as_int: true - index: test - - - is_true: hits.hits.0._id - - is_true: hits.hits.0._type - - is_true: hits.hits.0._source - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - stored_fields: [] - - - is_true: hits.hits.0._id - - is_true: hits.hits.0._type - - is_false: hits.hits.0._source - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - stored_fields: "_none_" - - - is_false: hits.hits.0._id - - is_false: hits.hits.0._source diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/10_source_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/10_source_filtering.yml deleted file mode 100644 index 501fb1292da94..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/10_source_filtering.yml +++ /dev/null @@ -1,201 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test - body: - mappings: - properties: - bigint: - type: keyword - - - - do: - index: - index: test_1 - id: 1 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1, "bigint": 72057594037927936 } - - do: - indices.refresh: {} - ---- -"_source: true": - - - do: - search: - body: { _source: true, query: { match_all: {} } } - - - length: { hits.hits: 1 } - - match: { hits.hits.0._source.count: 1 } - ---- -"_source: false": - - do: { search: { body: { _source: false, query: { match_all: {} } } } } - - length: { hits.hits: 1 } - - is_false: hits.hits.0._source - ---- -"no filtering": - - do: { search: { body: { query: { match_all: {} } } } } - - length: { hits.hits: 1 } - - match: { hits.hits.0._source.count: 1 } - ---- -"_source in body": - - do: { search: { body: { _source: include.field1, query: { match_all: {} } } } } - - match: { hits.hits.0._source.include.field1: v1 } - - is_false: hits.hits.0._source.include.field2 - ---- -"_source_includes and _source in body": - - do: { search: { _source_includes: include.field1, body: { _source: include.field2, query: { match_all: {} } } } } - - match: { hits.hits.0._source.include.field1: v1 } - - is_false: hits.hits.0._source.include.field2 - ---- -"_source_includes": - - do: { search: { _source_includes: include.field1, body: { query: { match_all: {} } } } } - - match: { hits.hits.0._source.include.field1: v1 } - - is_false: hits.hits.0._source.include.field2 - ---- -"_source_excludes": - - do: { search: { _source_excludes: count, body: { query: { match_all: {} } } } } - - match: { hits.hits.0._source.include: { field1 : v1 , field2: v2 }} - - is_false: hits.hits.0._source.count - ---- -"_source field1 field2": - - do: - search: - body: - _source: [ include.field1, include.field2 ] - query: { match_all: {} } - - match: { hits.hits.0._source.include.field1: v1 } - - match: { hits.hits.0._source.include.field2: v2 } - - is_false: hits.hits.0._source.count - ---- -"_source.include field1 field2": - - do: - search: - body: - _source: - includes: [ include.field1, include.field2 ] - query: { match_all: {} } - - match: { hits.hits.0._source.include.field1: v1 } - - match: { hits.hits.0._source.include.field2: v2 } - - is_false: hits.hits.0._source.count - ---- -"_source includes and excludes": - - do: - search: - body: - _source: - includes: include - excludes: "*.field2" - query: { match_all: {} } - - match: { hits.hits.0._source.include.field1: v1 } - - is_false: hits.hits.0._source.include.field2 - ---- -"_source include on bigint": - - do: - search: - body: - _source: - includes: bigint - query: { match_all: {} } - - match: { hits.hits.0._source.bigint: 72057594037927936 } - - is_false: hits.hits.0._source.include.field2 - - ---- -"_source filtering on bigint": -- do: - search: - body: - _source: ["bigint"] - query: { match_all: {} } -- match: { hits.hits.0._source.bigint: 72057594037927936 } - ---- -"fields in body": - - do: - search: - body: - stored_fields: [ include.field2 ] - query: { match_all: {} } - - is_false: hits.hits.0._source - ---- -"fields in body with source": - - do: - search: - body: - stored_fields: [ include.field2, _source ] - query: { match_all: {} } - - match: { hits.hits.0._source.include.field2: v2 } - - is_true: hits.hits.0._source - ---- -"docvalue_fields": - - skip: - version: " - 6.9.99" - reason: Triggers a deprecation warning before 7.0 - - do: - search: - body: - docvalue_fields: [ "count" ] - - match: { hits.hits.0.fields.count: [1] } - ---- -"multiple docvalue_fields": - - skip: - version: " - 6.9.99" - reason: Triggered a deprecation warning before 7.0 - - do: - search: - body: - docvalue_fields: [ "count", "include.field1.keyword" ] - - match: { hits.hits.0.fields.count: [1] } - ---- -"docvalue_fields as url param": - - skip: - version: " - 6.99.99" - reason: Triggered a deprecation warning before 7.0 - - do: - search: - docvalue_fields: [ "count" ] - - match: { hits.hits.0.fields.count: [1] } - ---- -"docvalue_fields with default format": - - skip: - version: " - 6.99.99" - reason: Only triggers warnings on 7.0+ - features: warnings - - do: - warnings: - - "[use_field_mapping] is a special format that was only used to ease the transition to 7.x. It has become the default and shouldn't be set explicitly anymore." - search: - body: - docvalue_fields: - - field: "count" - format: "use_field_mapping" - - match: { hits.hits.0.fields.count: [1] } - ---- -"docvalue_fields with explicit format": - - skip: - version: " - 6.3.99" - reason: format option was added in 6.4 - - do: - search: - body: - docvalue_fields: - - field: "count" - format: "#.0" - - match: { hits.hits.0.fields.count: ["1.0"] } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/110_field_collapsing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/110_field_collapsing.yml deleted file mode 100644 index 3ae293f38f23d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/110_field_collapsing.yml +++ /dev/null @@ -1,469 +0,0 @@ -setup: - - do: - indices.create: - index: test - body: - mappings: - properties: - numeric_group: { type: integer } - - - do: - index: - index: test - id: 1 - version_type: external - version: 11 - body: { numeric_group: 1, sort: 10 } - - do: - index: - index: test - id: 2 - version_type: external - version: 22 - body: { numeric_group: 1, sort: 6 } - - do: - index: - index: test - id: 3 - version_type: external - version: 33 - body: { numeric_group: 1, sort: 24 } - - do: - index: - index: test - id: 4 - version_type: external - version: 44 - body: { numeric_group: 25, sort: 10 } - - do: - index: - index: test - id: 5 - version_type: external - version: 55 - body: { numeric_group: 25, sort: 5 } - - do: - index: - index: test - id: 6 - version_type: external - version: 66 - body: { numeric_group: 3, sort: 36 } - - do: - indices.refresh: - index: test - ---- -"field collapsing": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - collapse: { field: numeric_group } - sort: [{ sort: desc }] - - - match: {hits.total: 6 } - - length: {hits.hits: 3 } - - match: {hits.hits.0._index: test } - - match: {hits.hits.0._type: _doc } - - match: {hits.hits.0.fields.numeric_group: [3] } - - match: {hits.hits.0.sort: [36] } - - match: {hits.hits.0._id: "6" } - - is_false: hits.hits.0.inner_hits - - match: {hits.hits.1._index: test } - - match: {hits.hits.1._type: _doc } - - match: {hits.hits.1.fields.numeric_group: [1] } - - match: {hits.hits.1.sort: [24] } - - match: {hits.hits.1._id: "3" } - - is_false: hits.hits.1.inner_hits - - match: {hits.hits.2._index: test } - - match: {hits.hits.2._type: _doc } - - match: {hits.hits.2.fields.numeric_group: [25] } - - match: {hits.hits.2.sort: [10] } - - match: {hits.hits.2._id: "4" } - - is_false: hits.hits.2.inner_hits - ---- -"field collapsing and from": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - from: 2 - collapse: { field: numeric_group } - sort: [{ sort: desc }] - - - match: {hits.total: 6 } - - length: {hits.hits: 1 } - - match: {hits.hits.0._index: test } - - match: {hits.hits.0._type: _doc } - - match: {hits.hits.0.fields.numeric_group: [25]} - - match: {hits.hits.0.sort: [10] } - - match: {hits.hits.0._id: "4" } - - is_false: hits.hits.0.inner_hits - ---- -"field collapsing and inner_hits": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - collapse: { field: numeric_group, inner_hits: { name: sub_hits, size: 2, sort: [{ sort: asc }] } } - sort: [{ sort: desc }] - - - match: { hits.total: 6 } - - length: { hits.hits: 3 } - - match: { hits.hits.0._index: test } - - match: { hits.hits.0._type: _doc } - - match: { hits.hits.0.fields.numeric_group: [3] } - - match: { hits.hits.0.sort: [36] } - - match: { hits.hits.0._id: "6" } - - match: { hits.hits.0.inner_hits.sub_hits.hits.total: 1 } - - length: { hits.hits.0.inner_hits.sub_hits.hits.hits: 1 } - - match: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._id: "6" } - - match: { hits.hits.1._index: test } - - match: { hits.hits.1._type: _doc } - - match: { hits.hits.1.fields.numeric_group: [1] } - - match: { hits.hits.1.sort: [24] } - - match: { hits.hits.1._id: "3" } - - match: { hits.hits.1.inner_hits.sub_hits.hits.total: 3 } - - length: { hits.hits.1.inner_hits.sub_hits.hits.hits: 2 } - - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._id: "2" } - - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._id: "1" } - - match: { hits.hits.2._index: test } - - match: { hits.hits.2._type: _doc } - - match: { hits.hits.2.fields.numeric_group: [25] } - - match: { hits.hits.2.sort: [10] } - - match: { hits.hits.2._id: "4" } - - match: { hits.hits.2.inner_hits.sub_hits.hits.total: 2 } - - length: { hits.hits.2.inner_hits.sub_hits.hits.hits: 2 } - - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._id: "5" } - - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._id: "4" } - ---- -"field collapsing, inner_hits and maxConcurrentGroupRequests": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - collapse: { field: numeric_group, max_concurrent_group_searches: 10, inner_hits: { name: sub_hits, size: 2, sort: [{ sort: asc }] } } - sort: [{ sort: desc }] - - - match: { hits.total: 6 } - - length: { hits.hits: 3 } - - match: { hits.hits.0._index: test } - - match: { hits.hits.0._type: _doc } - - match: { hits.hits.0.fields.numeric_group: [3] } - - match: { hits.hits.0.sort: [36] } - - match: { hits.hits.0._id: "6" } - - match: { hits.hits.0.inner_hits.sub_hits.hits.total: 1 } - - length: { hits.hits.0.inner_hits.sub_hits.hits.hits: 1 } - - match: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._id: "6" } - - match: { hits.hits.1._index: test } - - match: { hits.hits.1._type: _doc } - - match: { hits.hits.1.fields.numeric_group: [1] } - - match: { hits.hits.1.sort: [24] } - - match: { hits.hits.1._id: "3" } - - match: { hits.hits.1.inner_hits.sub_hits.hits.total: 3 } - - length: { hits.hits.1.inner_hits.sub_hits.hits.hits: 2 } - - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._id: "2" } - - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._id: "1" } - - match: { hits.hits.2._index: test } - - match: { hits.hits.2._type: _doc } - - match: { hits.hits.2.fields.numeric_group: [25] } - - match: { hits.hits.2.sort: [10] } - - match: { hits.hits.2._id: "4" } - - match: { hits.hits.2.inner_hits.sub_hits.hits.total: 2 } - - length: { hits.hits.2.inner_hits.sub_hits.hits.hits: 2 } - - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._id: "5" } - - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._id: "4" } - - ---- -"field collapsing and scroll": - - - do: - catch: /cannot use \`collapse\` in a scroll context/ - search: - rest_total_hits_as_int: true - index: test - scroll: 1s - body: - collapse: { field: numeric_group } - ---- -"field collapsing and search_after": - - - do: - catch: /cannot use \`collapse\` in conjunction with \`search_after\`/ - search: - rest_total_hits_as_int: true - index: test - body: - collapse: { field: numeric_group } - search_after: [6] - sort: [{ sort: desc }] - ---- -"field collapsing and rescore": - - - do: - catch: /cannot use \`collapse\` in conjunction with \`rescore\`/ - search: - rest_total_hits_as_int: true - index: test - body: - collapse: { field: numeric_group } - rescore: - window_size: 20 - query: - rescore_query: - match_all: {} - query_weight: 1 - rescore_query_weight: 2 - ---- -"no hits and inner_hits": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - size: 0 - collapse: { field: numeric_group, inner_hits: { name: sub_hits, size: 1} } - sort: [{ sort: desc }] - - - match: { hits.total: 6 } - - length: { hits.hits: 0 } - ---- -"no hits and inner_hits max_score null": - - - skip: - version: " - 6.99.99" - reason: max_score was set to 0 rather than null before 7.0 - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - size: 0 - collapse: { field: numeric_group, inner_hits: { name: sub_hits, size: 1} } - sort: [{ sort: desc }] - - - match: { hits.max_score: null } - ---- -"field collapsing and multiple inner_hits": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - collapse: - field: numeric_group - inner_hits: - - { name: sub_hits_asc, size: 2, sort: [{ sort: asc }] } - - { name: sub_hits_desc, size: 1, sort: [{ sort: desc }] } - sort: [{ sort: desc }] - - - match: { hits.total: 6 } - - length: { hits.hits: 3 } - - match: { hits.hits.0._index: test } - - match: { hits.hits.0._type: _doc } - - match: { hits.hits.0.fields.numeric_group: [3] } - - match: { hits.hits.0.sort: [36] } - - match: { hits.hits.0._id: "6" } - - match: { hits.hits.0.inner_hits.sub_hits_asc.hits.total: 1 } - - length: { hits.hits.0.inner_hits.sub_hits_asc.hits.hits: 1 } - - match: { hits.hits.0.inner_hits.sub_hits_asc.hits.hits.0._id: "6" } - - match: { hits.hits.0.inner_hits.sub_hits_desc.hits.total: 1 } - - length: { hits.hits.0.inner_hits.sub_hits_desc.hits.hits: 1 } - - match: { hits.hits.0.inner_hits.sub_hits_desc.hits.hits.0._id: "6" } - - match: { hits.hits.1._index: test } - - match: { hits.hits.1._type: _doc } - - match: { hits.hits.1.fields.numeric_group: [1] } - - match: { hits.hits.1.sort: [24] } - - match: { hits.hits.1._id: "3" } - - match: { hits.hits.1.inner_hits.sub_hits_asc.hits.total: 3 } - - length: { hits.hits.1.inner_hits.sub_hits_asc.hits.hits: 2 } - - match: { hits.hits.1.inner_hits.sub_hits_asc.hits.hits.0._id: "2" } - - match: { hits.hits.1.inner_hits.sub_hits_asc.hits.hits.1._id: "1" } - - match: { hits.hits.1.inner_hits.sub_hits_desc.hits.total: 3 } - - length: { hits.hits.1.inner_hits.sub_hits_desc.hits.hits: 1 } - - match: { hits.hits.1.inner_hits.sub_hits_desc.hits.hits.0._id: "3" } - - match: { hits.hits.2._index: test } - - match: { hits.hits.2._type: _doc } - - match: { hits.hits.2.fields.numeric_group: [25] } - - match: { hits.hits.2.sort: [10] } - - match: { hits.hits.2._id: "4" } - - match: { hits.hits.2.inner_hits.sub_hits_asc.hits.total: 2 } - - length: { hits.hits.2.inner_hits.sub_hits_asc.hits.hits: 2 } - - match: { hits.hits.2.inner_hits.sub_hits_asc.hits.hits.0._id: "5" } - - match: { hits.hits.2.inner_hits.sub_hits_asc.hits.hits.1._id: "4" } - - match: { hits.hits.2.inner_hits.sub_hits_desc.hits.total: 2 } - - length: { hits.hits.2.inner_hits.sub_hits_desc.hits.hits: 1 } - - match: { hits.hits.2.inner_hits.sub_hits_desc.hits.hits.0._id: "4" } - ---- -"field collapsing, inner_hits and version": - - - skip: - version: " - 6.1.0" - reason: "bug fixed in 6.1.1" - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - collapse: { field: numeric_group, inner_hits: { name: sub_hits, version: true, size: 2, sort: [{ sort: asc }] } } - sort: [{ sort: desc }] - version: true - - - match: { hits.total: 6 } - - length: { hits.hits: 3 } - - match: { hits.hits.0._index: test } - - match: { hits.hits.0._type: _doc } - - match: { hits.hits.0.fields.numeric_group: [3] } - - match: { hits.hits.0.sort: [36] } - - match: { hits.hits.0._id: "6" } - - match: { hits.hits.0._version: 66 } - - match: { hits.hits.0.inner_hits.sub_hits.hits.total: 1 } - - length: { hits.hits.0.inner_hits.sub_hits.hits.hits: 1 } - - match: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._id: "6" } - - match: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._version: 66 } - - match: { hits.hits.1._index: test } - - match: { hits.hits.1._type: _doc } - - match: { hits.hits.1.fields.numeric_group: [1] } - - match: { hits.hits.1.sort: [24] } - - match: { hits.hits.1._id: "3" } - - match: { hits.hits.1._version: 33 } - - match: { hits.hits.1.inner_hits.sub_hits.hits.total: 3 } - - length: { hits.hits.1.inner_hits.sub_hits.hits.hits: 2 } - - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._id: "2" } - - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._version: 22 } - - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._id: "1" } - - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._version: 11 } - - match: { hits.hits.2._index: test } - - match: { hits.hits.2._type: _doc } - - match: { hits.hits.2.fields.numeric_group: [25] } - - match: { hits.hits.2.sort: [10] } - - match: { hits.hits.2._id: "4" } - - match: { hits.hits.2._version: 44 } - - match: { hits.hits.2.inner_hits.sub_hits.hits.total: 2 } - - length: { hits.hits.2.inner_hits.sub_hits.hits.hits: 2 } - - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._id: "5" } - - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._version: 55 } - - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._id: "4" } - - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._version: 44 } - ---- -"field collapsing on a field alias": - - skip: - version: " - 7.5.1" - reason: the bug fix was introduced in 7.5.2 - - do: - indices.create: - index: alias-test - body: - mappings: - properties: - numeric_group: { type: alias, path: other_numeric_group } - other_numeric_group: { type: integer } - - do: - index: - index: alias-test - id: 1 - body: { other_numeric_group: 1, sort: 6 } - - do: - index: - index: alias-test - id: 2 - body: { other_numeric_group: 25, sort: 10 } - - do: - indices.refresh: - index: alias-test - - - do: - search: - rest_total_hits_as_int: true - index: [alias-test, test] - body: - collapse: { field: numeric_group, inner_hits: { name: sub_hits } } - sort: [{ sort: desc }] - - - match: { hits.total: 8 } - - length: { hits.hits: 3 } - - - match: { hits.hits.0.fields.numeric_group: [3] } - - match: { hits.hits.0.inner_hits.sub_hits.hits.total: 1} - - match: { hits.hits.1.fields.numeric_group: [1] } - - match: { hits.hits.1.inner_hits.sub_hits.hits.total: 4} - - match: { hits.hits.2.fields.numeric_group: [25] } - - match: { hits.hits.2.inner_hits.sub_hits.hits.total: 3} - ---- -"field collapsing, inner_hits and seq_no": - - - skip: - version: " - 6.99.0" - reason: "sequence numbers introduced in 7.0.0" - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - collapse: { field: numeric_group, inner_hits: { - name: sub_hits, seq_no_primary_term: true, size: 2, sort: [{ sort: asc }] - } } - sort: [{ sort: desc }] - - - match: { hits.total: 6 } - - length: { hits.hits: 3 } - - match: { hits.hits.0._index: test } - - match: { hits.hits.0.fields.numeric_group: [3] } - - match: { hits.hits.0.sort: [36] } - - match: { hits.hits.0._id: "6" } - - match: { hits.hits.0.inner_hits.sub_hits.hits.total: 1 } - - length: { hits.hits.0.inner_hits.sub_hits.hits.hits: 1 } - - match: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._id: "6" } - - gte: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._seq_no: 0 } - - gte: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._primary_term: 1 } - - match: { hits.hits.1._index: test } - - match: { hits.hits.1.fields.numeric_group: [1] } - - match: { hits.hits.1.sort: [24] } - - match: { hits.hits.1._id: "3" } - - match: { hits.hits.1.inner_hits.sub_hits.hits.total: 3 } - - length: { hits.hits.1.inner_hits.sub_hits.hits.hits: 2 } - - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._id: "2" } - - gte: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._seq_no: 0 } - - gte: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._primary_term: 1 } - - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._id: "1" } - - gte: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._seq_no: 0 } - - gte: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._primary_term: 1 } - - match: { hits.hits.2._index: test } - - match: { hits.hits.2._type: _doc } - - match: { hits.hits.2.fields.numeric_group: [25] } - - match: { hits.hits.2.sort: [10] } - - match: { hits.hits.2._id: "4" } - - match: { hits.hits.2.inner_hits.sub_hits.hits.total: 2 } - - length: { hits.hits.2.inner_hits.sub_hits.hits.hits: 2 } - - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._id: "5" } - - gte: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._seq_no: 0 } - - gte: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._primary_term: 1 } - - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._id: "4" } - - gte: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._seq_no: 0 } - - gte: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._primary_term: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/115_multiple_field_collapsing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/115_multiple_field_collapsing.yml deleted file mode 100644 index b10401f48dbce..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/115_multiple_field_collapsing.yml +++ /dev/null @@ -1,144 +0,0 @@ ---- -"two levels fields collapsing": - - skip: - version: " - 6.99.99" - reason: using multiple field collapsing from 7.0 on - - do: - indices.create: - index: addresses - body: - settings: - number_of_shards: 1 - number_of_replicas: 1 - mappings: - properties: - country: {"type": "keyword"} - city: {"type": "keyword"} - address: {"type": "text"} - - - do: - bulk: - refresh: true - body: - - '{ "index" : { "_index" : "addresses", "_id" : "1" } }' - - '{"country" : "Canada", "city" : "Saskatoon", "address" : "701 Victoria Avenue" }' - - '{ "index" : { "_index" : "addresses", "_id" : "2" } }' - - '{"country" : "Canada", "city" : "Toronto", "address" : "74 Victoria Street, Suite, 74 Victoria Street, Suite 300" }' - - '{ "index" : { "_index" : "addresses", "_id" : "3" } }' - - '{"country" : "Canada", "city" : "Toronto", "address" : "350 Victoria St" }' - - '{ "index" : { "_index" : "addresses", "_id" : "4" } }' - - '{"country" : "Canada", "city" : "Toronto", "address" : "20 Victoria Street" }' - - '{ "index" : { "_index" : "addresses", "_id" : "5" } }' - - '{"country" : "UK", "city" : "London", "address" : "58 Victoria Street" }' - - '{ "index" : { "_index" : "addresses", "_id" : "6" } }' - - '{"country" : "UK", "city" : "London", "address" : "Victoria Street Victoria Palace Theatre" }' - - '{ "index" : { "_index" : "addresses", "_id" : "7" } }' - - '{"country" : "UK", "city" : "Manchester", "address" : "75 Victoria street Westminster" }' - - '{ "index" : { "_index" : "addresses", "_id" : "8" } }' - - '{"country" : "UK", "city" : "London", "address" : "Victoria Station Victoria Arcade" }' - - - # ************* error if internal collapse contains inner_hits - - do: - catch: /parse_exception/ - search: - rest_total_hits_as_int: true - index: addresses - body: - query: { "match" : { "address" : "victoria" }} - collapse: - field: country - inner_hits: - collapse: - field : city - inner_hits: {} - - - # ************* error if internal collapse contains another collapse - - do: - catch: /parse_exception/ - search: - rest_total_hits_as_int: true - index: addresses - body: - query: { "match" : { "address" : "victoria" }} - collapse: - field: country - inner_hits: - collapse: - field : city - collapse: { field: city } - - - - # ************* top scored - - do: - search: - rest_total_hits_as_int: true - index: addresses - body: - query: { "match" : { "address" : "victoria" }} - collapse: - field: country - inner_hits: - name: by_location - size: 3 - collapse: - field : city - - - match: { hits.total: 8 } - - length: { hits.hits: 2 } - - match: { hits.hits.0.fields.country: ["UK"] } - - match: { hits.hits.0.inner_hits.by_location.hits.total: 4 } - # 2 inner hits returned instead of requested 3 as they are collapsed by city - - length: { hits.hits.0.inner_hits.by_location.hits.hits : 2} - - match: { hits.hits.0.inner_hits.by_location.hits.hits.0._id: "8" } - - match: { hits.hits.0.inner_hits.by_location.hits.hits.0.fields.city: ["London"] } - - match: { hits.hits.0.inner_hits.by_location.hits.hits.1._id: "7" } - - match: { hits.hits.0.inner_hits.by_location.hits.hits.1.fields.city: ["Manchester"] } - - - match: { hits.hits.1.fields.country: ["Canada"] } - - match: { hits.hits.1.inner_hits.by_location.hits.total: 4 } - # 2 inner hits returned instead of requested 3 as they are collapsed by city - - length: { hits.hits.1.inner_hits.by_location.hits.hits : 2 } - - match: { hits.hits.1.inner_hits.by_location.hits.hits.0._id: "1" } - - match: { hits.hits.1.inner_hits.by_location.hits.hits.0.fields.city: ["Saskatoon"] } - - match: { hits.hits.1.inner_hits.by_location.hits.hits.1._id: "3" } - - match: { hits.hits.1.inner_hits.by_location.hits.hits.1.fields.city: ["Toronto"] } - - - # ************* sorted - - do: - search: - rest_total_hits_as_int: true - index: addresses - body: - query: { "match" : { "address" : "victoria" }} - collapse: - field: country - inner_hits: - name: by_location - size: 3 - sort: [{ "city": "desc" }] - collapse: - field : city - - - match: { hits.total: 8 } - - length: { hits.hits: 2 } - - match: { hits.hits.0.fields.country: ["UK"] } - - match: { hits.hits.0.inner_hits.by_location.hits.total: 4 } - # 2 inner hits returned instead of requested 3 as they are collapsed by city - - length: { hits.hits.0.inner_hits.by_location.hits.hits : 2} - - match: { hits.hits.0.inner_hits.by_location.hits.hits.0._id: "7" } - - match: { hits.hits.0.inner_hits.by_location.hits.hits.0.fields.city: ["Manchester"] } - - match: { hits.hits.0.inner_hits.by_location.hits.hits.1._id: "5" } - - match: { hits.hits.0.inner_hits.by_location.hits.hits.1.fields.city: ["London"] } - - - match: { hits.hits.1.fields.country: ["Canada"] } - - match: { hits.hits.1.inner_hits.by_location.hits.total: 4 } - # 2 inner hits returned instead of requested 3 as they are collapsed by city - - length: { hits.hits.1.inner_hits.by_location.hits.hits : 2 } - - match: { hits.hits.1.inner_hits.by_location.hits.hits.0._id: "2" } - - match: { hits.hits.1.inner_hits.by_location.hits.hits.0.fields.city: ["Toronto"] } - - match: { hits.hits.1.inner_hits.by_location.hits.hits.1._id: "1" } - - match: { hits.hits.1.inner_hits.by_location.hits.hits.1.fields.city: ["Saskatoon"] } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/120_batch_reduce_size.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/120_batch_reduce_size.yml deleted file mode 100644 index 9c23899fc12dc..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/120_batch_reduce_size.yml +++ /dev/null @@ -1,60 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - settings: - number_of_shards: 5 - number_of_replicas: 0 - mappings: - properties: - str: - type: keyword - ---- -"batched_reduce_size lower limit": - - do: - catch: /batchedReduceSize must be >= 2/ - search: - rest_total_hits_as_int: true - index: test_1 - batched_reduce_size: 1 - - ---- -"batched_reduce_size 2 with 5 shards": - - do: - index: - index: test_1 - id: 1 - body: { "str" : "abc" } - - - do: - index: - index: test_1 - id: 2 - body: { "str": "abc" } - - - do: - index: - index: test_1 - id: 3 - body: { "str": "bcd" } - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - batched_reduce_size: 2 - body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str" } } } } - - - match: { num_reduce_phases: 4 } - - match: { hits.total: 3 } - - length: { aggregations.str_terms.buckets: 2 } - - match: { aggregations.str_terms.buckets.0.key: "abc" } - - is_false: aggregations.str_terms.buckets.0.key_as_string - - match: { aggregations.str_terms.buckets.0.doc_count: 2 } - - match: { aggregations.str_terms.buckets.1.key: "bcd" } - - is_false: aggregations.str_terms.buckets.1.key_as_string - - match: { aggregations.str_terms.buckets.1.doc_count: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/140_pre_filter_search_shards.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/140_pre_filter_search_shards.yml deleted file mode 100644 index 31f6f35003e2d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/140_pre_filter_search_shards.yml +++ /dev/null @@ -1,157 +0,0 @@ -setup: - - do: - indices.create: - index: index_1 - body: - settings: - number_of_shards: 1 - mappings: - properties: - created_at: - type: date - format: "strict_date" - - do: - indices.create: - index: index_2 - body: - settings: - number_of_shards: 1 - mappings: - properties: - created_at: - type: date - format: "strict_date" - - - do: - indices.create: - index: index_3 - body: - settings: - number_of_shards: 1 - mappings: - properties: - created_at: - type: date - format: "strict_date" - - ---- -"pre_filter_shard_size with invalid parameter": - - do: - catch: /preFilterShardSize must be >= 1/ - search: - rest_total_hits_as_int: true - index: test_1 - pre_filter_shard_size: 0 - ---- -"pre_filter_shard_size with shards that have no hit": - - do: - index: - index: index_1 - id: 1 - body: { "created_at": "2016-01-01"} - - do: - index: - index: index_2 - id: 2 - body: { "created_at": "2017-01-01" } - - - do: - index: - index: index_3 - id: 3 - body: { "created_at": "2018-01-01" } - - do: - indices.refresh: {} - - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2016-02-01", "lt": "2018-02-01"} } } } - - - match: { _shards.total: 3 } - - match: { _shards.successful: 3 } - - match: { _shards.skipped: 0 } - - match: { _shards.failed: 0 } - - match: { hits.total: 2 } - - # this is the case where we have an empty body and don't skip anything since it's match_all - - do: - search: - rest_total_hits_as_int: true - pre_filter_shard_size: 1 - - - match: { _shards.total: 3 } - - match: { _shards.successful: 3 } - - match: { _shards.skipped: 0 } - - match: { _shards.failed: 0 } - - match: { hits.total: 3 } - - # this is a case where we can actually skip due to rewrite - - do: - search: - rest_total_hits_as_int: true - pre_filter_shard_size: 1 - body: { "size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2016-02-01", "lt": "2018-02-01"} } } } - - - match: { _shards.total: 3 } - - match: { _shards.successful: 3 } - - match: { _shards.skipped : 1} - - match: { _shards.failed: 0 } - - match: { hits.total: 2 } - - # this case we skip all except of one since we need a real result - - do: - search: - rest_total_hits_as_int: true - pre_filter_shard_size: 1 - body: { "size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2019-02-01", "lt": "2020-02-01"} } } } - - - match: { _shards.total: 3 } - - match: { _shards.successful: 3 } - # skip 2 and execute one to fetch the actual empty result - - match: { _shards.skipped : 2} - - match: { _shards.failed: 0 } - - match: { hits.total: 0 } - - - do: - search: - rest_total_hits_as_int: true - pre_filter_shard_size: 1 - body: {"size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2016-02-01", "lt": "2018-02-01"} } }, "aggs" : { "some_agg" : { "global" : {} }}} - - - match: { _shards.total: 3 } - - match: { _shards.successful: 3 } - - match: { _shards.skipped : 0 } - - match: { _shards.failed: 0 } - - match: { hits.total: 2 } - - match: { aggregations.some_agg.doc_count: 3 } - - - do: - search: - rest_total_hits_as_int: true - pre_filter_shard_size: 1 - body: { "size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2016-02-01", "lt": "2018-02-01"}}}, "aggs" : { "idx_terms" : { "terms" : { "field" : "_index", "min_doc_count" : 0 } } } } - - - match: { _shards.total: 3 } - - match: { _shards.successful: 3 } - - match: { _shards.skipped : 0 } - - match: { _shards.failed: 0 } - - match: { hits.total: 2 } - - length: { aggregations.idx_terms.buckets: 3 } - - - do: - search: - rest_total_hits_as_int: true - pre_filter_shard_size: 1 - body: { "size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2016-02-01", "lt": "2018-02-01"}}}, "aggs" : { "idx_terms" : { "terms" : { "field" : "_index" } } } } - - - match: { _shards.total: 3 } - - match: { _shards.successful: 3 } - - match: { _shards.skipped : 1 } - - match: { _shards.failed: 0 } - - match: { hits.total: 2 } - - length: { aggregations.idx_terms.buckets: 2 } - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/150_rewrite_on_coordinator.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/150_rewrite_on_coordinator.yml deleted file mode 100644 index be34e10ddcd74..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/150_rewrite_on_coordinator.yml +++ /dev/null @@ -1,78 +0,0 @@ -"Ensure that we fetch the document only once": - - skip: - features: allowed_warnings - - do: - indices.create: - index: search_index - body: - settings: - number_of_shards: 5 - mappings: - properties: - user: - type: keyword - - do: - index: - index: search_index - id: 1 - body: { "user": "1" } - - - do: - index: - index: search_index - id: 2 - body: { "user": "2" } - - - do: - index: - index: search_index - id: 3 - body: { "user": "3" } - - - do: - indices.refresh: {} - - - do: - allowed_warnings: - - "Deprecated field [type] used, this field is unused and will be removed entirely" - catch: /no such index/ - search: - rest_total_hits_as_int: true - index: "search_index" - body: { "size" : 0, "query" : { "terms" : { "user" : { "index": "lookup_index", "type" : "_doc", "id": "1", "path": "followers"} } } } - - do: - indices.create: - index: lookup_index - body: - settings: - number_of_shards: 1 - mappings: - properties: - followers: - type: keyword - - do: - index: - index: lookup_index - id: 1 - body: { "followers" : ["1", "3"] } - - do: - indices.refresh: {} - - - do: - allowed_warnings: - - "Deprecated field [type] used, this field is unused and will be removed entirely" - search: - rest_total_hits_as_int: true - index: "search_index" - body: { "size" : 0, "query" : { "terms" : { "user" : { "index": "lookup_index", "type" : "_doc", "id": "1", "path": "followers"} } } } - - - match: { _shards.total: 5 } - - match: { _shards.successful: 5 } - - match: { _shards.skipped: 0 } - - match: { _shards.failed: 0 } - - match: { hits.total: 2 } - - - do: - indices.stats: { index: 'lookup_index', "metric": "get"} - - - match: { indices.lookup_index.total.get.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/160_exists_query.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/160_exists_query.yml deleted file mode 100644 index d94e86bb6c565..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/160_exists_query.yml +++ /dev/null @@ -1,1336 +0,0 @@ -setup: - - skip: - features: ["headers"] - - - do: - indices.create: - index: test - body: - mappings: - dynamic: false - properties: - binary: - type: binary - doc_values: true - boolean: - type: boolean - date: - type: date - geo_point: - type: geo_point - geo_shape: - type: geo_shape - ip: - type: ip - keyword: - type: keyword - byte: - type: byte - double: - type: double - float: - type: float - half_float: - type: half_float - integer: - type: integer - long: - type: long - short: - type: short - object: - type: object - properties: - inner1: - type: keyword - inner2: - type: keyword - text: - type: text - - - do: - headers: - Content-Type: application/json - index: - index: "test" - id: 1 - body: - binary: "YWJjZGUxMjM0" - boolean: true - date: "2017-01-01" - geo_point: [0.0, 20.0] - geo_shape: - type: "point" - coordinates: [0.0, 20.0] - ip: "192.168.0.1" - keyword: "foo" - byte: 1 - double: 1.0 - float: 1.0 - half_float: 1.0 - integer: 1 - long: 1 - short: 1 - object: - inner1: "foo" - inner2: "bar" - text: "foo bar" - - - do: - headers: - Content-Type: application/json - index: - index: "test" - id: 2 - body: - binary: "YWJjZGUxMjM0" - boolean: false - date: "2017-01-01" - geo_point: [0.0, 20.0] - geo_shape: - type: "point" - coordinates: [0.0, 20.0] - ip: "192.168.0.1" - keyword: "foo" - byte: 1 - double: 1.0 - float: 1.0 - half_float: 1.0 - integer: 1 - long: 1 - short: 1 - object: - inner1: "foo" - text: "foo bar" - - - do: - headers: - Content-Type: application/json - index: - index: "test" - id: 3 - routing: "route_me" - body: - binary: "YWJjZGUxMjM0" - boolean: true - date: "2017-01-01" - geo_point: [0.0, 20.0] - geo_shape: - type: "point" - coordinates: [0.0, 20.0] - ip: "192.168.0.1" - keyword: "foo" - byte: 1 - double: 1.0 - float: 1.0 - half_float: 1.0 - integer: 1 - long: 1 - short: 1 - object: - inner2: "bar" - text: "foo bar" - - - do: - index: - index: "test" - id: 4 - body: {} - - - do: - indices.create: - index: test-no-dv - body: - mappings: - dynamic: false - properties: - binary: - type: binary - doc_values: false - store: true - boolean: - type: boolean - doc_values: false - date: - type: date - doc_values: false - geo_point: - type: geo_point - doc_values: false - geo_shape: - type: geo_shape - ip: - type: ip - doc_values: false - keyword: - type: keyword - doc_values: false - byte: - type: byte - doc_values: false - double: - type: double - doc_values: false - float: - type: float - doc_values: false - half_float: - type: half_float - doc_values: false - integer: - type: integer - doc_values: false - long: - type: long - doc_values: false - short: - type: short - doc_values: false - object: - type: object - properties: - inner1: - type: keyword - doc_values: false - inner2: - type: keyword - doc_values: false - text: - type: text - doc_values: false - - - do: - headers: - Content-Type: application/json - index: - index: "test-no-dv" - id: 1 - body: - binary: "YWJjZGUxMjM0" - boolean: true - date: "2017-01-01" - geo_point: [0.0, 20.0] - geo_shape: - type: "point" - coordinates: [0.0, 20.0] - ip: "192.168.0.1" - keyword: "foo" - byte: 1 - double: 1.0 - float: 1.0 - half_float: 1.0 - integer: 1 - long: 1 - short: 1 - object: - inner1: "foo" - inner2: "bar" - text: "foo bar" - - - do: - headers: - Content-Type: application/json - index: - index: "test-no-dv" - id: 2 - body: - binary: "YWJjZGUxMjM0" - boolean: false - date: "2017-01-01" - geo_point: [0.0, 20.0] - geo_shape: - type: "point" - coordinates: [0.0, 20.0] - ip: "192.168.0.1" - keyword: "foo" - byte: 1 - double: 1.0 - float: 1.0 - half_float: 1.0 - integer: 1 - long: 1 - short: 1 - object: - inner1: "foo" - text: "foo bar" - - - do: - headers: - Content-Type: application/json - index: - index: "test-no-dv" - id: 3 - routing: "route_me" - body: - binary: "YWJjZGUxMjM0" - boolean: true - date: "2017-01-01" - geo_point: [0.0, 20.0] - geo_shape: - type: "point" - coordinates: [0.0, 20.0] - ip: "192.168.0.1" - keyword: "foo" - byte: 1 - double: 1.0 - float: 1.0 - half_float: 1.0 - integer: 1 - long: 1 - short: 1 - object: - inner2: "bar" - text: "foo bar" - - - do: - index: - index: "test-no-dv" - id: 4 - body: {} - - - do: - indices.create: - index: test-unmapped - body: - mappings: - dynamic: false - properties: - unrelated: - type: keyword - - - do: - index: - index: "test-unmapped" - id: 1 - body: - unrelated: "foo" - - - do: - indices.create: - index: test-empty - body: - mappings: - dynamic: false - properties: - binary: - type: binary - date: - type: date - geo_point: - type: geo_point - geo_shape: - type: geo_shape - ip: - type: ip - keyword: - type: keyword - byte: - type: byte - double: - type: double - float: - type: float - half_float: - type: half_float - integer: - type: integer - long: - type: long - short: - type: short - object: - type: object - properties: - inner1: - type: keyword - inner2: - type: keyword - text: - type: text - - - do: - indices.refresh: - index: [test, test-unmapped, test-empty, test-no-dv] - ---- -"Test exists query on mapped binary field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: binary - - - match: {hits.total: 3} - ---- -"Test exists query on mapped boolean field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: boolean - - - match: {hits.total: 3} - ---- -"Test exists query on mapped date field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: date - - - match: {hits.total: 3} - ---- -"Test exists query on mapped geo_point field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: geo_point - - - match: {hits.total: 3} - ---- -"Test exists query on mapped geo_shape field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: geo_shape - - - match: {hits.total: 3} - ---- -"Test exists query on mapped ip field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: ip - - - match: {hits.total: 3} - ---- -"Test exists query on mapped keyword field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: keyword - - - match: {hits.total: 3} - ---- -"Test exists query on mapped byte field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: byte - - - match: {hits.total: 3} - ---- -"Test exists query on mapped double field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: double - - - match: {hits.total: 3} - ---- -"Test exists query on mapped float field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: float - - - match: {hits.total: 3} - ---- -"Test exists query on mapped half_float field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: half_float - - - match: {hits.total: 3} - ---- -"Test exists query on mapped integer field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: integer - - - match: {hits.total: 3} - ---- -"Test exists query on mapped long field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: long - - - match: {hits.total: 3} - ---- -"Test exists query on mapped short field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: short - - - match: {hits.total: 3} - ---- -"Test exists query on mapped object field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: object - - - match: {hits.total: 3} - ---- -"Test exists query on mapped object inner field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: object.inner1 - - - match: {hits.total: 2} - ---- -"Test exists query on mapped text field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: text - - - match: {hits.total: 3} - ---- -"Test exists query on _id field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: _id - - - match: {hits.total: 4} - ---- -"Test exists query on _index field": - - skip: - version: " - 6.0.99" - reason: exists on _index not supported prior to 6.1.0 - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: _index - - - match: {hits.total: 4} - ---- -"Test exists query on _type field": - - skip: - version: " - 6.0.99" - reason: exists on _type not supported prior to 6.1.0 - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: _type - - - match: {hits.total: 4} - ---- -"Test exists query on _routing field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: _routing - - - match: {hits.total: 1} - ---- -"Test exists query on _seq_no field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: _seq_no - - - match: {hits.total: 4} - ---- -"Test exists query on _source field": - - skip: - version: " - 6.0.99" - reason: exists on _source not supported prior to 6.1.0 - - do: - catch: /query_shard_exception/ - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: _source - ---- -"Test exists query on _version field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: _version - - - match: {hits.total: 4} - ---- -"Test exists query on unmapped binary field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: binary - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped boolean field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: boolean - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped date field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: date - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped geo_point field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: geo_point - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped geo_shape field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: geo_shape - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped ip field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: ip - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped keyword field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: keyword - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped byte field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: byte - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped double field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: double - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped float field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: float - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped half_float field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: half_float - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped integer field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: integer - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped long field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: long - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped short field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: short - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped object field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: object - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped object inner field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: object.inner1 - - - match: {hits.total: 0} - ---- -"Test exists query on unmapped text field": - - do: - search: - rest_total_hits_as_int: true - index: test-unmapped - body: - query: - exists: - field: text - - - match: {hits.total: 0} - ---- -"Test exists query on binary field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: binary - - - match: {hits.total: 0} - ---- -"Test exists query on boolean field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: boolean - - - match: {hits.total: 0} - ---- -"Test exists query on date field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: date - - - match: {hits.total: 0} - ---- -"Test exists query on geo_point field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: geo_point - - - match: {hits.total: 0} - ---- -"Test exists query on geo_shape field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: geo_shape - - - match: {hits.total: 0} - ---- -"Test exists query on ip field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: ip - - - match: {hits.total: 0} - ---- -"Test exists query on keyword field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: keyword - - - match: {hits.total: 0} - ---- -"Test exists query on byte field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: byte - - - match: {hits.total: 0} - ---- -"Test exists query on double field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: double - - - match: {hits.total: 0} - ---- -"Test exists query on float field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: float - - - match: {hits.total: 0} - ---- -"Test exists query on half_float field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: half_float - - - match: {hits.total: 0} - ---- -"Test exists query on integer field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: integer - - - match: {hits.total: 0} - ---- -"Test exists query on long field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: long - - - match: {hits.total: 0} - ---- -"Test exists query on short field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: short - - - match: {hits.total: 0} - ---- -"Test exists query on object field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: object - - - match: {hits.total: 0} - ---- -"Test exists query on object inner field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: object.inner1 - - - match: {hits.total: 0} - ---- -"Test exists query on text field in empty index": - - do: - search: - rest_total_hits_as_int: true - index: test-empty - body: - query: - exists: - field: text - - - match: {hits.total: 0} - ---- -"Test exists query on mapped binary field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: binary - - - match: {hits.total: 3} - ---- -"Test exists query on mapped boolean field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: boolean - - - match: {hits.total: 3} - ---- -"Test exists query on mapped date field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: date - - - match: {hits.total: 3} - ---- -"Test exists query on mapped geo_point field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: geo_point - - - match: {hits.total: 3} - ---- -"Test exists query on mapped geo_shape field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: geo_shape - - - match: {hits.total: 3} - ---- -"Test exists query on mapped ip field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: ip - - - match: {hits.total: 3} - ---- -"Test exists query on mapped keyword field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: keyword - - - match: {hits.total: 3} - ---- -"Test exists query on mapped byte field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: byte - - - match: {hits.total: 3} - ---- -"Test exists query on mapped double field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: double - - - match: {hits.total: 3} - ---- -"Test exists query on mapped float field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: float - - - match: {hits.total: 3} - ---- -"Test exists query on mapped half_float field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: half_float - - - match: {hits.total: 3} - ---- -"Test exists query on mapped integer field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: integer - - - match: {hits.total: 3} - ---- -"Test exists query on mapped long field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: long - - - match: {hits.total: 3} - ---- -"Test exists query on mapped short field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: short - - - match: {hits.total: 3} - ---- -"Test exists query on mapped object field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: object - - - match: {hits.total: 3} - ---- -"Test exists query on mapped object inner field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: object.inner1 - - - match: {hits.total: 2} - ---- -"Test exists query on mapped text field with no doc values": - - do: - search: - rest_total_hits_as_int: true - index: test-no-dv - body: - query: - exists: - field: text - - - match: {hits.total: 3} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/170_terms_query.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/170_terms_query.yml deleted file mode 100644 index 89ea24618c68f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/170_terms_query.yml +++ /dev/null @@ -1,58 +0,0 @@ ---- -"Terms Query with No.of terms exceeding index.max_terms_count should FAIL": - - skip: - version: " - 6.99.99" - reason: index.max_terms_count setting has been added in 7.0.0 - - do: - indices.create: - index: test_index - body: - settings: - number_of_shards: 1 - index.max_terms_count: 2 - mappings: - properties: - user: - type: keyword - followers: - type: keyword - - do: - bulk: - refresh: true - body: - - '{"index": {"_index": "test_index", "_id": "u1"}}' - - '{"user": "u1", "followers": ["u2", "u3"]}' - - '{"index": {"_index": "test_index", "_id": "u2"}}' - - '{"user": "u2", "followers": ["u1", "u3", "u4"]}' - - '{"index": {"_index": "test_index", "_id": "u3"}}' - - '{"user": "u3", "followers": ["u1"]}' - - '{"index": {"_index": "test_index", "_id": "u4"}}' - - '{"user": "u4", "followers": ["u3"]}' - - - do: - search: - rest_total_hits_as_int: true - index: test_index - body: {"query" : {"terms" : {"user" : ["u1", "u2"]}}} - - match: { hits.total: 2 } - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - index: test_index - body: {"query" : {"terms" : {"user" : ["u1", "u2", "u3"]}}} - - - do: - search: - rest_total_hits_as_int: true - index: test_index - body: {"query" : {"terms" : {"user" : {"index" : "test_index", "id" : "u1", "path" : "followers"}}}} - - match: { hits.total: 2 } - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - index: test_index - body: {"query" : {"terms" : {"user" : {"index" : "test_index", "id" : "u2", "path" : "followers"}}}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/171_terms_query_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/171_terms_query_with_types.yml deleted file mode 100644 index d3d48eae4082d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/171_terms_query_with_types.yml +++ /dev/null @@ -1,63 +0,0 @@ ---- -"Terms Query with No.of terms exceeding index.max_terms_count should FAIL": - - skip: - version: " - 6.99.99" - reason: index.max_terms_count setting has been added in 7.0.0 - features: allowed_warnings - - do: - indices.create: - include_type_name: true - index: test_index - body: - settings: - number_of_shards: 1 - index.max_terms_count: 2 - mappings: - test_type: - properties: - user: - type: keyword - followers: - type: keyword - - do: - bulk: - refresh: true - body: - - '{"index": {"_index": "test_index", "_type": "test_type", "_id": "u1"}}' - - '{"user": "u1", "followers": ["u2", "u3"]}' - - '{"index": {"_index": "test_index", "_type": "test_type", "_id": "u2"}}' - - '{"user": "u2", "followers": ["u1", "u3", "u4"]}' - - '{"index": {"_index": "test_index", "_type": "test_type", "_id": "u3"}}' - - '{"user": "u3", "followers": ["u1"]}' - - '{"index": {"_index": "test_index", "_type": "test_type", "_id": "u4"}}' - - '{"user": "u4", "followers": ["u3"]}' - - - do: - search: - rest_total_hits_as_int: true - index: test_index - body: {"query" : {"terms" : {"user" : ["u1", "u2"]}}} - - match: { hits.total: 2 } - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - index: test_index - body: {"query" : {"terms" : {"user" : ["u1", "u2", "u3"]}}} - - - do: - allowed_warnings: - - "Deprecated field [type] used, this field is unused and will be removed entirely" - search: - rest_total_hits_as_int: true - index: test_index - body: {"query" : {"terms" : {"user" : {"index" : "test_index", "type" : "test_type", "id" : "u1", "path" : "followers"}}}} - - match: { hits.total: 2 } - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - index: test_index - body: {"query" : {"terms" : {"user" : {"index" : "test_index", "type" : "test_type", "id" : "u2", "path" : "followers"}}}} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml deleted file mode 100644 index 29237dcee48e0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -"Test Index and Search locale dependent mappings / dates": - - - skip: - version: "all" - reason: "Awaits fix: https://github.com/elastic/elasticsearch/issues/49719" - - - do: - indices.create: - index: test_index - body: - settings: - number_of_shards: 1 - mappings: - properties: - date_field: - type: date - format: "8E, d MMM uuuu HH:mm:ss Z" - locale: "de" - - do: - bulk: - refresh: true - body: - - '{"index": {"_index": "test_index", "_id": "1"}}' - - '{"date_field": "Mi, 06 Dez 2000 02:55:00 -0800"}' - - '{"index": {"_index": "test_index", "_id": "2"}}' - - '{"date_field": "Do, 07 Dez 2000 02:55:00 -0800"}' - - - do: - search: - rest_total_hits_as_int: true - index: test_index - body: {"query" : {"range" : {"date_field" : {"gte": "Di, 05 Dez 2000 02:55:00 -0800", "lte": "Do, 07 Dez 2000 00:00:00 -0800"}}}} - - match: { hits.total: 1 } - - - do: - search: - rest_total_hits_as_int: true - index: test_index - body: {"query" : {"range" : {"date_field" : {"gte": "Di, 05 Dez 2000 02:55:00 -0800", "lte": "Fr, 08 Dez 2000 00:00:00 -0800"}}}} - - match: { hits.total: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/190_index_prefix_search.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/190_index_prefix_search.yml deleted file mode 100644 index 40c80b88cfb1b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/190_index_prefix_search.yml +++ /dev/null @@ -1,104 +0,0 @@ -setup: - - skip: - version: " - 6.2.99" - reason: index_prefixes is only available as of 6.3.0 - - - do: - indices.create: - index: test - body: - mappings: - properties: - text: - type: text - index_prefixes: - min_chars: 2 - max_chars: 5 - - - do: - index: - index: test - id: 1 - body: { text: some short words with a stupendously long one } - - - do: - indices.refresh: - index: [test] - ---- -"search with index prefixes": - - skip: - version: " - 6.2.99" - reason: index_prefixes is only available as of 6.3.0 - - do: - search: - rest_total_hits_as_int: true - index: test - q: shor* - df: text - - - match: {hits.total: 1} - - match: {hits.max_score: 1} - - match: {hits.hits.0._score: 1} - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - query_string: - default_field: text - query: shor* - boost: 2 - - - match: {hits.total: 1} - - match: {hits.max_score: 2} - - match: {hits.hits.0._score: 2} - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - explain: true - query: - query_string: - default_field: text - query: a* - boost: 2 - - - match: {hits.total: 1} - - match: {hits.max_score: 2} - - match: {hits.hits.0._score: 2} - - - do: - search: - rest_total_hits_as_int: true - index: test - q: stupendousl* - df: text - - - match: {hits.total: 1} - - match: {hits.max_score: 1} - - match: {hits.hits.0._score: 1} - ---- -"search index prefixes with span_multi": - - skip: - version: " - 6.99.99" - reason: span_multi throws an exception with prefix fields on < versions - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - span_near: - clauses: [ - { "span_term": { "text": "short" } }, - { "span_multi": { "match": { "prefix": { "text": "word" } } } } - ] - - - match: {hits.total: 1} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/200_ignore_malformed.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/200_ignore_malformed.yml deleted file mode 100644 index 71ddb32302396..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/200_ignore_malformed.yml +++ /dev/null @@ -1,93 +0,0 @@ ---- -setup: - - skip: - version: " - 6.3.99" - reason: _ignored was added in 6.4.0 - - - do: - indices.create: - index: test - body: - mappings: - properties: - my_date: - type: date - ignore_malformed: true - store: true - my_ip: - type: ip - ignore_malformed: true - - - do: - index: - index: test - id: 1 - body: { "my_date": "2018-05-11", "my_ip": ":::1" } - - - do: - index: - index: test - id: 2 - body: { "my_date": "bar", "my_ip": "192.168.1.42" } - - - do: - index: - index: test - id: 3 - body: { "my_date": "bar", "my_ip": "quux" } - - - do: - indices.refresh: {} - ---- -"Exists on _ignored": - - - do: - search: - rest_total_hits_as_int: true - body: { query: { exists: { "field": "_ignored" } } } - - - length: { hits.hits: 3 } - ---- -"Search on _ignored with term": - - - do: - search: - rest_total_hits_as_int: true - body: { query: { term: { "_ignored": "my_date" } } } - - - length: { hits.hits: 2 } - ---- -"Search on _ignored with terms": - - - do: - search: - rest_total_hits_as_int: true - body: { query: { terms: { "_ignored": [ "my_date", "my_ip" ] } } } - - - length: { hits.hits: 3 } - ---- -"_ignored is returned by default": - - - do: - search: - rest_total_hits_as_int: true - body: { query: { ids: { "values": [ "3" ] } } } - - - length: { hits.hits: 1 } - - length: { hits.hits.0._ignored: 2} - ---- -"_ignored is still returned with explicit list of stored fields": - - - do: - search: - rest_total_hits_as_int: true - stored_fields: [ "my_date" ] - body: { query: { ids: { "values": [ "3" ] } } } - - - length: { hits.hits: 1 } - - is_true: hits.hits.0._ignored diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/200_index_phrase_search.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/200_index_phrase_search.yml deleted file mode 100644 index b48857be4e7a1..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/200_index_phrase_search.yml +++ /dev/null @@ -1,67 +0,0 @@ ---- -"search with indexed phrases": - - skip: - version: " - 6.99.99" - reason: index_phrase is only available as of 7.0.0 - - do: - indices.create: - index: test - body: - mappings: - properties: - text: - type: text - index_phrases: true - - - do: - index: - index: test - id: 1 - body: { text: "peter piper picked a peck of pickled peppers" } - - - do: - indices.refresh: - index: [test] - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - match_phrase: - text: - query: "peter piper" - - - match: {hits.total: 1} - - - do: - search: - rest_total_hits_as_int: true - index: test - q: '"peter piper"~1' - df: text - - - match: {hits.total: 1} - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - match_phrase: - text: "peter piper picked" - - - match: {hits.total: 1} - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - match_phrase: - text: "piper" - - - match: {hits.total: 1} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/20_default_values.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/20_default_values.yml deleted file mode 100644 index fd4621e48cad3..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/20_default_values.yml +++ /dev/null @@ -1,89 +0,0 @@ -setup: - - do: - indices.create: - index: test_2 - - do: - indices.create: - index: test_1 - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - index: - index: test_2 - id: 42 - body: { foo: bar } - - - do: - indices.refresh: - index: [test_1, test_2] - ---- -"Basic search": - - - do: - search: - rest_total_hits_as_int: true - index: _all - body: - query: - match: - foo: bar - - - match: {hits.total: 2} - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: - match: - foo: bar - - - match: {hits.total: 1} - - match: {hits.hits.0._index: test_1 } - - match: {hits.hits.0._type: _doc } - - match: {hits.hits.0._id: "1" } - - - do: - search: - rest_total_hits_as_int: true - index: test_2 - body: - query: - match: - foo: bar - - - match: {hits.total: 1} - - match: {hits.hits.0._index: test_2 } - - match: {hits.hits.0._type: _doc } - - match: {hits.hits.0._id: "42" } - ---- -"Search body without query element": - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - body: - match: - foo: bar - ---- -"Search with new response format": - - skip: - version: " - 6.99.99" - reason: hits.total is returned as an object in 7.0.0 - - do: - search: - body: - query: - match_all: {} - - - match: {hits.total.value: 2} - - match: {hits.total.relation: eq} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/210_rescore_explain.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/210_rescore_explain.yml deleted file mode 100644 index 92bb049980dff..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/210_rescore_explain.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -"Score should match explanation in rescore": - - skip: - version: " - 6.99.99" - reason: Explanation for rescoring was corrected after these versions - - do: - bulk: - refresh: true - body: - - '{"index": {"_index": "test_index", "_id": "1"}}' - - '{"f1": "1"}' - - '{"index": {"_index": "test_index", "_id": "2"}}' - - '{"f1": "2"}' - - '{"index": {"_index": "test_index", "_id": "3"}}' - - '{"f1": "3"}' - - - do: - search: - rest_total_hits_as_int: true - index: test_index - body: - explain: true - query: - match_all: {} - rescore: - window_size: 2 - query: - rescore_query: - match_all: {} - query_weight: 5 - rescore_query_weight: 10 - - - match: {hits.max_score: 15} - - match: { hits.hits.0._score: 15 } - - match: { hits.hits.0._explanation.value: 15 } - - - match: { hits.hits.1._score: 15 } - - match: { hits.hits.1._explanation.value: 15 } - - - match: { hits.hits.2._score: 5 } - - match: { hits.hits.2._explanation.value: 5 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/220_total_hits_object.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/220_total_hits_object.yml deleted file mode 100644 index 0aad77c02cb1f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/220_total_hits_object.yml +++ /dev/null @@ -1,176 +0,0 @@ -setup: - - do: - indices.create: - index: test_2 - - - do: - indices.create: - index: test_1 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - index: - index: test_1 - id: 3 - body: { foo: baz } - - - do: - index: - index: test_1 - id: 2 - body: { foo: bar } - - - do: - index: - index: test_1 - id: 4 - body: { foo: bar } - - - do: - index: - index: test_2 - id: 42 - body: { foo: bar } - - - do: - index: - index: test_2 - id: 24 - body: { foo: baz } - - - do: - index: - index: test_2 - id: 36 - body: { foo: bar } - - - do: - indices.refresh: - index: [test_1, test_2] - ---- -"hits.total as an object": - - skip: - version: " - 7.0.99" - reason: hits.total is rendered as an object in 7.0.0 - - - do: - search: - index: _all - body: - query: - match: - foo: bar - - - match: {hits.total.value: 5} - - match: {hits.total.relation: eq} - - - do: - search: - index: test_1 - body: - query: - match: - foo: bar - - - match: {hits.total.value: 3} - - match: {hits.total.relation: eq} - - - do: - search: - track_total_hits: false - index: _all - body: - query: - match: - foo: bar - - - is_false: hits.total - - - do: - search: - track_total_hits: 4 - body: - query: - match: - foo: bar - - - match: {hits.total.value: 4} - - match: {hits.total.relation: gte} - - - - do: - search: - size: 0 - track_total_hits: 4 - body: - query: - match: - foo: bar - - - match: {hits.total.value: 4} - - match: {hits.total.relation: gte} - - - do: - search: - size: 0 - track_total_hits: 5 - body: - query: - match: - foo: bar - - - match: {hits.total.value: 5} - - match: {hits.total.relation: eq} - - - do: - catch: /\[rest_total_hits_as_int\] cannot be used if the tracking of total hits is not accurate, got 100/ - search: - rest_total_hits_as_int: true - index: test_2 - track_total_hits: 100 - body: - query: - match: - foo: bar - - - do: - catch: /\[track_total_hits\] parameter must be positive or equals to -1, got -2/ - search: - rest_total_hits_as_int: true - index: test_2 - track_total_hits: -2 - body: - query: - match: - foo: bar - ---- -"track_total_hits with rest_total_hits_as_int": - - do: - search: - track_total_hits: false - rest_total_hits_as_int: true - index: _all - body: - query: - match: - foo: bar - - - match: {hits.total: -1} - - - do: - search: - rest_total_hits_as_int: true - index: test_2 - body: - query: - match: - foo: bar - - - match: {hits.total: 2} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/230_interval_query.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/230_interval_query.yml deleted file mode 100644 index 78380d0da6a71..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/230_interval_query.yml +++ /dev/null @@ -1,450 +0,0 @@ -setup: - - skip: - version: " - 6.99.99" - reason: "Implemented in 7.0" - - - do: - indices.create: - index: test - body: - mappings: - properties: - text: - type: text - analyzer: standard - - do: - bulk: - refresh: true - body: - - '{"index": {"_index": "test", "_id": "1"}}' - - '{"text" : "Some like it hot, some like it cold"}' - - '{"index": {"_index": "test", "_id": "2"}}' - - '{"text" : "Its cold outside, theres no kind of atmosphere"}' - - '{"index": {"_index": "test", "_id": "3"}}' - - '{"text" : "Baby its cold there outside"}' - - '{"index": {"_index": "test", "_id": "4"}}' - - '{"text" : "Outside it is cold and wet"}' - ---- -"Test ordered matching": - - do: - search: - index: test - body: - query: - intervals: - text: - match: - query: "cold outside" - ordered: true - - match: { hits.total.value: 2 } - ---- -"Test default unordered matching": - - do: - search: - index: test - body: - query: - intervals: - text: - match: - query: "cold outside" - - match: { hits.total.value: 3 } - ---- -"Test explicit unordered matching": - - do: - search: - index: test - body: - query: - intervals: - text: - match: - query: "cold outside" - ordered: false - - match: { hits.total.value: 3 } - ---- -"Test phrase matching": - - do: - search: - index: test - body: - query: - intervals: - text: - match: - query: "cold outside" - ordered: true - max_gaps: 0 - - match: { hits.total.value: 1 } - ---- -"Test unordered max_gaps matching": - - do: - search: - index: test - body: - query: - intervals: - text: - match: - query: "cold outside" - max_gaps: 1 - - match: { hits.total.value: 2 } - ---- -"Test ordered max_gaps matching": - - do: - search: - index: test - body: - query: - intervals: - text: - match: - query: "cold outside" - max_gaps: 0 - ordered: true - - match: { hits.total.value: 1 } - ---- -"Test ordered combination with disjunction": - - do: - search: - index: test - body: - query: - intervals: - text: - all_of: - intervals: - - any_of: - intervals: - - match: - query: "cold" - - match: - query: "outside" - - match: - query: "atmosphere" - ordered: true - - match: { hits.total.value: 1 } - ---- -"Test ordered combination with max_gaps": - - do: - search: - index: test - body: - query: - intervals: - text: - all_of: - intervals: - - match: - query: "cold" - - match: - query: "outside" - max_gaps: 0 - ordered: true - - match: { hits.total.value: 1 } - ---- -"Test ordered combination": - - do: - search: - index: test - body: - query: - intervals: - text: - all_of: - intervals: - - match: - query: "cold" - - match: - query: "outside" - ordered: true - - match: { hits.total.value: 2 } - ---- -"Test unordered combination": - - do: - search: - index: test - body: - query: - intervals: - text: - all_of: - intervals: - - match: - query: "cold" - - match: - query: "outside" - max_gaps: 1 - ordered: false - - match: { hits.total.value: 2 } - ---- -"Test block combination": - - do: - search: - index: test - body: - query: - intervals: - text: - all_of: - intervals: - - match: - query: "cold" - - match: - query: "outside" - ordered: true - max_gaps: 0 - - match: { hits.total.value: 1 } - - ---- -"Test containing": - - do: - search: - index: test - body: - query: - intervals: - text: - all_of: - intervals: - - match: - query: "cold" - - match: - query: "outside" - ordered: false - filter: - containing: - match: - query: "is" - - match: { hits.total.value: 1 } - - ---- -"Test not containing": - - do: - search: - index: test - body: - query: - intervals: - text: - all_of: - intervals: - - match: - query: "cold" - - match: - query: "outside" - ordered: false - filter: - not_containing: - match: - query: "is" - - match: { hits.total.value: 2 } - ---- -"Test contained_by": - - do: - search: - index: test - body: - query: - intervals: - text: - match: - query: "is" - filter: - contained_by: - all_of: - intervals: - - match: - query: "cold" - - match: - query: "outside" - ordered: false - - match: { hits.total.value: 1 } - ---- -"Test not_contained_by": - - do: - search: - index: test - body: - query: - intervals: - text: - match: - query: "it" - filter: - not_contained_by: - all_of: - intervals: - - match: - query: "cold" - - match: - query: "outside" - - match: { hits.total.value: 1 } - ---- -"Test not_overlapping": - - do: - search: - index: test - body: - query: - intervals: - text: - all_of: - intervals: - - match: - query: "cold" - - match: - query: "outside" - ordered: true - filter: - not_overlapping: - all_of: - intervals: - - match: - query: "baby" - - match: - query: "there" - ordered: false - - match: { hits.total.value: 1 } - ---- -"Test overlapping": - - skip: - version: " - 7.1.99" - reason: "Implemented in 7.2" - - do: - search: - index: test - body: - query: - intervals: - text: - match: - query: "cold outside" - ordered: true - filter: - overlapping: - match: - query: "baby there" - ordered: false - - match: { hits.total.value: 1 } - - match: { hits.hits.0._id: "3" } - ---- -"Test before": - - skip: - version: " - 7.1.99" - reason: "Implemented in 7.2" - - do: - search: - index: test - body: - query: - intervals: - text: - match: - query: "cold" - filter: - before: - match: - query: "outside" - - match: { hits.total.value: 2 } - ---- -"Test after": - - skip: - version: " - 7.1.99" - reason: "Implemented in 7.2" - - do: - search: - index: test - body: - query: - intervals: - text: - match: - query: "cold" - filter: - after: - match: - query: "outside" - - match: { hits.total.value: 1 } - - match: { hits.hits.0._id: "4" } - ---- -"Test prefix": - - skip: - version: " - 7.2.99" - reason: "Implemented in 7.3" - - do: - search: - index: test - body: - query: - intervals: - text: - all_of: - intervals: - - match: - query: cold - - prefix: - prefix: out - - match: { hits.total.value: 3 } - ---- -"Test wildcard": - - skip: - version: " - 7.2.99" - reason: "Implemented in 7.3" - - do: - search: - index: test - body: - query: - intervals: - text: - all_of: - intervals: - - match: - query: cold - - wildcard: - pattern: out?ide - - match: { hits.total.value: 3 } - ---- -"Test fuzzy match": - - skip: - version: " - 7.5.99" - reason: "Implemented in 7.6" - - do: - search: - index: test - body: - query: - intervals: - text: - all_of: - intervals: - - fuzzy: - term: cald - - prefix: - prefix: out - - match: { hits.total.value: 3 } - - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/240_date_nanos.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/240_date_nanos.yml deleted file mode 100644 index 6aaece2f9c58d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/240_date_nanos.yml +++ /dev/null @@ -1,164 +0,0 @@ -setup: - - skip: - version: " - 6.99.99" - reason: "Implemented in 7.0" - - - do: - indices.create: - index: date_ns - body: - settings: - number_of_shards: 3 - number_of_replicas: 0 - mappings: - properties: - date: - type: date_nanos - field: - type: long - - - do: - indices.create: - index: date_ms - body: - settings: - number_of_shards: 3 - number_of_replicas: 0 - mappings: - properties: - date: - type: date - field: - type: long - ---- -"test sorting against date_nanos only fields": - - - do: - bulk: - refresh: true - body: - - '{ "index" : { "_index" : "date_ns", "_id" : "first" } }' - # millis [1540815132987] to nanos [1540815132987654321] - - '{"date" : "2018-10-29T12:12:12.123456789Z", "field" : 1 }' - - '{ "index" : { "_index" : "date_ns", "_id" : "second" } }' - # millis [1540815132123] to nanos [1540815132123456789] - - '{"date" : "2018-10-29T12:12:12.987654321Z", "field" : 2 }' - - - do: - search: - rest_total_hits_as_int: true - index: date_ns* - body: - sort: [ { "date": "desc" } ] - - - match: { hits.total: 2 } - - length: { hits.hits: 2 } - - match: { hits.hits.0._id: "second" } - - match: { hits.hits.0.sort: [1540815132987654321] } - - match: { hits.hits.1._id: "first" } - - match: { hits.hits.1.sort: [1540815132123456789] } - - - do: - search: - rest_total_hits_as_int: true - index: date_ns* - body: - sort: [ { "date": "asc" } ] - - - match: { hits.total: 2 } - - length: { hits.hits: 2 } - - match: { hits.hits.0._id: "first" } - - match: { hits.hits.0.sort: [1540815132123456789] } - - match: { hits.hits.1._id: "second" } - - match: { hits.hits.1.sort: [1540815132987654321] } - - ---- -"date_nanos requires dates after 1970 and before 2262": - - - do: - bulk: - refresh: true - body: - - '{ "index" : { "_index" : "date_ns", "_id" : "date_ns_1" } }' - - '{"date" : "1969-10-28T12:12:12.123456789Z" }' - - '{ "index" : { "_index" : "date_ns", "_id" : "date_ns_2" } }' - - '{"date" : "2263-10-29T12:12:12.123456789Z" }' - - - match: { errors: true } - - match: { items.0.index.status: 400 } - - match: { items.0.index.error.type: mapper_parsing_exception } - - match: { items.0.index.error.caused_by.reason: "date[1969-10-28T12:12:12.123456789Z] is before the epoch in 1970 and cannot be stored in nanosecond resolution" } - - match: { items.1.index.status: 400 } - - match: { items.1.index.error.type: mapper_parsing_exception } - - match: { items.1.index.error.caused_by.reason: "date[2263-10-29T12:12:12.123456789Z] is after 2262-04-11T23:47:16.854775807 and cannot be stored in nanosecond resolution" } - - ---- -"doc value fields are working as expected across date and date_nanos fields": - - - do: - bulk: - refresh: true - body: - - '{ "index" : { "_index" : "date_ns", "_id" : "date_ns_1" } }' - - '{"date" : "2018-10-29T12:12:12.123456789Z", "field" : 1 }' - - '{ "index" : { "_index" : "date_ms", "_id" : "date_ms_1" } }' - - '{"date" : "2018-10-29T12:12:12.987Z" }' - - - do: - search: - rest_total_hits_as_int: true - index: date* - body: - docvalue_fields: [ { "field": "date", "format" : "strict_date_optional_time" }, { "field": "date", "format": "epoch_millis" }, { "field" : "date", "format": "uuuu-MM-dd'T'HH:mm:ss.SSSSSSSSSX" } ] - sort: [ { "date": "desc" } ] - - - match: { hits.total: 2 } - - length: { hits.hits: 2 } - - match: { hits.hits.0._id: "date_ns_1" } - - match: { hits.hits.1._id: "date_ms_1" } - - match: { hits.hits.0.fields.date: [ "2018-10-29T12:12:12.123Z", "1540815132123.456789", "2018-10-29T12:12:12.123456789Z" ] } - - match: { hits.hits.1.fields.date: [ "2018-10-29T12:12:12.987Z", "1540815132987", "2018-10-29T12:12:12.987000000Z" ] } - ---- -"date histogram aggregation with date and date_nanos mapping": - - skip: - version: " - 7.1.99" - reason: calendar_interval introduced in 7.2.0 - - - do: - bulk: - refresh: true - body: - - '{ "index" : { "_index" : "date_ns", "_id" : "date_ns_1" } }' - - '{"date" : "2018-10-29T12:12:12.123456789Z" }' - - '{ "index" : { "_index" : "date_ms", "_id" : "date_ms_1" } }' - - '{"date" : "2018-10-29T12:12:12.987Z" }' - - '{ "index" : { "_index" : "date_ns", "_id" : "date_ns_2" } }' - - '{"date" : "2018-10-30T12:12:12.123456789Z" }' - - '{ "index" : { "_index" : "date_ms", "_id" : "date_ms_2" } }' - - '{"date" : "2018-10-30T12:12:12.987Z" }' - - - do: - search: - rest_total_hits_as_int: true - index: date* - body: - size: 0 - aggs: - date: - date_histogram: - field: date - calendar_interval: 1d - - - match: { hits.total: 4 } - - length: { aggregations.date.buckets: 2 } - - match: { aggregations.date.buckets.0.key: 1540771200000 } - - match: { aggregations.date.buckets.0.key_as_string: "2018-10-29T00:00:00.000Z" } - - match: { aggregations.date.buckets.0.doc_count: 2 } - - match: { aggregations.date.buckets.1.key: 1540857600000 } - - match: { aggregations.date.buckets.1.key_as_string: "2018-10-30T00:00:00.000Z" } - - match: { aggregations.date.buckets.1.doc_count: 2 } - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/250_distance_feature.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/250_distance_feature.yml deleted file mode 100644 index bafb7d52c7186..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/250_distance_feature.yml +++ /dev/null @@ -1,87 +0,0 @@ -setup: - - skip: - version: " - 7.1.99" - reason: "Implemented in 7.2" - - - do: - indices.create: - index: index1 - body: - settings: - number_of_replicas: 0 - mappings: - properties: - my_date: - type: date - my_date_nanos: - type: date_nanos - my_geo: - type: geo_point - - - do: - bulk: - refresh: true - body: - - '{ "index" : { "_index" : "index1", "_id" : "1" } }' - - '{ "my_date": "2018-02-01T10:00:00Z", "my_date_nanos": "2018-02-01T00:00:00.223456789Z", "my_geo": [-71.34, 41.13] }' - - '{ "index" : { "_index" : "index1", "_id" : "2" } }' - - '{ "my_date": "2018-02-01T11:00:00Z", "my_date_nanos": "2018-02-01T00:00:00.123456789Z", "my_geo": [-71.34, 41.14] }' - - '{ "index" : { "_index" : "index1", "_id" : "3" } }' - - '{ "my_date": "2018-02-01T09:00:00Z", "my_date_nanos": "2018-02-01T00:00:00.323456789Z", "my_geo": [-71.34, 41.12] }' - ---- -"test distance_feature query on date type": - -- do: - search: - rest_total_hits_as_int: true - index: index1 - body: - query: - distance_feature: - field: my_date - pivot: 1h - origin: 2018-02-01T08:00:30Z - -- length: { hits.hits: 3 } -- match: { hits.hits.0._id: "3" } -- match: { hits.hits.1._id: "1" } -- match: { hits.hits.2._id: "2" } - ---- -"test distance_feature query on date_nanos type": - -- do: - search: - rest_total_hits_as_int: true - index: index1 - body: - query: - distance_feature: - field: my_date_nanos - pivot: 100000000nanos - origin: 2018-02-01T00:00:00.323456789Z - -- length: { hits.hits: 3 } -- match: { hits.hits.0._id: "3" } -- match: { hits.hits.1._id: "1" } -- match: { hits.hits.2._id: "2" } - ---- -"test distance_feature query on geo_point type": - -- do: - search: - rest_total_hits_as_int: true - index: index1 - body: - query: - distance_feature: - field: my_geo - pivot: 1km - origin: [-71.35, 41.12] - -- length: { hits.hits: 3 } -- match: { hits.hits.0._id: "3" } -- match: { hits.hits.1._id: "1" } -- match: { hits.hits.2._id: "2" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/300_sequence_numbers.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/300_sequence_numbers.yml deleted file mode 100644 index 61bbfdcc267ac..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/300_sequence_numbers.yml +++ /dev/null @@ -1,64 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: foo } - -## we index again in order to make the seq# 1 (so we can check for the field existence with is_false) - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - indices.refresh: - index: [test_1] - ---- -"sequence numbers are returned if requested from body": - - do: - search: - index: _all - body: - query: - match: - foo: bar - seq_no_primary_term: true - - - match: {hits.hits.0._seq_no: 1} - - gte: {hits.hits.0._primary_term: 1} - ---- -"sequence numbers are returned if requested from url": - - do: - search: - index: _all - body: - query: - match: - foo: bar - seq_no_primary_term: true - - - match: {hits.hits.0._seq_no: 1} - - gte: {hits.hits.0._primary_term: 1} - ---- -"sequence numbers are not returned if not requested": - - do: - search: - index: _all - body: - query: - match: - foo: bar - - - is_false: hits.hits.0._seq_no - - is_false: hits.hits.0._primary_term diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/30_limits.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/30_limits.yml deleted file mode 100644 index 17735c7fd451a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/30_limits.yml +++ /dev/null @@ -1,150 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - settings: - index.max_docvalue_fields_search: 2 - index.max_script_fields: 2 - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - indices.refresh: {} - ---- -"Request window limits without scroll": - - do: - catch: /Result window is too large, from \+ size must be less than or equal to[:] \[10000\] but was \[10010\]\. See the scroll api for a more efficient way to request large data sets\./ - search: - rest_total_hits_as_int: true - index: test_1 - from: 10000 - ---- -"Request with negative from value": - - do: - catch: /\[from\] parameter cannot be negative/ - search: - rest_total_hits_as_int: true - index: test_1 - from: -2 - ---- -"Request window limits with scroll": - - do: - catch: /Batch size is too large, size must be less than or equal to[:] \[10000\] but was \[10010\]\. Scroll batch sizes cost as much memory as result windows so they are controlled by the \[index.max_result_window\] index level setting\./ - search: - rest_total_hits_as_int: true - index: test_1 - scroll: 5m - size: 10010 - ---- -"Rescore window limits": - - do: - catch: /Rescore window \[10001\] is too large\. It must be less than \[10000\]\./ - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: - match_all: {} - rescore: - - window_size: 10001 - query: - rescore_query: - match_all: {} - query_weight: 1 - rescore_query_weight: 2 - ---- -"Docvalues_fields size limit": - - - skip: - version: " - 6.99.99" - reason: "Triggers warnings before 7.0" - - do: - catch: /Trying to retrieve too many docvalue_fields\. Must be less than or equal to[:] \[2\] but was \[3\]\. This limit can be set by changing the \[index.max_docvalue_fields_search\] index level setting\./ - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: - match_all: {} - docvalue_fields: - - "one" - - "two" - - "three" - ---- -"Script_fields size limit": - - - do: - catch: /Trying to retrieve too many script_fields\. Must be less than or equal to[:] \[2\] but was \[3\]\. This limit can be set by changing the \[index.max_script_fields\] index level setting\./ - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: - match_all: {} - script_fields: - "test1" : { "script" : { "lang": "painless", "source": "1;" }} - "test2" : { "script" : { "lang": "painless", "source": "1;" }} - "test3" : { "script" : { "lang": "painless", "source": "1;" }} - ---- -"Regexp length limit": - - skip: - version: " - 6.99.99" - reason: "The regex length limit was introduced in 7.0.0" - - - do: - catch: /The length of regex \[1110\] used in the Regexp Query request has exceeded the allowed maximum of \[1000\]\. This maximum can be set by changing the \[index.max_regex_length\] index level setting\./ - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: - regexp: - foo: "^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*)(?:\\.(?:(?:\\r\\n)?[\\t])*(?:[^()<>@,;:\\\\\" | - .\\[\\]\\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\ | - ]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*))*(?:,@(?:(?:\\r\\n)?[ \\t])*(?:[^()<>@,;:\\\\\".\\ | - [\\]\\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\]\\ | - r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*)(?:\\.(?:(?:\\r\\n)?[\\t])*(?:[^()<>@,;:\\\\\".\\[\\] | - \\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\]\\r\\\\] | - |\\\\.)*\\](?:(?:\\r\\n)?[\\t])*))*)*:(?:(?:\\r\\n)?[\\t])*)?(?:[^()<>@,;:\\\\\".\\[\\] \\0 | - 00-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\ | - .|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[\\t])*)(?:\\.(?:(?:\\r\\n)?[ \\t])*(?:[^()<>@, | - ;:\\\\\".\\[\\]\\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\"(? | - :[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[\\t])*))*@(?:(?:\\r\\n)?[ \\t])* | - ]))|\\[([^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*))*\\>(?:(?:\\r\\n)?[ \\t])*)(?:,\\s*( | - \".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[ \\t])*)(?:\\.(?:( | - \\[\"()<>@,;:\\\\\".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[\\t" - - - do: - catch: /The length of regex \[1110\]/ - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: - query_string: - query: "/^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*)(?:\\.(?:(?:\\r\\n)?[\\t])*(?:[^()<>@,;:\\\\\" | - .\\[\\]\\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\ | - ]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*))*(?:,@(?:(?:\\r\\n)?[ \\t])*(?:[^()<>@,;:\\\\\".\\ | - [\\]\\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\]\\ | - r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*)(?:\\.(?:(?:\\r\\n)?[\\t])*(?:[^()<>@,;:\\\\\".\\[\\] | - \\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\]\\r\\\\] | - |\\\\.)*\\](?:(?:\\r\\n)?[\\t])*))*)*:(?:(?:\\r\\n)?[\\t])*)?(?:[^()<>@,;:\\\\\".\\[\\] \\0 | - 00-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\ | - .|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[\\t])*)(?:\\.(?:(?:\\r\\n)?[ \\t])*(?:[^()<>@, | - ;:\\\\\".\\[\\]\\000-\\031]+(?:(?:(?:\\r\\n)?[\\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\"(? | - :[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[\\t])*))*@(?:(?:\\r\\n)?[ \\t])* | - ]))|\\[([^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[\\t])*))*\\>(?:(?:\\r\\n)?[ \\t])*)(?:,\\s*( | - \".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[ \\t])*)(?:\\.(?:( | - \\[\"()<>@,;:\\\\\".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[\\t]))*\"(?:(?:\\r\\n)?[\\t/" diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/310_match_bool_prefix.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/310_match_bool_prefix.yml deleted file mode 100644 index aa6a5158b4795..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/310_match_bool_prefix.yml +++ /dev/null @@ -1,363 +0,0 @@ -setup: - - skip: - version: " - 7.1.99" - reason: "added in 7.2.0" - - - do: - indices.create: - index: test - body: - mappings: - properties: - my_field1: - type: text - my_field2: - type: text - - - do: - index: - index: test - id: 1 - body: - my_field1: "brown fox jump" - my_field2: "xylophone" - - - do: - index: - index: test - id: 2 - body: - my_field1: "brown emu jump" - my_field2: "xylophone" - - - do: - index: - index: test - id: 3 - body: - my_field1: "jumparound" - my_field2: "emu" - - - do: - index: - index: test - id: 4 - body: - my_field1: "dog" - my_field2: "brown fox jump lazy" - - - do: - indices.refresh: {} - ---- -"scoring complete term": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - match_bool_prefix: - my_field1: "brown fox jump" - - - match: { hits.total: 3 } - - match: { hits.hits.0._source.my_field1: "brown fox jump" } - - match: { hits.hits.1._source.my_field1: "brown emu jump" } - - match: { hits.hits.2._source.my_field1: "jumparound" } - ---- -"scoring partial term": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - match_bool_prefix: - my_field1: "brown fox ju" - - - match: { hits.total: 3 } - - match: { hits.hits.0._id: "1" } - - match: { hits.hits.0._source.my_field1: "brown fox jump" } - - match: { hits.hits.1._id: "2" } - - match: { hits.hits.1._source.my_field1: "brown emu jump" } - - match: { hits.hits.2._id: "3" } - - match: { hits.hits.2._source.my_field1: "jumparound" } - ---- -"minimum should match": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - match_bool_prefix: - my_field1: - query: "brown fox jump" - minimum_should_match: 3 - - - match: { hits.total: 1 } - - match: { hits.hits.0._id: "1" } - - match: { hits.hits.0._source.my_field1: "brown fox jump" } - ---- -"analyzer": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - match_bool_prefix: - my_field1: - query: "BROWN dog" - analyzer: whitespace # this analyzer doesn't lowercase terms - - - match: { hits.total: 1 } - - match: { hits.hits.0._id: "4" } - - match: { hits.hits.0._source.my_field1: "dog" } - ---- -"operator": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - match_bool_prefix: - my_field1: - query: "brown fox jump" - operator: AND - - - match: { hits.total: 1 } - - match: { hits.hits.0._id: "1" } - - match: { hits.hits.0._source.my_field1: "brown fox jump" } - ---- -"fuzziness": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - match_bool_prefix: - my_field2: - query: "xylophoen foo" - fuzziness: 1 - prefix_length: 1 - max_expansions: 10 - fuzzy_transpositions: true - fuzzy_rewrite: constant_score - - - match: { hits.total: 2 } - - match: { hits.hits.0._source.my_field2: "xylophone" } - - match: { hits.hits.1._source.my_field2: "xylophone" } - ---- -"multi_match single field complete term": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - multi_match: - query: "brown fox jump" - type: bool_prefix - fields: [ "my_field1" ] - - - match: { hits.total: 3 } - - match: { hits.hits.0._id: "1" } - - match: { hits.hits.0._source.my_field1: "brown fox jump" } - - match: { hits.hits.1._id: "2" } - - match: { hits.hits.1._source.my_field1: "brown emu jump" } - - match: { hits.hits.2._id: "3" } - - match: { hits.hits.2._source.my_field1: "jumparound" } - ---- -"multi_match single field partial term": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - multi_match: - query: "brown fox ju" - type: bool_prefix - fields: [ "my_field1" ] - - - match: { hits.total: 3 } - - match: { hits.hits.0._id: "1" } - - match: { hits.hits.0._source.my_field1: "brown fox jump" } - - match: { hits.hits.1._id: "2" } - - match: { hits.hits.1._source.my_field1: "brown emu jump" } - - match: { hits.hits.2._id: "3" } - - match: { hits.hits.2._source.my_field1: "jumparound" } - ---- -"multi_match multiple fields complete term": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - multi_match: - query: "brown fox jump lazy" - type: bool_prefix - fields: [ "my_field1", "my_field2" ] - - - match: { hits.total: 3 } - - match: { hits.hits.0._id: "4" } - - match: { hits.hits.0._source.my_field1: "dog" } - - match: { hits.hits.0._source.my_field2: "brown fox jump lazy" } - - match: { hits.hits.1._id: "1" } - - match: { hits.hits.1._source.my_field1: "brown fox jump" } - - match: { hits.hits.2._id: "2" } - - match: { hits.hits.2._source.my_field1: "brown emu jump" } - ---- -"multi_match multiple fields partial term": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - multi_match: - query: "brown fox jump laz" - type: bool_prefix - fields: [ "my_field1", "my_field2" ] - - - match: { hits.total: 3 } - - match: { hits.hits.0._id: "4" } - - match: { hits.hits.0._source.my_field1: "dog" } - - match: { hits.hits.0._source.my_field2: "brown fox jump lazy" } - - match: { hits.hits.1._id: "1" } - - match: { hits.hits.1._source.my_field1: "brown fox jump" } - - match: { hits.hits.2._id: "2" } - - match: { hits.hits.2._source.my_field1: "brown emu jump" } - ---- -"multi_match multiple fields with analyzer": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - multi_match: - query: "BROWN FOX JUMP dog" - type: bool_prefix - fields: [ "my_field1", "my_field2" ] - analyzer: whitespace # this analyzer doesn't lowercase terms - - - match: { hits.total: 1 } - - match: { hits.hits.0._id: "4" } - - match: { hits.hits.0._source.my_field1: "dog" } - - match: { hits.hits.0._source.my_field2: "brown fox jump lazy" } - ---- -"multi_match multiple fields with minimum_should_match": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - multi_match: - query: "brown fox jump la" - type: bool_prefix - fields: [ "my_field1", "my_field2" ] - minimum_should_match: 4 - - - match: { hits.total: 1 } - - match: { hits.hits.0._id: "4" } - - match: { hits.hits.0._source.my_field1: "dog" } - - match: { hits.hits.0._source.my_field2: "brown fox jump lazy" } - ---- -"multi_match multiple fields with fuzziness": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - multi_match: - query: "dob nomatch" - type: bool_prefix - fields: [ "my_field1", "my_field2" ] - fuzziness: 1 - - - match: { hits.total: 1 } - - match: { hits.hits.0._id: "4" } - - match: { hits.hits.0._source.my_field1: "dog" } - - match: { hits.hits.0._source.my_field2: "brown fox jump lazy" } - ---- -"multi_match multiple fields with boost": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - multi_match: - query: "brown emu" - type: bool_prefix - fields: [ "my_field1", "my_field2^10" ] - fuzziness: 1 - - - match: { hits.hits.0._id: "3" } - - match: { hits.hits.0._source.my_field2: "emu" } - ---- -"multi_match multiple fields with slop throws exception": - - - do: - catch: /\[slop\] not allowed for type \[bool_prefix\]/ - search: - rest_total_hits_as_int: true - index: test - body: - query: - multi_match: - query: "brown" - type: bool_prefix - fields: [ "my_field1", "my_field2" ] - slop: 1 - ---- -"multi_match multiple fields with cutoff_frequency throws exception": - - - do: - catch: /\[cutoff_frequency\] not allowed for type \[bool_prefix\]/ - search: - rest_total_hits_as_int: true - index: test - body: - query: - multi_match: - query: "brown" - type: bool_prefix - fields: [ "my_field1", "my_field2" ] - cutoff_frequency: 0.001 diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/320_disallow_queries.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/320_disallow_queries.yml deleted file mode 100644 index 7135c8642736c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/320_disallow_queries.yml +++ /dev/null @@ -1,147 +0,0 @@ ---- -setup: - - skip: - version: " - 7.6.99" - reason: "implemented in 7.7.0" - - - do: - indices.create: - index: test - body: - mappings: - properties: - text: - type: text - analyzer: standard - fields: - raw: - type: keyword - nested1: - type: nested - - - do: - bulk: - refresh: true - body: - - '{"index": {"_index": "test", "_id": "1"}}' - - '{"text" : "Some like it hot, some like it cold", "nested1": [{"foo": "bar1"}]}' - - '{"index": {"_index": "test", "_id": "2"}}' - - '{"text" : "Its cold outside, theres no kind of atmosphere", "nested1": [{"foo": "bar2"}]}' - - '{"index": {"_index": "test", "_id": "3"}}' - - '{"text" : "Baby its cold there outside", "nested1": [{"foo": "bar3"}]}' - - '{"index": {"_index": "test", "_id": "4"}}' - - '{"text" : "Outside it is cold and wet", "nested1": [{"foo": "bar4"}]}' - ---- -teardown: - - skip: - version: " - 7.6.99" - reason: "implemented in 7.7.0" - - - do: - cluster.put_settings: - body: - transient: - search.allow_expensive_queries: null - ---- -"Test disallow expensive queries": - - skip: - version: " - 7.6.99" - reason: "implemented in 7.7.0" - - ### Check for initial setting = null -> false - - do: - cluster.get_settings: - flat_settings: true - - - is_false: search.allow_expensive_queries - - ### Update setting to false - - do: - cluster.put_settings: - body: - transient: - search.allow_expensive_queries: "false" - flat_settings: true - - - match: {transient: {search.allow_expensive_queries: "false"}} - - ### Prefix - - do: - catch: /\[prefix\] queries cannot be executed when \'search.allow_expensive_queries\' is set to false. For optimised prefix queries on text fields please enable \[index_prefixes\]./ - search: - index: test - body: - query: - prefix: - text: - value: out - - ### Fuzzy - - do: - catch: /\[fuzzy\] queries cannot be executed when \'search.allow_expensive_queries\' is set to false./ - search: - index: test - body: - query: - fuzzy: - text: - value: outwide - - ### Regexp - - do: - catch: /\[regexp\] queries cannot be executed when \'search.allow_expensive_queries\' is set to false./ - search: - index: test - body: - query: - regexp: - text: - value: .*ou.*id.* - - ### Wildcard - - do: - catch: /\[wildcard\] queries cannot be executed when \'search.allow_expensive_queries\' is set to false./ - search: - index: test - body: - query: - wildcard: - text: - value: out?ide - - ### Range on text - - do: - catch: /\[range\] queries on \[text\] or \[keyword\] fields cannot be executed when \'search.allow_expensive_queries\' is set to false./ - search: - index: test - body: - query: - range: - text: - gte: "theres" - - ### Range on keyword - - do: - catch: /\[range\] queries on \[text\] or \[keyword\] fields cannot be executed when \'search.allow_expensive_queries\' is set to false./ - search: - index: test - body: - query: - range: - text.raw: - gte : "Outside it is cold and wet" - - ### Nested - - do: - catch: /\[joining\] queries cannot be executed when \'search.allow_expensive_queries\' is set to false./ - search: - index: test - body: - query: - nested: - path: "nested1" - query: - bool: - must: [{"match" : {"nested1.foo" : "bar2"}}] diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/330_distributed_sort.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/330_distributed_sort.yml deleted file mode 100644 index 57846ccee5ab9..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/330_distributed_sort.yml +++ /dev/null @@ -1,130 +0,0 @@ -setup: - - do: - indices.create: - index: index_1 - body: - settings: - number_of_shards: 1 - mappings: - properties: - created_at: - type: date - format: "strict_date" - - do: - indices.create: - index: index_2 - body: - settings: - number_of_shards: 1 - mappings: - properties: - created_at: - type: date - format: "strict_date" - - - do: - indices.create: - index: index_3 - body: - settings: - number_of_shards: 1 - mappings: - properties: - created_at: - type: date - format: "strict_date" - - ---- -"test distributed sort can rewrite query to match no docs": - - - skip: - version: " - 7.6.99" - reason: "distributed sort optimization was added in 7.7.0" - - do: - index: - index: index_1 - id: 1 - body: { "created_at": "2016-01-01"} - - do: - index: - index: index_2 - id: 2 - body: { "created_at": "2017-01-01" } - - - do: - index: - index: index_3 - id: 3 - body: { "created_at": "2018-01-01" } - - do: - indices.refresh: {} - - # check that empty responses are correctly handled when rewriting to match_no_docs - - do: - search: - # ensure that one shard can return empty response - max_concurrent_shard_requests: 1 - body: { "size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2016-02-01", "lt": "2018-02-01"}}}, "aggs" : { "idx_terms" : { "terms" : { "field" : "_index" } } } } - - - match: { _shards.total: 3 } - - match: { _shards.successful: 3 } - - match: { _shards.skipped : 0 } - - match: { _shards.failed: 0 } - - match: { hits.total.value: 2 } - - length: { aggregations.idx_terms.buckets: 2 } - - - do: - search: - # ensure that one shard can return empty response - max_concurrent_shard_requests: 2 - body: { "size" : 0, "query" : { "range" : { "created_at" : { "gte" : "2019-02-01"}}}, "aggs" : { "idx_terms" : { "terms" : { "field" : "_index" } } } } - - - match: { _shards.total: 3 } - - match: { _shards.successful: 3 } - - match: { _shards.skipped : 0 } - - match: { _shards.failed: 0 } - - match: { hits.total.value: 0 } - - length: { aggregations.idx_terms.buckets: 0 } - - # check field sort is correct when skipping query phase - - do: - search: - # ensure that one shard can return empty response - max_concurrent_shard_requests: 1 - pre_filter_shard_size: 1 - body: - "size": 1 - "track_total_hits": 1 - "sort": [{ "created_at": { "order": "desc" } }] - - - match: { _shards.total: 3 } - - match: { _shards.successful: 3 } - - match: { _shards.skipped: 0 } - - match: { _shards.failed: 0 } - - match: { hits.total.value: 1 } - - match: { hits.total.relation: "gte" } - - length: { hits.hits: 1 } - - match: { hits.hits.0._id: "3" } - - # same with aggs - - do: - search: - # ensure that one shard can return empty response - max_concurrent_shard_requests: 1 - pre_filter_shard_size: 1 - body: - "size": 1 - "track_total_hits": 1 - "sort": [{ "created_at": { "order": "desc" } }] - "aggs" : { "idx_terms" : { "terms" : { "field" : "_index" } } } - - - match: { _shards.total: 3 } - - match: { _shards.successful: 3 } - - match: { _shards.skipped: 0 } - - match: { _shards.failed: 0 } - - match: { hits.total.value: 1 } - - match: { hits.total.relation: "gte" } - - length: { hits.hits: 1 } - - match: {hits.hits.0._id: "3" } - - length: { aggregations.idx_terms.buckets: 3 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/40_indices_boost.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/40_indices_boost.yml deleted file mode 100644 index 37d53fe8a6d59..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/40_indices_boost.yml +++ /dev/null @@ -1,187 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - - do: - indices.create: - index: test_2 - - - do: - indices.put_alias: - index: test_1 - name: alias_1 - - - do: - indices.put_alias: - index: test_2 - name: alias_2 - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - index: - index: test_2 - type: test - id: 1 - body: { foo: bar } - - - do: - indices.refresh: - index: [test_1, test_2] - ---- -"Indices boost using object": - - skip: - reason: deprecation was added in 5.2.0 - features: "warnings" - - - do: - warnings: - - 'Object format in indices_boost is deprecated, please use array format instead' - search: - rest_total_hits_as_int: true - index: _all - body: - indices_boost: {test_1: 2.0, test_2: 1.0} - - - match: { hits.total: 2 } - - match: { hits.hits.0._index: test_1 } - - match: { hits.hits.1._index: test_2 } - - - do: - warnings: - - 'Object format in indices_boost is deprecated, please use array format instead' - search: - rest_total_hits_as_int: true - index: _all - body: - indices_boost: {test_1: 1.0, test_2: 2.0} - - - match: { hits.total: 2 } - - match: { hits.hits.0._index: test_2 } - - match: { hits.hits.1._index: test_1 } - ---- -"Indices boost using array": - - do: - search: - rest_total_hits_as_int: true - index: _all - body: - indices_boost: [{test_1: 2.0}, {test_2: 1.0}] - - - match: { hits.total: 2 } - - match: { hits.hits.0._index: test_1 } - - match: { hits.hits.1._index: test_2 } - - - do: - search: - rest_total_hits_as_int: true - index: _all - body: - indices_boost: [{test_1: 1.0}, {test_2: 2.0}] - - - match: { hits.total: 2 } - - match: { hits.hits.0._index: test_2 } - - match: { hits.hits.1._index: test_1 } - ---- -"Indices boost using array with alias": - - do: - search: - rest_total_hits_as_int: true - index: _all - body: - indices_boost: [{alias_1: 2.0}] - - - match: { hits.total: 2} - - match: { hits.hits.0._index: test_1 } - - match: { hits.hits.1._index: test_2 } - - - do: - search: - rest_total_hits_as_int: true - index: _all - body: - indices_boost: [{alias_2: 2.0}] - - - match: { hits.total: 2} - - match: { hits.hits.0._index: test_2 } - - match: { hits.hits.1._index: test_1 } - ---- -"Indices boost using array with wildcard": - - do: - search: - rest_total_hits_as_int: true - index: _all - body: - indices_boost: [{"*_1": 2.0}] - - - match: { hits.total: 2} - - match: { hits.hits.0._index: test_1 } - - match: { hits.hits.1._index: test_2 } - - - do: - search: - rest_total_hits_as_int: true - index: _all - body: - indices_boost: [{"*_2": 2.0}] - - - match: { hits.total: 2} - - match: { hits.hits.0._index: test_2 } - - match: { hits.hits.1._index: test_1 } - ---- -"Indices boost using array multiple match": - - do: - search: - rest_total_hits_as_int: true - index: _all - body: - # First match (3.0) is used for test_1 - indices_boost: [{"*_1": 3.0}, {alias_1: 1.0}, {test_2: 2.0}] - - - match: { hits.total: 2} - - match: { hits.hits.0._index: test_1 } - - match: { hits.hits.1._index: test_2 } - - - do: - search: - rest_total_hits_as_int: true - index: _all - body: - # First match (1.0) is used for test_1 - indices_boost: [{"*_1": 1.0}, {test_2: 2.0}, {alias_1: 3.0}] - - - match: { hits.total: 2} - - match: { hits.hits.0._index: test_2 } - - match: { hits.hits.1._index: test_1 } - ---- -"Indices boost for nonexistent index/alias": - - do: - catch: /no such index/ - search: - rest_total_hits_as_int: true - index: _all - body: - indices_boost: [{nonexistent: 2.0}, {test_1: 1.0}, {test_2: 2.0}] - - - do: - search: - rest_total_hits_as_int: true - index: _all - ignore_unavailable: true - body: - indices_boost: [{nonexistent: 2.0}, {test_1: 1.0}, {test_2: 2.0}] - - - match: { hits.total: 2} - - match: { hits.hits.0._index: test_2 } - - match: { hits.hits.1._index: test_1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/60_query_string.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/60_query_string.yml deleted file mode 100644 index 131c8f92a231e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/60_query_string.yml +++ /dev/null @@ -1,63 +0,0 @@ ---- -"search with query_string parameters": - - do: - indices.create: - index: test - body: - mappings: - properties: - number: - type: integer - - - do: - index: - index: test - id: 1 - body: { field: foo bar} - - - do: - indices.refresh: - index: [test] - - - do: - search: - rest_total_hits_as_int: true - index: test - q: bar - df: field - - - match: {hits.total: 1} - - - do: - search: - rest_total_hits_as_int: true - index: test - q: field:foo field:xyz - - - match: {hits.total: 1} - - - do: - search: - rest_total_hits_as_int: true - index: test - q: field:foo field:xyz - default_operator: AND - - - match: {hits.total: 0} - - - do: - search: - rest_total_hits_as_int: true - index: test - q: field:BA* - - - match: {hits.total: 1} - - - do: - search: - rest_total_hits_as_int: true - index: test - q: number:foo - lenient: true - - - match: {hits.total: 0} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/70_response_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/70_response_filtering.yml deleted file mode 100644 index d306cb7b1ad50..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/70_response_filtering.yml +++ /dev/null @@ -1,153 +0,0 @@ ---- -"Search with response filtering": - - do: - indices.create: - index: test - - do: - index: - index: test - id: 1 - body: { foo: bar } - - - do: - index: - index: test - id: 2 - body: { foo: bar } - - - do: - indices.refresh: - index: [test] - - - do: - search: - rest_total_hits_as_int: true - index: test - filter_path: "*" - body: "{ \"query\": { \"match_all\": {} } }" - - - gte: { took: 0 } - - is_false: _clusters - - is_true: _shards.total - - is_true: hits.total - - is_true: hits.hits.0._index - - is_true: hits.hits.0._type - - is_true: hits.hits.0._id - - is_true: hits.hits.1._index - - is_true: hits.hits.1._type - - is_true: hits.hits.1._id - - - do: - search: - rest_total_hits_as_int: true - index: test - filter_path: "took" - body: "{ \"query\": { \"match_all\": {} } }" - - - gte: { took: 0 } - - is_false: _shards.total - - is_false: hits.total - - is_false: hits.hits.0._index - - is_false: hits.hits.0._type - - is_false: hits.hits.0._id - - is_false: hits.hits.1._index - - is_false: hits.hits.1._type - - is_false: hits.hits.1._id - - - do: - search: - rest_total_hits_as_int: true - index: test - filter_path: "_shards.*" - body: "{ \"query\": { \"match_all\": {} } }" - - - is_false: took - - is_true: _shards.total - - is_false: hits.total - - is_false: hits.hits.0._index - - is_false: hits.hits.0._type - - is_false: hits.hits.0._id - - is_false: hits.hits.1._index - - is_false: hits.hits.1._type - - is_false: hits.hits.1._id - - - do: - search: - rest_total_hits_as_int: true - index: test - filter_path: [ "hits.**._i*", "**.total" ] - body: "{ \"query\": { \"match_all\": {} } }" - - - is_false: took - - is_true: _shards.total - - is_true: hits.total - - is_true: hits.hits.0._index - - is_false: hits.hits.0._type - - is_true: hits.hits.0._id - - is_true: hits.hits.1._index - - is_false: hits.hits.1._type - - is_true: hits.hits.1._id - ---- -"Search results filtered using both includes and excludes filters": - - do: - bulk: - refresh: true - body: | - {"index": {"_index": "index-1", "_id": "1"}} - {"name": "First document", "properties": {"size": 123, "meta": {"foo": "bar"}}} - {"index": {"_index": "index-1", "_id": "2"}} - {"name": "Second document", "properties": {"size": 465, "meta": {"foo": "bar", "baz": "qux"}}} - - - do: - search: - rest_total_hits_as_int: true - filter_path: [ "-**._source.properties", "**._source" ] - body: { query: { match_all: {} } } - - - is_false: took - - is_true: hits.hits.0._source - - is_true: hits.hits.0._source.name - - is_false: hits.hits.0._source.properties - - is_true: hits.hits.1._source - - is_true: hits.hits.1._source.name - - is_false: hits.hits.1._source.properties - - - do: - search: - rest_total_hits_as_int: true - filter_path: [ "**.properties" , "-hits.hits._source.properties.meta" ] - body: { query: { match_all: {} } } - - - is_false: took - - is_true: hits.hits.0._source - - is_false: hits.hits.0._source.name - - is_true: hits.hits.0._source.properties - - is_true: hits.hits.0._source.properties.size - - is_false: hits.hits.0._source.properties.meta - - is_true: hits.hits.1._source - - is_false: hits.hits.1._source.name - - is_true: hits.hits.1._source.properties - - is_true: hits.hits.1._source.properties.size - - is_false: hits.hits.1._source.properties.meta - - - do: - search: - rest_total_hits_as_int: true - filter_path: "**._source,-**.meta.foo" - body: { query: { match_all: {} } } - - - is_false: took - - is_true: hits.hits.0._source - - is_true: hits.hits.0._source.name - - is_true: hits.hits.0._source.properties - - is_true: hits.hits.0._source.properties.size - - is_false: hits.hits.0._source.properties.meta.foo - - - do: - count: - filter_path: "-*" - body: { query: { match_all: {} } } - - - is_false: count - - is_false: _shards diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/80_indices_options.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/80_indices_options.yml deleted file mode 100644 index 71b554f2a5a5e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/80_indices_options.yml +++ /dev/null @@ -1,71 +0,0 @@ ---- -"Missing index date math with catch": - - - do: - catch: /logstash-\d{4}\.\d{2}\.\d{2}/ - search: - rest_total_hits_as_int: true - index: - ---- -"Missing index": - - - do: - catch: missing - search: - rest_total_hits_as_int: true - index: missing_index - - - do: - search: - rest_total_hits_as_int: true - index: missing_index - ignore_unavailable: true - - - match: {hits.total: 0} - ---- -"Closed index": - - - do: - indices.create: - index: index_closed - - - do: - indices.close: - index: index_closed - - - do: - catch: /index_closed_exception/ - search: - rest_total_hits_as_int: true - index: index_closed - - - do: - search: - rest_total_hits_as_int: true - index: index_closed - ignore_unavailable: true - - - match: {hits.total: 0} - - - do: - search: - rest_total_hits_as_int: true - index: index* - - - match: {hits.total: 0} - - - do: - catch: missing - search: - rest_total_hits_as_int: true - index: index* - allow_no_indices: false - - - do: - catch: /index_closed_exception/ - search: - rest_total_hits_as_int: true - index: index* - expand_wildcards: ["open","closed"] diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/90_search_after.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/90_search_after.yml deleted file mode 100644 index aa283cda4c27f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/90_search_after.yml +++ /dev/null @@ -1,99 +0,0 @@ -setup: - - do: - indices.create: - index: test - - do: - index: - index: test - id: 1 - body: { id: 1, foo: bar, age: 18 } - - - do: - index: - index: test - id: 42 - body: { id: 42, foo: bar, age: 18 } - - - do: - index: - index: test - id: 172 - body: { id: 172, foo: bar, age: 24 } - - - do: - indices.refresh: - index: test - ---- -"search with search_after parameter": - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - size: 1 - query: - match: - foo: bar - sort: [{ age: desc }, { id: desc }] - - - match: {hits.total: 3 } - - length: {hits.hits: 1 } - - match: {hits.hits.0._index: test } - - match: {hits.hits.0._type: _doc } - - match: {hits.hits.0._id: "172" } - - match: {hits.hits.0.sort: [24, 172] } - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - size: 1 - query: - match: - foo: bar - sort: [{ age: desc }, { id: desc }] - search_after: [24, 172] - - - match: {hits.total: 3 } - - length: {hits.hits: 1 } - - match: {hits.hits.0._index: test } - - match: {hits.hits.0._type: _doc } - - match: {hits.hits.0._id: "42" } - - match: {hits.hits.0.sort: [18, 42] } - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - size: 1 - query: - match: - foo: bar - sort: [ { age: desc }, { id: desc } ] - search_after: [18, 42] - - - match: {hits.total: 3} - - length: {hits.hits: 1 } - - match: {hits.hits.0._index: test } - - match: {hits.hits.0._type: _doc } - - match: {hits.hits.0._id: "1" } - - match: {hits.hits.0.sort: [18, 1] } - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - size: 1 - query: - match: - foo: bar - sort: [{ age: desc }, { id: desc } ] - search_after: [18, 1] - - - match: {hits.total: 3} - - length: {hits.hits: 0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/issue4895.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/issue4895.yml deleted file mode 100644 index 4d8b1484c74ac..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/issue4895.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test - - - do: - index: - index: test - id: 1 - body: - user : foo - amount : 35 - data : some - - - do: - indices.refresh: - index: [test] - ---- -"Test with _local preference placed in query body - should fail": - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - index: test - body: - query: - term: - data: some - preference: _local - stored_fields: [user,amount] diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search/issue9606.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search/issue9606.yml deleted file mode 100644 index 9f5025093c652..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search/issue9606.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -setup: - - do: - indices.create: - index: test - - - do: - index: - index: test - id: 1 - body: { foo: bar } - - - do: - indices.refresh: - index: [test] - ---- -"Test search_type=query_and_fetch not supported from REST layer": - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - index: test - search_type: query_and_fetch - body: - query: - match: - foo: bar - ---- -"Test search_type=dfs_query_and_fetch not supported from REST layer": - - - do: - catch: bad_request - search: - rest_total_hits_as_int: true - index: test - search_type: dfs_query_and_fetch - body: - query: - match: - foo: bar diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/search_shards/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/search_shards/10_basic.yml deleted file mode 100644 index 653979073b707..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/search_shards/10_basic.yml +++ /dev/null @@ -1,101 +0,0 @@ ---- -"Basic /_search_shards test": - - do: - indices.create: - index: test_1 - - - do: - search_shards: - index: test_1 - routing: foo - - - match: { shards.0.0.index: test_1 } - ---- -"Search shards aliases with and without filters": - - do: - indices.create: - index: test_index - body: - settings: - index: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - properties: - field: - type: text - aliases: - test_alias_no_filter: {} - test_alias_filter_1: - filter: - term: - field : value1 - test_alias_filter_2: - filter: - term: - field : value2 - - - do: - search_shards: - index: test_alias_no_filter - - - length: { shards: 1 } - - match: { shards.0.0.index: test_index } - - is_true: indices.test_index - - is_false: indices.test_index.filter - - match: { indices.test_index.aliases: [test_alias_no_filter]} - - - do: - search_shards: - index: test_alias_filter_1 - - - length: { shards: 1 } - - match: { shards.0.0.index: test_index } - - match: { indices.test_index.aliases: [test_alias_filter_1] } - - match: { indices.test_index.filter.term.field.value: value1 } - - lte: { indices.test_index.filter.term.field.boost: 1.0 } - - gte: { indices.test_index.filter.term.field.boost: 1.0 } - - - do: - search_shards: - index: ["test_alias_filter_1","test_alias_filter_2"] - - - length: { shards: 1 } - - match: { shards.0.0.index: test_index } - - match: { indices.test_index.aliases: [test_alias_filter_1, test_alias_filter_2]} - - length: { indices.test_index.filter.bool.should: 2 } - - lte: { indices.test_index.filter.bool.should.0.term.field.boost: 1.0 } - - gte: { indices.test_index.filter.bool.should.0.term.field.boost: 1.0 } - - lte: { indices.test_index.filter.bool.should.1.term.field.boost: 1.0 } - - gte: { indices.test_index.filter.bool.should.1.term.field.boost: 1.0 } - - match: { indices.test_index.filter.bool.adjust_pure_negative: true} - - lte: { indices.test_index.filter.bool.boost: 1.0 } - - gte: { indices.test_index.filter.bool.boost: 1.0 } - - - do: - search_shards: - index: "test*" - - - length: { shards: 1 } - - match: { shards.0.0.index: test_index } - - match: { indices.test_index.aliases: [test_alias_filter_1, test_alias_filter_2, test_alias_no_filter]} - - is_false: indices.test_index.filter - - - do: - search_shards: - index: ["test_alias_filter_1","test_alias_no_filter"] - - - length: { shards: 1 } - - match: { shards.0.0.index: test_index } - - match: { indices.test_index.aliases: [test_alias_filter_1, test_alias_no_filter]} - - is_false: indices.test_index.filter - - - do: - search_shards: - index: ["test_alias_no_filter"] - - - length: { shards: 1 } - - match: { shards.0.0.index: test_index } - - match: { indices.test_index.aliases: [test_alias_no_filter]} - - is_false: indices.test_index.filter diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.create/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.create/10_basic.yml deleted file mode 100644 index fe70620c6ef62..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.create/10_basic.yml +++ /dev/null @@ -1,119 +0,0 @@ ---- -setup: - - - do: - snapshot.create_repository: - repository: test_repo_create_1 - body: - type: fs - settings: - location: "test_repo_create_1_loc" - - - do: - indices.create: - index: test_index - body: - settings: - number_of_shards: 1 - number_of_replicas: 1 - ---- -"Create a snapshot": - - - do: - snapshot.create: - repository: test_repo_create_1 - snapshot: test_snapshot - wait_for_completion: true - - - match: { snapshot.snapshot: test_snapshot } - - match: { snapshot.state : SUCCESS } - - match: { snapshot.shards.successful: 1 } - - match: { snapshot.shards.failed : 0 } - - - do: - snapshot.delete: - repository: test_repo_create_1 - snapshot: test_snapshot - - - match: { acknowledged: true } - ---- -"Create a snapshot and clean up repository": - - skip: - version: " - 7.3.99" - reason: cleanup introduced in 7.4 - - - do: - snapshot.cleanup_repository: - repository: test_repo_create_1 - - - match: { results.deleted_bytes: 0 } - - match: { results.deleted_blobs: 0 } - - - do: - snapshot.create: - repository: test_repo_create_1 - snapshot: test_snapshot - wait_for_completion: true - - - match: { snapshot.snapshot: test_snapshot } - - match: { snapshot.state : SUCCESS } - - match: { snapshot.shards.successful: 1 } - - match: { snapshot.shards.failed : 0 } - - - do: - snapshot.cleanup_repository: - repository: test_repo_create_1 - - - match: { results.deleted_bytes: 0 } - - match: { results.deleted_blobs: 0 } - - - do: - snapshot.delete: - repository: test_repo_create_1 - snapshot: test_snapshot - - - match: { acknowledged: true } - - - do: - snapshot.cleanup_repository: - repository: test_repo_create_1 - - - match: { results.deleted_bytes: 0 } - - match: { results.deleted_blobs: 0 } - ---- -"Create a snapshot for missing index": - - skip: - version: " - 6.0.0" - reason: ignore_unavailable default is false in 6.0.0 - - - do: - catch: missing - snapshot.create: - repository: test_repo_create_1 - snapshot: test_snapshot_1 - wait_for_completion: true - body: | - { "indices": "missing_1" } - - - do: - snapshot.create: - repository: test_repo_create_1 - snapshot: test_snapshot_2 - wait_for_completion: true - body: | - { "indices": "missing_2", "ignore_unavailable": true } - - - match: { snapshot.snapshot: test_snapshot_2 } - - match: { snapshot.state : SUCCESS } - - match: { snapshot.shards.successful: 0 } - - match: { snapshot.shards.failed : 0 } - - - do: - snapshot.delete: - repository: test_repo_create_1 - snapshot: test_snapshot_2 - - - match: { acknowledged: true } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get/10_basic.yml deleted file mode 100644 index 874dda3606c4a..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get/10_basic.yml +++ /dev/null @@ -1,193 +0,0 @@ ---- -setup: - - - do: - snapshot.create_repository: - repository: test_repo_get_1 - body: - type: fs - settings: - location: "test_repo_get_1_loc" - ---- -"Get snapshot info": - - - do: - indices.create: - index: test_index - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - snapshot.create: - repository: test_repo_get_1 - snapshot: test_snapshot - wait_for_completion: true - - - do: - snapshot.get: - repository: test_repo_get_1 - snapshot: test_snapshot - - - is_true: snapshots - - is_true: snapshots.0.failures - - - do: - snapshot.delete: - repository: test_repo_get_1 - snapshot: test_snapshot - ---- -"Get missing snapshot info throws an exception": - - - do: - catch: /snapshot_missing_exception.+ is missing/ - snapshot.get: - repository: test_repo_get_1 - snapshot: test_nonexistent_snapshot - ---- -"Get missing snapshot info succeeds when ignore_unavailable is true": - - - do: - snapshot.get: - repository: test_repo_get_1 - snapshot: test_nonexistent_snapshot - ignore_unavailable: true - - - is_true: snapshots - ---- -"Get snapshot info when verbose is false": - - do: - indices.create: - index: test_index - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - snapshot.create: - repository: test_repo_get_1 - snapshot: test_snapshot - wait_for_completion: true - - - do: - snapshot.get: - repository: test_repo_get_1 - snapshot: test_snapshot - verbose: false - - - is_true: snapshots - - match: { snapshots.0.snapshot: test_snapshot } - - match: { snapshots.0.state: SUCCESS } - - is_false: snapshots.0.failures - - is_false: snapshots.0.shards - - is_false: snapshots.0.version - - is_false: snapshots.0._meta - - - do: - snapshot.delete: - repository: test_repo_get_1 - snapshot: test_snapshot - ---- -"Get snapshot info contains include_global_state": - - skip: - version: " - 6.1.99" - reason: "include_global_state field has been added in the response in 6.2.0" - - - do: - indices.create: - index: test_index - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - snapshot.create: - repository: test_repo_get_1 - snapshot: test_snapshot_with_include_global_state - wait_for_completion: true - body: | - { "include_global_state": true } - - - do: - snapshot.get: - repository: test_repo_get_1 - snapshot: test_snapshot_with_include_global_state - - - is_true: snapshots - - match: { snapshots.0.snapshot: test_snapshot_with_include_global_state } - - match: { snapshots.0.state: SUCCESS } - - match: { snapshots.0.include_global_state: true } - - - do: - snapshot.delete: - repository: test_repo_get_1 - snapshot: test_snapshot_with_include_global_state - - - do: - snapshot.create: - repository: test_repo_get_1 - snapshot: test_snapshot_without_include_global_state - wait_for_completion: true - body: | - { "include_global_state": false } - - - do: - snapshot.get: - repository: test_repo_get_1 - snapshot: test_snapshot_without_include_global_state - - - is_true: snapshots - - match: { snapshots.0.snapshot: test_snapshot_without_include_global_state } - - match: { snapshots.0.state: SUCCESS } - - match: { snapshots.0.include_global_state: false } - - - do: - snapshot.delete: - repository: test_repo_get_1 - snapshot: test_snapshot_without_include_global_state - ---- -"Get snapshot info with metadata": - - skip: - version: " - 7.2.99" - reason: "Introduced with 7.3" - - - do: - indices.create: - index: test_index - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - snapshot.create: - repository: test_repo_get_1 - snapshot: test_snapshot_with_metadata - wait_for_completion: true - body: | - { "metadata": {"taken_by": "test", "foo": {"bar": "baz"}} } - - - do: - snapshot.get: - repository: test_repo_get_1 - snapshot: test_snapshot_with_metadata - - - is_true: snapshots - - match: { snapshots.0.snapshot: test_snapshot_with_metadata } - - match: { snapshots.0.state: SUCCESS } - - match: { snapshots.0.metadata.taken_by: test } - - match: { snapshots.0.metadata.foo.bar: baz } - - - do: - snapshot.delete: - repository: test_repo_get_1 - snapshot: test_snapshot_with_metadata diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get_repository/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get_repository/10_basic.yml deleted file mode 100644 index aa854d7456e00..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.get_repository/10_basic.yml +++ /dev/null @@ -1,65 +0,0 @@ ---- -setup: - - - do: - snapshot.create_repository: - repository: test_repo_get_1 - body: - type: fs - settings: - location: "test_repo_get_1_loc" - - - do: - snapshot.create_repository: - repository: test_repo_get_2 - body: - type: fs - settings: - readonly: true - location: "test_repo_get_1_loc" - ---- -"Get all repositories": - - do: - snapshot.get_repository: {} - - - is_true: test_repo_get_1 - - is_true: test_repo_get_2 - ---- -"Get repository by name": - - do: - snapshot.get_repository: - repository: test_repo_get_1 - - - is_true: test_repo_get_1 - - is_false: test_repo_get_2 - ---- -"Get missing repository by name": - - do: - snapshot.get_repository: - repository: test_repo_get_2 - ---- -"Get all repositories with local flag": - - do: - snapshot.get_repository: - local: true - - - is_true: test_repo_get_1 - - is_true: test_repo_get_2 - ---- -"Verify created repository": - - do: - snapshot.verify_repository: - repository: test_repo_get_1 - - - is_true: nodes - - - do: - snapshot.verify_repository: - repository: test_repo_get_2 - - - is_true: nodes diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.restore/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.restore/10_basic.yml deleted file mode 100644 index 4bce99d5d97b6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.restore/10_basic.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -setup: - - - do: - snapshot.create_repository: - repository: test_repo_restore_1 - body: - type: fs - settings: - location: "test_repo_restore_1_loc" - - - do: - indices.create: - index: test_index - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - ---- -"Create a snapshot and then restore it": - - - do: - snapshot.create: - repository: test_repo_restore_1 - snapshot: test_snapshot - wait_for_completion: true - - - match: { snapshot.snapshot: test_snapshot } - - match: { snapshot.state : SUCCESS } - - match: { snapshot.shards.successful: 1 } - - match: { snapshot.shards.failed : 0 } - - is_true: snapshot.version - - gt: { snapshot.version_id: 0} - - - do: - indices.close: - index : test_index - - - do: - snapshot.restore: - repository: test_repo_restore_1 - snapshot: test_snapshot - wait_for_completion: true - - - do: - indices.recovery: - index: test_index - - - match: { test_index.shards.0.type: SNAPSHOT } - - match: { test_index.shards.0.stage: DONE } - - match: { test_index.shards.0.index.files.recovered: 1} - - gt: { test_index.shards.0.index.size.recovered_in_bytes: 0} - - match: { test_index.shards.0.index.files.reused: 0} - - match: { test_index.shards.0.index.size.reused_in_bytes: 0} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.status/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.status/10_basic.yml deleted file mode 100644 index c35f2419bdc91..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/snapshot.status/10_basic.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -setup: - - - do: - snapshot.create_repository: - repository: test_repo_status_1 - body: - type: fs - settings: - location: "test_repo_status_1_loc" - ---- -"Get snapshot status": - - do: - indices.create: - index: test_index - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - snapshot.create: - repository: test_repo_status_1 - snapshot: test_snapshot - wait_for_completion: true - - - do: - snapshot.status: - repository: test_repo_status_1 - snapshot: test_snapshot - - - is_true: snapshots - - match: { snapshots.0.snapshot: test_snapshot } - - match: { snapshots.0.state: SUCCESS } - - gt: { snapshots.0.stats.incremental.file_count: 0 } - - gt: { snapshots.0.stats.incremental.size_in_bytes: 0 } - - gt: { snapshots.0.stats.total.file_count: 0 } - - gt: { snapshots.0.stats.total.size_in_bytes: 0 } - - is_true: snapshots.0.stats.start_time_in_millis -## fast in memory snapshots can take less than one millisecond to complete. - - gte: { snapshots.0.stats.time_in_millis: 0 } - ---- -"Get missing snapshot status throws an exception": - - - do: - catch: /snapshot_missing_exception.+ is missing/ - snapshot.status: - repository: test_repo_status_1 - snapshot: test_nonexistent_snapshot - ---- -"Get missing snapshot status succeeds when ignoreUnavailable is true": - - - do: - snapshot.status: - repository: test_repo_status_1 - snapshot: test_nonexistent_snapshot - ignore_unavailable: true - - - is_true: snapshots diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/10_basic.yml deleted file mode 100644 index 4b6db06e29f36..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/10_basic.yml +++ /dev/null @@ -1,25 +0,0 @@ -setup: - - do: - index: - index: test - id: testing_document - body: - body: Amsterdam meetup - - do: - indices.refresh: {} - ---- -"Basic tests for suggest API": - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - test_suggestion: - text: "The Amsterdma meetpu" - term: - field: body - - - match: {suggest.test_suggestion.1.options.0.text: amsterdam} - - match: {suggest.test_suggestion.2.options.0.text: meetup} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/20_completion.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/20_completion.yml deleted file mode 100644 index b64a51141dc6e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/20_completion.yml +++ /dev/null @@ -1,329 +0,0 @@ -# This test creates one huge mapping in the setup -# Every test should use its own field to make sure it works - -setup: - - - do: - indices.create: - index: test - body: - mappings: - "properties": - "suggest_1": - "type" : "completion" - "suggest_2": - "type" : "completion" - "suggest_3": - "type" : "completion" - "suggest_4": - "type" : "completion" - "suggest_5a": - "type" : "completion" - "suggest_5b": - "type" : "completion" - "suggest_6": - "type" : "completion" - title: - type: keyword - ---- -"Simple suggestion should work": - - - do: - index: - index: test - id: 1 - body: - suggest_1: "bar" - - - do: - index: - index: test - id: 2 - body: - suggest_1: "baz" - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - result: - text: "b" - completion: - field: suggest_1 - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 2 } - ---- -"Simple suggestion array should work": - - - do: - index: - index: test - id: 1 - body: - suggest_2: ["bar", "foo"] - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - result: - text: "f" - completion: - field: suggest_2 - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 1 } - - match: { suggest.result.0.options.0.text: "foo" } - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - result: - text: "b" - completion: - field: suggest_2 - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 1 } - - match: { suggest.result.0.options.0.text: "bar" } - ---- -"Suggestion entry should work": - - - do: - index: - index: test - id: 1 - body: - suggest_3: - input: "bar" - weight: 2 - - - do: - index: - index: test - id: 2 - body: - suggest_3: - input: "baz" - weight: 3 - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - result: - text: "b" - completion: - field: suggest_3 - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 2 } - - match: { suggest.result.0.options.0.text: "baz" } - - match: { suggest.result.0.options.1.text: "bar" } - ---- -"Suggestion entry array should work": - - - do: - index: - index: test - id: 1 - body: - suggest_4: - - input: "bar" - weight: 3 - - input: "fo" - weight: 3 - - - do: - index: - index: test - id: 2 - body: - suggest_4: - - input: "baz" - weight: 2 - - input: "foo" - weight: 1 - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - result: - text: "b" - completion: - field: suggest_4 - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 2 } - - match: { suggest.result.0.options.0.text: "bar" } - - match: { suggest.result.0.options.1.text: "baz" } - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - result: - text: "f" - completion: - field: suggest_4 - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 2 } - - match: { suggest.result.0.options.0.text: "fo" } - - match: { suggest.result.0.options.1.text: "foo" } - ---- -"Multiple Completion fields should work": - - - do: - index: - index: test - id: 1 - body: - suggest_5a: "bar" - suggest_5b: "baz" - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - result: - text: "b" - completion: - field: suggest_5a - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 1 } - - match: { suggest.result.0.options.0.text: "bar" } - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - result: - text: "b" - completion: - field: suggest_5b - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 1 } - - match: { suggest.result.0.options.0.text: "baz" } - ---- -"Suggestions with source should work": - - - do: - index: - index: test - id: 1 - body: - suggest_6: - input: "bar" - weight: 2 - title: "title_bar" - count: 4 - - - do: - index: - index: test - id: 2 - body: - suggest_6: - input: "baz" - weight: 3 - title: "title_baz" - count: 3 - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - result: - text: "b" - completion: - field: suggest_6 - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 2 } - - match: { suggest.result.0.options.0.text: "baz" } - - match: { suggest.result.0.options.0._index: "test" } - - match: { suggest.result.0.options.0._type: "_doc" } - - match: { suggest.result.0.options.0._source.title: "title_baz" } - - match: { suggest.result.0.options.0._source.count: 3 } - - match: { suggest.result.0.options.1.text: "bar" } - - match: { suggest.result.0.options.1._index: "test" } - - match: { suggest.result.0.options.1._type: "_doc" } - - match: { suggest.result.0.options.1._source.title: "title_bar" } - - match: { suggest.result.0.options.1._source.count: 4 } - ---- -"Skip duplicates should work": - - skip: - version: " - 6.0.99" - reason: skip_duplicates was added in 6.1 - - - do: - index: - index: test - id: 1 - body: - suggest_1: "bar" - - - do: - index: - index: test - id: 2 - body: - suggest_1: "bar" - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - result: - text: "b" - completion: - field: suggest_1 - skip_duplicates: true - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 1 } - - match: { suggest.result.0.options.0.text: "bar" } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/30_context.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/30_context.yml deleted file mode 100644 index e2c7ccfb421e3..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/30_context.yml +++ /dev/null @@ -1,403 +0,0 @@ -# This test creates one huge mapping in the setup -# Every test should use its own field to make sure it works - -setup: - - - do: - indices.create: - index: test - body: - mappings: - "properties": - "location": - "type": "geo_point" - "suggest_context": - "type" : "completion" - "contexts": - - - "name" : "color" - "type" : "category" - "suggest_context_with_path": - "type" : "completion" - "contexts": - - - "name" : "color" - "type" : "category" - "path" : "color" - "suggest_geo": - "type" : "completion" - "contexts": - - - "name" : "location" - "type" : "geo" - "precision" : "5km" - "suggest_multi_contexts": - "type" : "completion" - "contexts": - - - "name" : "location" - "type" : "geo" - "precision" : "5km" - "path" : "location" - - - "name" : "color" - "type" : "category" - "path" : "color" - ---- -"Simple context suggestion should work": - - - do: - index: - index: test - id: 1 - body: - suggest_context: - input: "foo red" - contexts: - color: "red" - - - do: - index: - index: test - id: 2 - body: - suggest_context: - input: "foo blue" - contexts: - color: "blue" - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - result: - text: "foo" - completion: - field: suggest_context - contexts: - color: "red" - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 1 } - - match: { suggest.result.0.options.0.text: "foo red" } - ---- -"Category suggest context from path should work": - - - do: - index: - index: test - id: 1 - body: - suggest_context_with_path: - input: "Foo red" - contexts: - color: "red" - - - do: - index: - index: test - id: 2 - body: - suggest_context_with_path: "Foo blue" - color: "blue" - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - result: - text: "foo" - completion: - field: suggest_context_with_path - contexts: - color: "red" - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 1 } - - match: { suggest.result.0.options.0.text: "Foo red" } - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - result: - text: "foo" - completion: - field: suggest_context_with_path - contexts: - color: "blue" - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 1 } - - match: { suggest.result.0.options.0.text: "Foo blue" } - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - result: - text: "foo" - completion: - field: suggest_context_with_path - contexts: - color: ["blue", "red"] - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 2 } - ---- -"Geo suggest should work": - - - do: - index: - index: test - id: 1 - body: - suggest_geo: - input: "Marriot in Amsterdam" - contexts: - location: - lat : 52.22 - lon : 4.53 - - - do: - index: - index: test - id: 2 - body: - suggest_geo: - input: "Marriot in Berlin" - contexts: - location: - lat : 53.31 - lon : 13.24 - - - do: - indices.refresh: {} - - - do: - indices.get_mapping: {} - - do: - search: - rest_total_hits_as_int: true - index: test - body: - suggest: - result: - text: "mar" - completion: - field: suggest_geo - contexts: - location: - lat : 52.2263 - lon : 4.543 - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 1 } - - match: { suggest.result.0.options.0.text: "Marriot in Amsterdam" } - ---- -"Multi contexts should work": - - - do: - index: - index: test - id: 1 - body: - suggest_multi_contexts: "Marriot in Amsterdam" - location: - lat : 52.22 - lon : 4.53 - color: "red" - - - do: - index: - index: test - id: 2 - body: - suggest_multi_contexts: "Marriot in Berlin" - location: - lat : 53.31 - lon : 13.24 - color: "blue" - - - do: - indices.refresh: {} - - - do: - indices.get_mapping: {} - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - suggest: - result: - text: "mar" - completion: - field: suggest_multi_contexts - contexts: - location: - lat : 52.22 - lon : 4.53 - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 1 } - - match: { suggest.result.0.options.0.text: "Marriot in Amsterdam" } - - - do: - search: - rest_total_hits_as_int: true - index: test - body: - suggest: - result: - text: "mar" - completion: - field: suggest_multi_contexts - contexts: - color: "blue" - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 1 } - - match: { suggest.result.0.options.0.text: "Marriot in Berlin" } - ---- -"Skip duplicates with contexts should work": - - skip: - version: " - 6.0.99" - reason: skip_duplicates was added in 6.1 - - - do: - index: - index: test - id: 1 - body: - suggest_context: - input: "foo" - contexts: - color: "red" - - - do: - index: - index: test - id: 1 - body: - suggest_context: - input: "foo" - contexts: - color: "red" - - - do: - index: - index: test - id: 2 - body: - suggest_context: - input: "foo" - contexts: - color: "blue" - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: - suggest: - result: - text: "foo" - completion: - field: suggest_context - skip_duplicates: true - contexts: - color: "red" - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 1 } - - match: { suggest.result.0.options.0.text: "foo" } - ---- -"Indexing and Querying without contexts is forbidden": - - skip: - version: " - 6.99.99" - reason: this feature was removed in 7.0 - - - do: - index: - index: test - id: 1 - body: - suggest_context: - input: "foo" - contexts: - color: "red" - suggest_multi_contexts: - input: "bar" - contexts: - color: "blue" - - - do: - catch: /Contexts are mandatory in context enabled completion field \[suggest_context\]/ - index: - index: test - id: 2 - body: - suggest_context: - input: "foo" - - - do: - indices.refresh: {} - - - do: - catch: /Missing mandatory contexts in context query/ - search: - rest_total_hits_as_int: true - allow_partial_search_results: false - body: - suggest: - result: - text: "foo" - completion: - field: suggest_context - - - do: - catch: /Missing mandatory contexts in context query/ - search: - rest_total_hits_as_int: true - allow_partial_search_results: false - body: - suggest: - result: - text: "foo" - completion: - field: suggest_context - contexts: {} - - - do: - catch: /Missing mandatory contexts in context query/ - search: - rest_total_hits_as_int: true - allow_partial_search_results: false - body: - suggest: - result: - text: "foo" - completion: - field: suggest_multi_contexts - contexts: - location: [] diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/40_typed_keys.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/40_typed_keys.yml deleted file mode 100644 index daac7d895611c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/40_typed_keys.yml +++ /dev/null @@ -1,57 +0,0 @@ -setup: - - - do: - indices.create: - index: test - body: - settings: - number_of_replicas: 0 - mappings: - properties: - title: - type: keyword - suggestions: - type: completion - contexts: - - - "name" : "format" - "type" : "category" - - - do: - bulk: - refresh: true - index: test - body: - - '{"index": {}}' - - '{"title": "Elasticsearch in Action", "suggestions": {"input": "ELK in Action", "contexts": {"format": "ebook"}}}' - - '{"index": {}}' - - '{"title": "Elasticsearch - The Definitive Guide", "suggestions": {"input": ["Elasticsearch in Action"], "contexts": {"format": "ebook"}}}' - ---- -"Test typed keys parameter for suggesters": - - - do: - search: - rest_total_hits_as_int: true - typed_keys: true - body: - query: - match_all: {} - suggest: - text: "Elastic" - term_suggester: - term: - field: title - context_suggester: - prefix: "Elastic" - completion: - field: suggestions - contexts: - format: "ebook" - phrase_suggester: - phrase: - field: title - - - is_true: suggest.term#term_suggester - - is_true: suggest.completion#context_suggester - - is_true: suggest.phrase#phrase_suggester diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/50_completion_with_multi_fields.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/50_completion_with_multi_fields.yml deleted file mode 100644 index a29019183e199..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/suggest/50_completion_with_multi_fields.yml +++ /dev/null @@ -1,290 +0,0 @@ - ---- -"Search by suggestion and by keyword sub-field should work": - - - skip: - version: " - 6.99.99" - reason: "Search by suggestion with multi-fields was introduced 7.0.0" - - - do: - indices.create: - index: completion_with_sub_keyword - body: - mappings: - "properties": - "suggest_1": - "type" : "completion" - "fields": - "text_raw": - "type" : "keyword" - - - do: - index: - index: completion_with_sub_keyword - id: 1 - body: - suggest_1: "bar" - - - do: - index: - index: completion_with_sub_keyword - id: 2 - body: - suggest_1: "baz" - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - index: completion_with_sub_keyword - body: - suggest: - result: - text: "b" - completion: - field: suggest_1 - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 2 } - - - - do: - search: - rest_total_hits_as_int: true - index: completion_with_sub_keyword - body: - query: { term: { suggest_1.text_raw: "bar" }} - - - match: { hits.total: 1 } - - - ---- -"Search by suggestion on sub field should work": - - - skip: - version: " - 6.99.99" - reason: "Search by suggestion with multi-fields was introduced 7.0.0" - - - do: - indices.create: - index: completion_with_sub_completion - body: - mappings: - "properties": - "suggest_1": - "type": "completion" - "fields": - "suggest_2": - "type": "completion" - - - do: - index: - index: completion_with_sub_completion - id: 1 - body: - suggest_1: "bar" - - - do: - index: - index: completion_with_sub_completion - id: 2 - body: - suggest_1: "baz" - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - index: completion_with_sub_completion - body: - suggest: - result: - text: "b" - completion: - field: suggest_1.suggest_2 - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 2 } - ---- -"Search by suggestion on sub field with context should work": - - - skip: - version: " - 6.99.99" - reason: "Search by suggestion with multi-fields was introduced 7.0.0" - - - do: - indices.create: - index: completion_with_context - body: - mappings: - "properties": - "suggest_1": - "type": "completion" - "contexts": - - - "name": "color" - "type": "category" - "fields": - "suggest_2": - "type": "completion" - "contexts": - - - "name": "color" - "type": "category" - - - - do: - index: - index: completion_with_context - id: 1 - body: - suggest_1: - input: "foo red" - contexts: - color: "red" - - - do: - index: - index: completion_with_context - id: 2 - body: - suggest_1: - input: "foo blue" - contexts: - color: "blue" - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - index: completion_with_context - body: - suggest: - result: - prefix: "foo" - completion: - field: suggest_1.suggest_2 - contexts: - color: "red" - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 1 } - - match: { suggest.result.0.options.0.text: "foo red" } - - ---- -"Search by suggestion on sub field with weight should work": - - - skip: - version: " - 6.99.99" - reason: "Search by suggestion with multi-fields was introduced 7.0.0" - - - do: - indices.create: - index: completion_with_weight - body: - mappings: - "properties": - "suggest_1": - "type": "completion" - "fields": - "suggest_2": - "type": "completion" - - - do: - index: - index: completion_with_weight - id: 1 - body: - suggest_1: - input: "bar" - weight: 2 - - - do: - index: - index: completion_with_weight - id: 2 - body: - suggest_1: - input: "baz" - weight: 3 - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - index: completion_with_weight - body: - suggest: - result: - text: "b" - completion: - field: suggest_1.suggest_2 - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 2 } - - match: { suggest.result.0.options.0.text: "baz" } - - match: { suggest.result.0.options.1.text: "bar" } - ---- -"Search by suggestion on geofield-hash on sub field should work": - - - skip: - version: " - 6.99.99" - reason: "Search by suggestion with multi-fields was introduced 7.0.0" - - - do: - indices.create: - index: geofield_with_completion - body: - mappings: - "properties": - "geofield": - "type": "geo_point" - "fields": - "suggest_1": - "type": "completion" - - - do: - index: - index: geofield_with_completion - id: 1 - body: - geofield: "hgjhrwysvqw7" - #41.12,-72.34,12 - - - do: - index: - index: geofield_with_completion - id: 1 - body: - geofield: "hgm4psywmkn7" - #41.12,-71.34,12 - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - index: geofield_with_completion - body: - suggest: - result: - prefix: "hgm" - completion: - field: geofield.suggest_1 - - - - length: { suggest.result: 1 } - - length: { suggest.result.0.options: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.cancel/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.cancel/10_basic.yml deleted file mode 100644 index d65ee04211b9d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.cancel/10_basic.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -"tasks_cancel test": - - do: - tasks.cancel: - actions: "unknown_action" - - - length: { nodes: 0 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.get/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.get/10_basic.yml deleted file mode 100644 index addeb3226c575..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.get/10_basic.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -"get task test": - # Note that this gets much better testing in reindex's tests because it actually saves the task - - do: - catch: missing - tasks.get: - task_id: foo:1 - - match: {error.reason: "/task.\\[foo:1\\].belongs.to.the.node.\\[foo\\].which.isn't.part.of.the.cluster.and.there.is.no.record.of.the.task/"} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.list/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.list/10_basic.yml deleted file mode 100644 index 1742134af2b75..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/tasks.list/10_basic.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -"tasks_list test": - - skip: - features: [arbitrary_key] - - - do: - nodes.info: {} - - set: - nodes._arbitrary_key_: node_id - - - do: - tasks.list: {} - - - is_true: nodes - - is_true: nodes.$node_id.roles - - - do: - tasks.list: - group_by: parents - - - is_true: tasks - ---- -"tasks_list headers": - - skip: - version: " - 6.99.99" - features: headers - reason: task headers has been added in 7.0.0 - - - do: - headers: { "X-Opaque-Id": "That is me" } - tasks.list: - actions: "cluster:monitor/tasks/lists" - group_by: none - - - is_true: tasks - - match: { tasks.0.headers.X-Opaque-Id: "That is me" } - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/10_basic.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/10_basic.yml deleted file mode 100644 index 62ec86118e5bb..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/10_basic.yml +++ /dev/null @@ -1,36 +0,0 @@ -setup: - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: testidx - body: - mappings: - "properties": - "text": - "type" : "text" - "term_vector" : "with_positions_offsets" - - do: - index: - index: testidx - id: testing_document - body: - "text" : "The quick brown fox is brown." - - do: - indices.refresh: {} - ---- -"Basic tests for termvector get": - - - do: - termvectors: - index: testidx - id: testing_document - "term_statistics" : true - - - - match: {term_vectors.text.field_statistics.sum_doc_freq: 5} - - match: {term_vectors.text.terms.brown.doc_freq: 1} - - match: {term_vectors.text.terms.brown.tokens.0.start_offset: 10} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/11_basic_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/11_basic_with_types.yml deleted file mode 100644 index 992d6db7ca786..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/11_basic_with_types.yml +++ /dev/null @@ -1,36 +0,0 @@ -setup: - - do: - indices.create: - include_type_name: true - index: testidx - body: - mappings: - testtype: - "properties": - "text": - "type" : "text" - "term_vector" : "with_positions_offsets" - - do: - index: - index: testidx - type: testtype - id: testing_document - body: - "text" : "The quick brown fox is brown." - - do: - indices.refresh: {} - ---- -"Basic tests for termvector get": - - - do: - termvectors: - index: testidx - type: testtype - id: testing_document - "term_statistics" : true - - - - match: {term_vectors.text.field_statistics.sum_doc_freq: 5} - - match: {term_vectors.text.terms.brown.doc_freq: 1} - - match: {term_vectors.text.terms.brown.tokens.0.start_offset: 10} diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/20_issue7121.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/20_issue7121.yml deleted file mode 100644 index 5f43e8a247923..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/20_issue7121.yml +++ /dev/null @@ -1,44 +0,0 @@ -setup: - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - ---- -"Term vector API should return 'found: false' for docs between index and refresh": - - do: - indices.create: - index: testidx - body: - settings: - index: - translog.flush_threshold_size: "512MB" - number_of_shards: 1 - number_of_replicas: 0 - refresh_interval: -1 - mappings: - properties: - text: - type : "text" - term_vector : "with_positions_offsets" - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: testidx - id: 1 - body: - text : "foo bar" - - - do: - termvectors: - index: testidx - id: 1 - realtime: false - - - match: { _index: "testidx" } - - match: { _type: "_doc" } - - match: { _id: "1" } - - is_false: found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/21_issue7121_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/21_issue7121_with_types.yml deleted file mode 100644 index cf597bf141f61..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/21_issue7121_with_types.yml +++ /dev/null @@ -1,42 +0,0 @@ -"Term vector API should return 'found: false' for docs between index and refresh": - - do: - indices.create: - include_type_name: true - index: testidx - body: - settings: - index: - translog.flush_threshold_size: "512MB" - number_of_shards: 1 - number_of_replicas: 0 - refresh_interval: -1 - mappings: - doc: - properties: - text: - type : "text" - term_vector : "with_positions_offsets" - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: testidx - type: doc - id: 1 - body: - text : "foo bar" - - - do: - termvectors: - index: testidx - type: doc - id: 1 - realtime: false - - - match: { _index: "testidx" } - - match: { _type: "doc" } - - match: { _id: "1" } - - is_false: found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/30_realtime.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/30_realtime.yml deleted file mode 100644 index 0cb6dfc06904b..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/30_realtime.yml +++ /dev/null @@ -1,42 +0,0 @@ -setup: - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - ---- -"Realtime Term Vectors": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - refresh_interval: -1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - id: 1 - body: { foo: bar } - - - do: - termvectors: - index: test_1 - id: 1 - realtime: false - - - is_false: found - - - do: - termvectors: - index: test_1 - id: 1 - realtime: true - - - is_true: found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/31_realtime_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/31_realtime_with_types.yml deleted file mode 100644 index 26f441207ace8..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/31_realtime_with_types.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -"Realtime Term Vectors": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - refresh_interval: -1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - termvectors: - index: test_1 - type: test - id: 1 - realtime: false - - - is_false: found - - - do: - termvectors: - index: test_1 - type: test - id: 1 - realtime: true - - - is_true: found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/50_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/50_mix_typeless_typeful.yml deleted file mode 100644 index 4382442dee4dd..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/termvectors/50_mix_typeless_typeful.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -"Term vectors with typeless API on an index that has types": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "text" - term_vector: "with_positions" - - - do: - index: - index: index - type: not_doc - id: 1 - body: { foo: bar } - - - do: - indices.refresh: {} - - - do: - termvectors: - index: index - type: _doc # todo: remove when termvectors support typeless API - id: 1 - - - is_true: found - - match: {_type: _doc} - - match: {term_vectors.foo.terms.bar.term_freq: 1} - - - do: - termvectors: - index: index - type: some_random_type - id: 1 - - - is_false: found diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/10_doc.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/10_doc.yml deleted file mode 100644 index 3a35ad46f9161..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/10_doc.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -"Partial document": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - body: - foo: bar - count: 1 - nested: { one: 1, two: 2 } - - - do: - update: - index: test_1 - id: 1 - body: - doc: - foo: baz - nested: - one: 3 - - - match: { _index: test_1 } - - match: { _type: _doc } - - match: { _id: "1" } - - match: { _version: 2 } - - - do: - get: - index: test_1 - id: 1 - - - match: { _source.foo: baz } - - match: { _source.count: 1 } - - match: { _source.nested.one: 3 } - - match: { _source.nested.two: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/11_shard_header.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/11_shard_header.yml deleted file mode 100644 index 41dba3551e64c..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/11_shard_header.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -"Update check shard header": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: foobar - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: foobar - id: 1 - body: { foo: bar } - - - do: - update: - index: foobar - id: 1 - body: - doc: - foo: baz - - - match: { _index: foobar } - - match: { _type: _doc } - - match: { _id: "1"} - - match: { _version: 2} - - match: { _shards.total: 1} - - match: { _shards.successful: 1} - - match: { _shards.failed: 0} - - is_false: _shards.pending diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/12_result.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/12_result.yml deleted file mode 100644 index 657c036291bd6..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/12_result.yml +++ /dev/null @@ -1,51 +0,0 @@ ---- -"Update result field": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - update: - index: test_1 - id: 1 - body: - doc: { foo: bar } - doc_as_upsert: true - - - match: { _version: 1 } - - match: { result: created } - - - do: - update: - index: test_1 - id: 1 - body: - doc: { foo: bar } - doc_as_upsert: true - - - match: { _version: 1 } - - match: { result: noop } - - - do: - update: - index: test_1 - id: 1 - body: - doc: { foo: bar } - doc_as_upsert: true - detect_noop: false - - - match: { _version: 2 } - - match: { result: updated } - - - do: - update: - index: test_1 - id: 1 - body: - doc: { foo: baz } - doc_as_upsert: true - detect_noop: true - - - match: { _version: 3 } - - match: { result: updated } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/13_legacy_doc.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/13_legacy_doc.yml deleted file mode 100644 index 08f3457400d4f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/13_legacy_doc.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -"Partial document": - - - do: - index: - index: test_1 - id: 1 - body: - foo: bar - count: 1 - nested: { one: 1, two: 2 } - - - do: - update: - index: test_1 - id: 1 - body: - doc: - foo: baz - nested: - one: 3 - - - match: { _index: test_1 } - - match: { _type: _doc } - - match: { _id: "1" } - - match: { _version: 2 } - - - do: - get: - index: test_1 - id: 1 - - - match: { _source.foo: baz } - - match: { _source.count: 1 } - - match: { _source.nested.one: 3 } - - match: { _source.nested.two: 2 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/14_shard_header_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/14_shard_header_with_types.yml deleted file mode 100644 index eb2e4ff9a9117..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/14_shard_header_with_types.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -"Update check shard header": - - - do: - indices.create: - index: foobar - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: foobar - type: baz - id: 1 - body: { foo: bar } - - - do: - update: - index: foobar - type: baz - id: 1 - body: - doc: - foo: baz - - - match: { _index: foobar } - - match: { _type: baz } - - match: { _id: "1"} - - match: { _version: 2} - - match: { _shards.total: 1} - - match: { _shards.successful: 1} - - match: { _shards.failed: 0} - - is_false: _shards.pending diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/15_result_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/15_result_with_types.yml deleted file mode 100644 index 9adada6d54b4f..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/15_result_with_types.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -"Update result field": - - - do: - update: - index: test_1 - type: test - id: 1 - body: - doc: { foo: bar } - doc_as_upsert: true - - - match: { _version: 1 } - - match: { result: created } - - - do: - update: - index: test_1 - type: test - id: 1 - body: - doc: { foo: bar } - doc_as_upsert: true - - - match: { _version: 1 } - - match: { result: noop } - - - do: - update: - index: test_1 - type: test - id: 1 - body: - doc: { foo: bar } - doc_as_upsert: true - detect_noop: false - - - match: { _version: 2 } - - match: { result: updated } - - - do: - update: - index: test_1 - type: test - id: 1 - body: - doc: { foo: baz } - doc_as_upsert: true - detect_noop: true - - - match: { _version: 3 } - - match: { result: updated } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/16_noop.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/16_noop.yml deleted file mode 100644 index bfb56541fb7eb..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/16_noop.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -"Noop": - - skip: - version: " - 7.3.99" - reason: "Noop does not return seq_no and primary_term until 7.4.0" - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - match: { _seq_no: 0 } - - match: { _version: 1 } - - match: { _primary_term: 1 } - - match: { result: created } - - - do: - update: - index: test_1 - type: test - id: 1 - body: - doc: { foo: bar } - - - match: { _seq_no: 0 } - - match: { _version: 1 } - - match: { _primary_term: 1 } - - match: { result: noop } - - - do: - update: - index: test_1 - type: test - id: 1 - body: - doc: { foo: bar } - detect_noop: false - - - match: { _seq_no: 1 } - - match: { _primary_term: 1 } - - match: { _version: 2 } - - match: { result: updated } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/20_doc_upsert.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/20_doc_upsert.yml deleted file mode 100644 index a849eecc66629..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/20_doc_upsert.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -"Doc upsert": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - update: - index: test_1 - id: 1 - body: - doc: { foo: bar, count: 1 } - upsert: { foo: baz } - - - do: - get: - index: test_1 - id: 1 - - - match: { _source.foo: baz } - - is_false: _source.count - - - - do: - update: - index: test_1 - id: 1 - body: - doc: { foo: bar, count: 1 } - upsert: { foo: baz } - - - do: - get: - index: test_1 - id: 1 - - - match: { _source.foo: bar } - - match: { _source.count: 1 } - - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/21_doc_upsert_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/21_doc_upsert_with_types.yml deleted file mode 100644 index f34e030ff66a0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/21_doc_upsert_with_types.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -"Doc upsert": - - - do: - update: - index: test_1 - type: test - id: 1 - body: - doc: { foo: bar, count: 1 } - upsert: { foo: baz } - - - do: - get: - index: test_1 - type: test - id: 1 - - - match: { _source.foo: baz } - - is_false: _source.count - - - - do: - update: - index: test_1 - type: test - id: 1 - body: - doc: { foo: bar, count: 1 } - upsert: { foo: baz } - - - do: - get: - index: test_1 - type: test - id: 1 - - - match: { _source.foo: bar } - - match: { _source.count: 1 } - - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/22_doc_as_upsert.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/22_doc_as_upsert.yml deleted file mode 100644 index 5bdc3ecea75fc..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/22_doc_as_upsert.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -"Doc as upsert": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - update: - index: test_1 - id: 1 - body: - doc: { foo: bar, count: 1 } - doc_as_upsert: true - - - do: - get: - index: test_1 - id: 1 - - - match: { _source.foo: bar } - - match: { _source.count: 1 } - - - - do: - update: - index: test_1 - id: 1 - body: - doc: { count: 2 } - doc_as_upsert: true - - - do: - get: - index: test_1 - id: 1 - - - match: { _source.foo: bar } - - match: { _source.count: 2 } - - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/24_doc_as_upsert_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/24_doc_as_upsert_with_types.yml deleted file mode 100644 index 7585b9f3e0b94..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/24_doc_as_upsert_with_types.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -"Doc as upsert": - - - do: - update: - index: test_1 - type: test - id: 1 - body: - doc: { foo: bar, count: 1 } - doc_as_upsert: true - - - do: - get: - index: test_1 - type: test - id: 1 - - - match: { _source.foo: bar } - - match: { _source.count: 1 } - - - - do: - update: - index: test_1 - type: test - id: 1 - body: - doc: { count: 2 } - doc_as_upsert: true - - - do: - get: - index: test_1 - type: test - id: 1 - - - match: { _source.foo: bar } - - match: { _source.count: 2 } - - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/35_if_seq_no.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/35_if_seq_no.yml deleted file mode 100644 index f982adf693ad0..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/35_if_seq_no.yml +++ /dev/null @@ -1,64 +0,0 @@ ---- -"Update with if_seq_no": - - - skip: - version: " - 6.6.99" - reason: if_seq_no was added in 6.7.0 - - - do: - catch: missing - update: - index: test_1 - id: 1 - if_seq_no: 1 - if_primary_term: 1 - body: - doc: { foo: baz } - - - do: - index: - index: test_1 - id: 1 - body: - foo: baz - - - do: - catch: conflict - update: - index: test_1 - id: 1 - if_seq_no: 234 - if_primary_term: 1 - body: - doc: { foo: baz } - - - do: - update: - index: test_1 - id: 1 - if_seq_no: 0 - if_primary_term: 1 - body: - doc: { foo: bar } - - - do: - get: - index: test_1 - id: 1 - - - match: { _source: { foo: bar } } - - - do: - bulk: - body: - - update: - _index: test_1 - _id: 1 - if_seq_no: 100 - if_primary_term: 200 - - doc: - foo: baz - - - match: { errors: true } - - match: { items.0.update.status: 409 } - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/40_routing.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/40_routing.yml deleted file mode 100644 index 6f43d381e0537..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/40_routing.yml +++ /dev/null @@ -1,58 +0,0 @@ ---- -"Routing": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - update: - index: test_1 - id: 1 - routing: 5 - body: - doc: { foo: baz } - upsert: { foo: bar } - - - do: - get: - index: test_1 - id: 1 - routing: 5 - stored_fields: _routing - - - match: { _routing: "5"} - - - do: - catch: missing - update: - index: test_1 - id: 1 - body: - doc: { foo: baz } - - - do: - update: - index: test_1 - id: 1 - routing: 5 - _source: foo - body: - doc: { foo: baz } - - - match: { get._source.foo: baz } - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/41_routing_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/41_routing_with_types.yml deleted file mode 100644 index 977db506710c7..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/41_routing_with_types.yml +++ /dev/null @@ -1,58 +0,0 @@ ---- -"Routing": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - update: - index: test_1 - type: test - id: 1 - routing: 5 - body: - doc: { foo: baz } - upsert: { foo: bar } - - - do: - get: - index: test_1 - type: test - id: 1 - routing: 5 - stored_fields: _routing - - - match: { _routing: "5"} - - - do: - catch: missing - update: - index: test_1 - type: test - id: 1 - body: - doc: { foo: baz } - - - do: - update: - index: test_1 - type: test - id: 1 - routing: 5 - _source: foo - body: - doc: { foo: baz } - - - match: { get._source.foo: baz } - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/60_refresh.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/60_refresh.yml deleted file mode 100644 index 3a74f75f4f11d..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/60_refresh.yml +++ /dev/null @@ -1,123 +0,0 @@ ---- -"Refresh": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - indices.create: - index: test_1 - body: - settings: - index.refresh_interval: -1 - number_of_replicas: 0 - - - do: - update: - index: test_1 - id: 1 - body: - doc: { foo: baz } - upsert: { foo: bar } - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - - match: { hits.total: 0 } - - - do: - update: - index: test_1 - id: 2 - refresh: true - body: - doc: { foo: baz } - upsert: { foo: bar } - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 2 }} - - - match: { hits.total: 1 } - ---- -"When refresh url parameter is an empty string that means \"refresh immediately\"": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: test_1 - id: 1 - refresh: true - body: { foo: bar } - - is_true: forced_refresh - - - do: - update: - index: test_1 - id: 1 - refresh: "" - body: - doc: {cat: dog} - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { cat: dog }} - - - match: { hits.total: 1 } - ---- -"refresh=wait_for waits until changes are visible in search": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - - do: - index: - index: update_60_refresh_1 - id: update_60_refresh_id1 - body: { foo: bar } - refresh: true - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: update_60_refresh_1 - body: - query: { term: { _id: update_60_refresh_id1 }} - - match: { hits.total: 1 } - - - do: - update: - index: update_60_refresh_1 - id: update_60_refresh_id1 - refresh: wait_for - body: - doc: { test: asdf } - - is_false: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: update_60_refresh_1 - body: - query: { match: { test: asdf } } - - match: { hits.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/61_refresh_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/61_refresh_with_types.yml deleted file mode 100644 index be2d9f9f7969e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/61_refresh_with_types.yml +++ /dev/null @@ -1,115 +0,0 @@ ---- -"Refresh": - - - do: - indices.create: - index: test_1 - body: - settings: - index.refresh_interval: -1 - number_of_replicas: 0 - - - do: - update: - index: test_1 - type: test - id: 1 - body: - doc: { foo: baz } - upsert: { foo: bar } - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - - match: { hits.total: 0 } - - - do: - update: - index: test_1 - type: test - id: 2 - refresh: true - body: - doc: { foo: baz } - upsert: { foo: bar } - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 2 }} - - - match: { hits.total: 1 } - ---- -"When refresh url parameter is an empty string that means \"refresh immediately\"": - - do: - index: - index: test_1 - type: test - id: 1 - refresh: true - body: { foo: bar } - - is_true: forced_refresh - - - do: - update: - index: test_1 - type: test - id: 1 - refresh: "" - body: - doc: {cat: dog} - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { cat: dog }} - - - match: { hits.total: 1 } - ---- -"refresh=wait_for waits until changes are visible in search": - - do: - index: - index: update_60_refresh_1 - type: test - id: update_60_refresh_id1 - body: { foo: bar } - refresh: true - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: update_60_refresh_1 - body: - query: { term: { _id: update_60_refresh_id1 }} - - match: { hits.total: 1 } - - - do: - update: - index: update_60_refresh_1 - type: test - id: update_60_refresh_id1 - refresh: wait_for - body: - doc: { test: asdf } - - is_false: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: update_60_refresh_1 - body: - query: { match: { test: asdf } } - - match: { hits.total: 1 } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/80_source_filtering.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/80_source_filtering.yml deleted file mode 100644 index 9e6d5a4671955..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/80_source_filtering.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -"Source filtering": - - - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 - - do: - update: - index: test_1 - id: 1 - _source: [foo, bar] - body: - doc: { foo: baz } - upsert: { foo: bar } - - - match: { get._source.foo: bar } - - is_false: get._source.bar - -# TODO: -# -# - Add _routing diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/81_source_filtering_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/81_source_filtering_with_types.yml deleted file mode 100644 index 4bb22e6b8012e..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/81_source_filtering_with_types.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -"Source filtering": - - - do: - update: - index: test_1 - type: test - id: 1 - _source: [foo, bar] - body: - doc: { foo: baz } - upsert: { foo: bar } - - - match: { get._source.foo: bar } - - is_false: get._source.bar - -# TODO: -# -# - Add _routing diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/85_fields_meta.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/85_fields_meta.yml deleted file mode 100644 index fe76ab5299cda..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/85_fields_meta.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -"Metadata Fields": - - - skip: - version: "all" - reason: "Update doesn't return metadata fields, waiting for #3259" - - - do: - indices.create: - index: test_1 - - - do: - update: - index: test_1 - id: 1 - parent: 5 - fields: [ _routing ] - body: - doc: { foo: baz } - upsert: { foo: bar } - - - match: { get._routing: "5" } - - - do: - get: - index: test_1 - id: 1 - parent: 5 - stored_fields: [ _routing ] - - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/86_fields_meta_with_types.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/86_fields_meta_with_types.yml deleted file mode 100644 index f7791d0986399..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/86_fields_meta_with_types.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -"Metadata Fields": - - - skip: - version: "all" - reason: "Update doesn't return metadata fields, waiting for #3259" - - - do: - indices.create: - index: test_1 - - - do: - update: - index: test_1 - type: test - id: 1 - parent: 5 - fields: [ _routing ] - body: - doc: { foo: baz } - upsert: { foo: bar } - - - match: { get._routing: "5" } - - - do: - get: - index: test_1 - type: test - id: 1 - parent: 5 - stored_fields: [ _routing ] - - diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/90_error.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/90_error.yml deleted file mode 100644 index 9a48d24783b44..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/90_error.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -'Misspelled fields get "did you mean"': - - skip: - version: " - 7.5.99" - reason: Implemented in 7.6 - - do: - catch: /\[UpdateRequest\] unknown field \[dac\] did you mean \[doc\]\?/ - update: - index: test - id: 1 - body: - dac: { foo: baz } - upsert: { foo: bar } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/90_mix_typeless_typeful.yml b/rest-api-spec/out/production/resources/rest-api-spec/test/update/90_mix_typeless_typeful.yml deleted file mode 100644 index 0ca25e8598c24..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/90_mix_typeless_typeful.yml +++ /dev/null @@ -1,86 +0,0 @@ ---- -"Update with typeless API on an index that has types": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - - do: - index: - index: index - type: not_doc - id: 1 - body: { foo: bar } - - - do: - update: - index: index - id: 1 - body: - doc: - foo: baz - - - do: - get: - index: index - type: not_doc - id: 1 - - - match: { _source.foo: baz } - ---- -"Update call that introduces new field mappings": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - - do: - index: - index: index - type: not_doc - id: 1 - body: { foo: bar } - - - do: - update: - index: index - id: 1 - body: - doc: - foo: baz - new_field: value - - do: - get: # using typeful API on purpose - index: index - type: not_doc - id: 1 - - - match: { _index: "index" } - - match: { _type: "not_doc" } - - match: { _id: "1" } - - match: { _version: 2} - - match: { _source.foo: baz } - - match: { _source.new_field: value } diff --git a/rest-api-spec/out/production/resources/rest-api-spec/test/update/TODO.txt b/rest-api-spec/out/production/resources/rest-api-spec/test/update/TODO.txt deleted file mode 100644 index 10d4cc8106ccf..0000000000000 --- a/rest-api-spec/out/production/resources/rest-api-spec/test/update/TODO.txt +++ /dev/null @@ -1,5 +0,0 @@ -Tests missing for: - -# consistency -# retry_on_conflict -# timeout diff --git a/x-pack/plugin/core/out/production/resources/ilm-history-ilm-policy.json b/x-pack/plugin/core/out/production/resources/ilm-history-ilm-policy.json deleted file mode 100644 index febae00bc3608..0000000000000 --- a/x-pack/plugin/core/out/production/resources/ilm-history-ilm-policy.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "phases": { - "hot": { - "actions": { - "rollover": { - "max_size": "50GB", - "max_age": "30d" - } - } - }, - "delete": { - "min_age": "90d", - "actions": { - "delete": {} - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/ilm-history.json b/x-pack/plugin/core/out/production/resources/ilm-history.json deleted file mode 100644 index bb79af74f2034..0000000000000 --- a/x-pack/plugin/core/out/production/resources/ilm-history.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "index_patterns": [ - "ilm-history-${xpack.ilm_history.template.version}*" - ], - "order": 2147483647, - "settings": { - "index.number_of_shards": 1, - "index.number_of_replicas": 0, - "index.auto_expand_replicas": "0-1", - "index.lifecycle.name": "ilm-history-ilm-policy", - "index.lifecycle.rollover_alias": "ilm-history-${xpack.ilm_history.template.version}", - "index.hidden": true, - "index.format": 1 - }, - "mappings": { - "_doc": { - "dynamic": false, - "properties": { - "@timestamp": { - "type": "date", - "format": "epoch_millis" - }, - "policy": { - "type": "keyword" - }, - "index": { - "type": "keyword" - }, - "index_age":{ - "type": "long" - }, - "success": { - "type": "boolean" - }, - "state": { - "type": "object", - "dynamic": true, - "properties": { - "phase": { - "type": "keyword" - }, - "action": { - "type": "keyword" - }, - "step": { - "type": "keyword" - }, - "failed_step": { - "type": "keyword" - }, - "is_auto-retryable_error": { - "type": "keyword" - }, - "creation_date": { - "type": "date", - "format": "epoch_millis" - }, - "phase_time": { - "type": "date", - "format": "epoch_millis" - }, - "action_time": { - "type": "date", - "format": "epoch_millis" - }, - "step_time": { - "type": "date", - "format": "epoch_millis" - }, - "phase_definition": { - "type": "text" - }, - "step_info": { - "type": "text" - } - } - }, - "error_details": { - "type": "text" - } - } - } - }, - "version": ${xpack.ilm_history.template.version} -} diff --git a/x-pack/plugin/core/out/production/resources/logstash-management.json b/x-pack/plugin/core/out/production/resources/logstash-management.json deleted file mode 100644 index d9528238dc0fb..0000000000000 --- a/x-pack/plugin/core/out/production/resources/logstash-management.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "index_patterns" : [ ".logstash" ], - "settings": { - "index": { - "number_of_shards": 1, - "auto_expand_replicas": "0-1", - "codec": "best_compression" - } - }, - "mappings" : { - "_doc" : { - "_meta": { - "logstash-version": "${logstash.template.version}" - }, - "dynamic": "strict", - "properties":{ - "description":{ - "type":"text" - }, - "last_modified":{ - "type":"date" - }, - "pipeline_metadata":{ - "properties":{ - "version":{ - "type":"short" - }, - "type":{ - "type":"keyword" - } - } - }, - "pipeline":{ - "type":"text" - }, - "pipeline_settings": { - "dynamic": false, - "type": "object" - }, - "username":{ - "type":"keyword" - }, - "metadata":{ - "type":"object", - "dynamic":false - } - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/monitoring-alerts-7.json b/x-pack/plugin/core/out/production/resources/monitoring-alerts-7.json deleted file mode 100644 index f458ae6ad85ff..0000000000000 --- a/x-pack/plugin/core/out/production/resources/monitoring-alerts-7.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "index_patterns": [ ".monitoring-alerts-${monitoring.template.version}" ], - "version": 7000199, - "settings": { - "index": { - "number_of_shards": 1, - "number_of_replicas": 0, - "auto_expand_replicas": "0-1", - "format": 7, - "codec": "best_compression" - } - }, - "mappings": { - "_doc": { - "dynamic": false, - "properties": { - "timestamp": { - "type": "date" - }, - "update_timestamp": { - "type": "date" - }, - "resolved_timestamp": { - "type": "date" - }, - "prefix": { - "type": "text" - }, - "message": { - "type": "text" - }, - "suffix": { - "type": "text" - }, - "metadata": { - "properties": { - "cluster_uuid": { - "type": "keyword" - }, - "link": { - "type": "keyword" - }, - "severity": { - "type": "short" - }, - "type": { - "type": "keyword" - }, - "version": { - "type": "keyword" - }, - "watch": { - "type": "keyword" - } - } - } - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/monitoring-beats.json b/x-pack/plugin/core/out/production/resources/monitoring-beats.json deleted file mode 100644 index 2f9bc84238ee9..0000000000000 --- a/x-pack/plugin/core/out/production/resources/monitoring-beats.json +++ /dev/null @@ -1,719 +0,0 @@ -{ - "index_patterns": [ - ".monitoring-beats-${monitoring.template.version}-*" - ], - "settings": { - "index.auto_expand_replicas": "0-1", - "index.codec": "best_compression", - "index.format": 7, - "index.number_of_replicas": 0, - "index.number_of_shards": 1 - }, - "version": 7000199, - "mappings": { - "_doc": { - "dynamic": false, - "properties": { - "beats_state": { - "properties": { - "beat": { - "properties": { - "host": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - }, - "uuid": { - "type": "keyword" - }, - "version": { - "type": "keyword" - } - } - }, - "state": { - "properties": { - "beat": { - "properties": { - "name": { - "type": "keyword" - } - } - }, - "host": { - "properties": { - "architecture": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "hostname": { - "type": "keyword" - }, - "os": { - "properties": { - "build": { - "type": "keyword" - }, - "family": { - "type": "keyword" - }, - "platform": { - "type": "keyword" - }, - "version": { - "type": "keyword" - } - } - } - } - }, - "input": { - "properties": { - "count": { - "type": "long" - }, - "names": { - "type": "keyword" - } - } - }, - "module": { - "properties": { - "count": { - "type": "long" - }, - "names": { - "type": "keyword" - } - } - }, - "output": { - "properties": { - "name": { - "type": "keyword" - } - } - }, - "service": { - "properties": { - "id": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "version": { - "type": "keyword" - } - } - } - } - }, - "timestamp": { - "format": "date_time", - "type": "date" - } - } - }, - "beats_stats": { - "properties": { - "beat": { - "properties": { - "host": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - }, - "uuid": { - "type": "keyword" - }, - "version": { - "type": "keyword" - } - } - }, - "metrics": { - "properties": { - "beat": { - "properties": { - "cpu": { - "properties": { - "system": { - "properties": { - "ticks": { - "type": "long" - }, - "time": { - "properties": { - "ms": { - "type": "long" - } - } - } - } - }, - "total": { - "properties": { - "value": { - "type": "long" - }, - "ticks": { - "type": "long" - }, - "time": { - "properties": { - "ms": { - "type": "long" - } - } - } - } - }, - "user": { - "properties": { - "ticks": { - "type": "long" - }, - "time": { - "properties": { - "ms": { - "type": "long" - } - } - } - } - } - } - }, - "info": { - "properties": { - "ephemeral_id": { - "type": "keyword" - }, - "uptime": { - "properties": { - "ms": { - "type": "long" - } - } - } - } - }, - "memstats": { - "properties": { - "gc_next": { - "type": "long" - }, - "memory_alloc": { - "type": "long" - }, - "memory_total": { - "type": "long" - }, - "rss": { - "type": "long" - } - } - }, - "handles": { - "properties": { - "open": { - "type": "long" - }, - "limit": { - "properties": { - "hard": { - "type": "long" - }, - "soft": { - "type": "long" - } - } - } - } - } - } - }, - "apm-server": { - "properties": { - "server": { - "properties": { - "request": { - "properties": { - "count": { - "type": "long" - } - } - }, - "concurrent": { - "properties": { - "wait": { - "properties": { - "ms": { - "type": "long" - } - } - } - } - }, - "response": { - "properties": { - "count": { - "type": "long" - }, - "errors": { - "properties": { - "count": { - "type": "long" - }, - "toolarge": { - "type": "long" - }, - "validate": { - "type": "long" - }, - "ratelimit": { - "type": "long" - }, - "queue": { - "type": "long" - }, - "closed": { - "type": "long" - }, - "forbidden": { - "type": "long" - }, - "concurrency": { - "type": "long" - }, - "unauthorized": { - "type": "long" - }, - "internal": { - "type": "long" - }, - "decode": { - "type": "long" - }, - "method": { - "type": "long" - } - } - }, - "valid": { - "properties": { - "ok": { - "type": "long" - }, - "accepted": { - "type": "long" - }, - "count": { - "type": "long" - } - } - } - } - } - } - }, - "decoder": { - "properties": { - "deflate": { - "properties": { - "content-length": { - "type": "long" - }, - "count": { - "type": "long" - } - } - }, - "gzip": { - "properties": { - "content-length": { - "type": "long" - }, - "count": { - "type": "long" - } - } - }, - "uncompressed": { - "properties": { - "content-length": { - "type": "long" - }, - "count": { - "type": "long" - } - } - }, - "reader": { - "properties": { - "size": { - "type": "long" - }, - "count": { - "type": "long" - } - } - }, - "missing-content-length": { - "properties": { - "count": { - "type": "long" - } - } - } - } - - }, - "processor": { - "properties": { - "metric": { - "properties": { - "decoding": { - "properties": { - "errors": { - "type": "long" - }, - "count": { - "type": "long" - } - } - }, - "validation": { - "properties": { - "errors": { - "type": "long" - }, - "count": { - "type": "long" - } - } - }, - "transformations": { - "type": "long" - } - } - }, - "sourcemap": { - "properties": { - "counter": { - "type": "long" - }, - "decoding": { - "properties": { - "errors": { - "type": "long" - }, - "count": { - "type": "long" - } - } - }, - "validation": { - "properties": { - "errors": { - "type": "long" - }, - "count": { - "type": "long" - } - } - } - } - }, - "transaction": { - "properties": { - "decoding": { - "properties": { - "errors": { - "type": "long" - }, - "count": { - "type": "long" - } - } - }, - "validation": { - "properties": { - "errors": { - "type": "long" - }, - "count": { - "type": "long" - } - } - }, - "transformations": { - "type": "long" - }, - "transactions": { - "type": "long" - }, - "spans": { - "type": "long" - }, - "stacktraces": { - "type": "long" - }, - "frames": { - "type": "long" - } - } - }, - "error": { - "properties": { - "decoding": { - "properties": { - "errors": { - "type": "long" - }, - "count": { - "type": "long" - } - } - }, - "validation": { - "properties": { - "errors": { - "type": "long" - }, - "count": { - "type": "long" - } - } - }, - "transformations": { - "type": "long" - }, - "errors": { - "type": "long" - }, - "stacktraces": { - "type": "long" - }, - "frames": { - "type": "long" - } - } - }, - "span": { - "properties": { - "transformations": { - "type": "long" - } - } - } - } - } - } - }, - "libbeat": { - "properties": { - "config": { - "properties": { - "module": { - "properties": { - "running": { - "type": "long" - }, - "starts": { - "type": "long" - }, - "stops": { - "type": "long" - } - } - }, - "reloads": { - "type": "long" - } - } - }, - "output": { - "properties": { - "events": { - "properties": { - "acked": { - "type": "long" - }, - "active": { - "type": "long" - }, - "batches": { - "type": "long" - }, - "dropped": { - "type": "long" - }, - "duplicates": { - "type": "long" - }, - "failed": { - "type": "long" - }, - "total": { - "type": "long" - }, - "toomany": { - "type": "long" - } - } - }, - "read": { - "properties": { - "bytes": { - "type": "long" - }, - "errors": { - "type": "long" - } - } - }, - "type": { - "type": "keyword" - }, - "write": { - "properties": { - "bytes": { - "type": "long" - }, - "errors": { - "type": "long" - } - } - } - } - }, - "pipeline": { - "properties": { - "clients": { - "type": "long" - }, - "events": { - "properties": { - "active": { - "type": "long" - }, - "dropped": { - "type": "long" - }, - "failed": { - "type": "long" - }, - "filtered": { - "type": "long" - }, - "published": { - "type": "long" - }, - "retry": { - "type": "long" - }, - "total": { - "type": "long" - } - } - }, - "queue": { - "properties": { - "acked": { - "type": "long" - } - } - } - } - } - } - }, - "system": { - "properties": { - "load": { - "properties": { - "1": { - "type": "double" - }, - "15": { - "type": "double" - }, - "5": { - "type": "double" - }, - "norm": { - "properties": { - "1": { - "type": "double" - }, - "15": { - "type": "double" - }, - "5": { - "type": "double" - } - } - } - } - } - } - } - } - }, - "tags": { - "type": "keyword" - }, - "timestamp": { - "format": "date_time", - "type": "date" - } - } - }, - "cluster_uuid": { - "type": "keyword" - }, - "interval_ms": { - "type": "long" - }, - "source_node": { - "properties": { - "host": { - "type": "keyword" - }, - "ip": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "transport_address": { - "type": "keyword" - }, - "uuid": { - "type": "keyword" - } - } - }, - "timestamp": { - "format": "date_time", - "type": "date" - }, - "type": { - "type": "keyword" - } - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/monitoring-es.json b/x-pack/plugin/core/out/production/resources/monitoring-es.json deleted file mode 100644 index fb7d2d7764a90..0000000000000 --- a/x-pack/plugin/core/out/production/resources/monitoring-es.json +++ /dev/null @@ -1,1156 +0,0 @@ -{ - "index_patterns": [ ".monitoring-es-${monitoring.template.version}-*" ], - "version": 7000199, - "settings": { - "index.number_of_shards": 1, - "index.number_of_replicas": 0, - "index.auto_expand_replicas": "0-1", - "index.format": 7, - "index.codec": "best_compression" - }, - "mappings": { - "_doc": { - "date_detection": false, - "dynamic": false, - "properties": { - "cluster_uuid": { - "type": "keyword" - }, - "state_uuid": { - "type": "keyword" - }, - "timestamp": { - "type": "date", - "format": "date_time" - }, - "interval_ms": { - "type": "long" - }, - "type": { - "type": "keyword" - }, - "source_node": { - "properties": { - "uuid": { - "type": "keyword" - }, - "host": { - "type": "keyword" - }, - "transport_address": { - "type": "keyword" - }, - "ip": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "timestamp": { - "type": "date", - "format": "date_time" - } - } - }, - "indices_stats": { - "properties": { - "_all": { - "properties": { - "primaries": { - "properties": { - "docs": { - "properties": { - "count": { - "type": "long" - } - } - }, - "indexing": { - "properties": { - "index_total": { - "type": "long" - }, - "index_time_in_millis": { - "type": "long" - } - } - }, - "search": { - "properties": { - "query_total": { - "type": "long" - }, - "query_time_in_millis": { - "type": "long" - } - } - } - } - }, - "total": { - "properties": { - "docs": { - "properties": { - "count": { - "type": "long" - } - } - }, - "indexing": { - "properties": { - "index_total": { - "type": "long" - }, - "index_time_in_millis": { - "type": "long" - } - } - }, - "search": { - "properties": { - "query_total": { - "type": "long" - }, - "query_time_in_millis": { - "type": "long" - } - } - } - } - } - } - } - } - }, - "index_stats": { - "properties": { - "index": { - "type": "keyword" - }, - "primaries": { - "properties": { - "docs": { - "properties": { - "count": { - "type": "long" - } - } - }, - "fielddata" : { - "properties": { - "memory_size_in_bytes": { - "type": "long" - }, - "evictions": { - "type": "long" - } - } - }, - "store": { - "properties": { - "size_in_bytes": { - "type": "long" - } - } - }, - "indexing": { - "properties": { - "index_total": { - "type": "long" - }, - "index_time_in_millis": { - "type": "long" - }, - "throttle_time_in_millis": { - "type": "long" - } - } - }, - "merges": { - "properties": { - "total_size_in_bytes": { - "type": "long" - } - } - }, - "query_cache": { - "properties": { - "memory_size_in_bytes": { - "type": "long" - }, - "evictions": { - "type": "long" - }, - "hit_count": { - "type": "long" - }, - "miss_count": { - "type": "long" - } - } - }, - "request_cache": { - "properties": { - "memory_size_in_bytes": { - "type": "long" - }, - "evictions": { - "type": "long" - }, - "hit_count": { - "type": "long" - }, - "miss_count": { - "type": "long" - } - } - }, - "search": { - "properties": { - "query_total": { - "type": "long" - }, - "query_time_in_millis": { - "type": "long" - } - } - }, - "segments": { - "properties": { - "count": { - "type": "integer" - }, - "memory_in_bytes": { - "type": "long" - }, - "terms_memory_in_bytes": { - "type": "long" - }, - "points_memory_in_bytes": { - "type": "long" - }, - "stored_fields_memory_in_bytes": { - "type": "long" - }, - "term_vectors_memory_in_bytes": { - "type": "long" - }, - "norms_memory_in_bytes": { - "type": "long" - }, - "doc_values_memory_in_bytes": { - "type": "long" - }, - "index_writer_memory_in_bytes": { - "type": "long" - }, - "version_map_memory_in_bytes": { - "type": "long" - }, - "fixed_bit_set_memory_in_bytes": { - "type": "long" - } - } - }, - "refresh": { - "properties": { - "total_time_in_millis": { - "type": "long" - } - } - } - } - }, - "total": { - "properties": { - "docs": { - "properties": { - "count": { - "type": "long" - } - } - }, - "fielddata" : { - "properties": { - "memory_size_in_bytes": { - "type": "long" - }, - "evictions": { - "type": "long" - } - } - }, - "store": { - "properties": { - "size_in_bytes": { - "type": "long" - } - } - }, - "indexing": { - "properties": { - "index_total": { - "type": "long" - }, - "index_time_in_millis": { - "type": "long" - }, - "throttle_time_in_millis": { - "type": "long" - } - } - }, - "merges": { - "properties": { - "total_size_in_bytes": { - "type": "long" - } - } - }, - "query_cache": { - "properties": { - "memory_size_in_bytes": { - "type": "long" - }, - "evictions": { - "type": "long" - }, - "hit_count": { - "type": "long" - }, - "miss_count": { - "type": "long" - } - } - }, - "request_cache": { - "properties": { - "memory_size_in_bytes": { - "type": "long" - }, - "evictions": { - "type": "long" - }, - "hit_count": { - "type": "long" - }, - "miss_count": { - "type": "long" - } - } - }, - "search": { - "properties": { - "query_total": { - "type": "long" - }, - "query_time_in_millis": { - "type": "long" - } - } - }, - "segments": { - "properties": { - "count": { - "type": "integer" - }, - "memory_in_bytes": { - "type": "long" - }, - "terms_memory_in_bytes": { - "type": "long" - }, - "points_memory_in_bytes": { - "type": "long" - }, - "stored_fields_memory_in_bytes": { - "type": "long" - }, - "term_vectors_memory_in_bytes": { - "type": "long" - }, - "norms_memory_in_bytes": { - "type": "long" - }, - "doc_values_memory_in_bytes": { - "type": "long" - }, - "index_writer_memory_in_bytes": { - "type": "long" - }, - "version_map_memory_in_bytes": { - "type": "long" - }, - "fixed_bit_set_memory_in_bytes": { - "type": "long" - } - } - }, - "refresh": { - "properties": { - "total_time_in_millis": { - "type": "long" - } - } - } - } - } - } - }, - "cluster_stats": { - "properties": { - "nodes": { - "type": "object" - }, - "indices": { - "type": "object" - } - } - }, - "cluster_state": { - "properties": { - "version": { - "type": "long" - }, - "nodes_hash": { - "type": "integer" - }, - "master_node": { - "type": "keyword" - }, - "state_uuid": { - "type": "keyword" - }, - "status": { - "type": "keyword" - }, - "nodes": { - "type": "object" - }, - "shards": { - "type": "object" - } - } - }, - "node_stats": { - "properties": { - "node_id": { - "type": "keyword" - }, - "node_master": { - "type": "boolean" - }, - "mlockall": { - "type": "boolean" - }, - "indices": { - "properties": { - "docs": { - "properties": { - "count": { - "type": "long" - } - } - }, - "fielddata" : { - "properties": { - "memory_size_in_bytes": { - "type": "long" - }, - "evictions": { - "type": "long" - } - } - }, - "indexing": { - "properties": { - "index_time_in_millis": { - "type": "long" - }, - "index_total": { - "type": "long" - }, - "throttle_time_in_millis": { - "type": "long" - } - } - }, - "query_cache": { - "properties": { - "memory_size_in_bytes": { - "type": "long" - }, - "evictions": { - "type": "long" - }, - "hit_count": { - "type": "long" - }, - "miss_count": { - "type": "long" - } - } - }, - "request_cache": { - "properties": { - "memory_size_in_bytes": { - "type": "long" - }, - "evictions": { - "type": "long" - }, - "hit_count": { - "type": "long" - }, - "miss_count": { - "type": "long" - } - } - }, - "search": { - "properties": { - "query_time_in_millis": { - "type": "long" - }, - "query_total": { - "type": "long" - } - } - }, - "segments": { - "properties": { - "count": { - "type": "integer" - }, - "memory_in_bytes": { - "type": "long" - }, - "terms_memory_in_bytes": { - "type": "long" - }, - "points_memory_in_bytes": { - "type": "long" - }, - "stored_fields_memory_in_bytes": { - "type": "long" - }, - "term_vectors_memory_in_bytes": { - "type": "long" - }, - "norms_memory_in_bytes": { - "type": "long" - }, - "doc_values_memory_in_bytes": { - "type": "long" - }, - "index_writer_memory_in_bytes": { - "type": "long" - }, - "version_map_memory_in_bytes": { - "type": "long" - }, - "fixed_bit_set_memory_in_bytes": { - "type": "long" - } - } - }, - "store": { - "properties": { - "size_in_bytes": { - "type": "long" - } - } - } - } - }, - "fs": { - "properties": { - "total": { - "properties": { - "total_in_bytes": { - "type": "long" - }, - "free_in_bytes": { - "type": "long" - }, - "available_in_bytes": { - "type": "long" - } - } - }, - "data": { - "properties": { - "spins": { - "type": "boolean" - } - } - }, - "io_stats": { - "properties": { - "total": { - "properties": { - "operations": { - "type": "long" - }, - "read_operations": { - "type": "long" - }, - "write_operations": { - "type": "long" - }, - "read_kilobytes": { - "type": "long" - }, - "write_kilobytes": { - "type": "long" - } - } - } - } - } - } - }, - "os": { - "properties": { - "cgroup": { - "properties": { - "cpuacct": { - "properties": { - "control_group": { - "type": "keyword" - }, - "usage_nanos": { - "type": "long" - } - } - }, - "cpu": { - "properties": { - "cfs_quota_micros": { - "type": "long" - }, - "control_group": { - "type": "keyword" - }, - "stat": { - "properties": { - "number_of_elapsed_periods": { - "type": "long" - }, - "number_of_times_throttled": { - "type": "long" - }, - "time_throttled_nanos": { - "type": "long" - } - } - } - } - }, - "memory": { - "properties": { - "control_group": { - "type": "keyword" - }, - "limit_in_bytes": { - "type": "keyword" - }, - "usage_in_bytes": { - "type": "keyword" - } - } - } - } - }, - "cpu": { - "properties": { - "load_average": { - "properties": { - "1m": { - "type": "half_float" - }, - "5m": { - "type": "half_float" - }, - "15m": { - "type": "half_float" - } - } - } - } - } - } - }, - "process": { - "properties": { - "open_file_descriptors": { - "type": "long" - }, - "max_file_descriptors": { - "type": "long" - }, - "cpu": { - "properties": { - "percent": { - "type": "half_float" - } - } - } - } - }, - "jvm": { - "properties": { - "mem": { - "properties": { - "heap_used_in_bytes": { - "type": "long" - }, - "heap_used_percent": { - "type": "half_float" - }, - "heap_max_in_bytes": { - "type": "long" - } - } - }, - "gc": { - "properties": { - "collectors": { - "properties": { - "young": { - "properties": { - "collection_count": { - "type": "long" - }, - "collection_time_in_millis": { - "type": "long" - } - } - }, - "old": { - "properties": { - "collection_count": { - "type": "long" - }, - "collection_time_in_millis": { - "type": "long" - } - } - } - } - } - } - } - } - }, - "thread_pool": { - "properties": { - "bulk": { - "properties": { - "threads": { - "type": "integer" - }, - "queue": { - "type": "integer" - }, - "rejected": { - "type": "long" - } - } - }, - "generic": { - "properties": { - "threads": { - "type": "integer" - }, - "queue": { - "type": "integer" - }, - "rejected": { - "type": "long" - } - } - }, - "get": { - "properties": { - "threads": { - "type": "integer" - }, - "queue": { - "type": "integer" - }, - "rejected": { - "type": "long" - } - } - }, - "index": { - "properties": { - "threads": { - "type": "integer" - }, - "queue": { - "type": "integer" - }, - "rejected": { - "type": "long" - } - } - }, - "management": { - "properties": { - "threads": { - "type": "integer" - }, - "queue": { - "type": "integer" - }, - "rejected": { - "type": "long" - } - } - }, - "search": { - "properties": { - "threads": { - "type": "integer" - }, - "queue": { - "type": "integer" - }, - "rejected": { - "type": "long" - } - } - }, - "watcher": { - "properties": { - "threads": { - "type": "integer" - }, - "queue": { - "type": "integer" - }, - "rejected": { - "type": "long" - } - } - }, - "write": { - "properties": { - "queue": { - "type": "integer" - }, - "rejected": { - "type": "long" - } - } - } - } - } - } - }, - "index_recovery": { - "type": "object" - }, - "shard": { - "properties": { - "state": { - "type": "keyword" - }, - "primary": { - "type": "boolean" - }, - "index": { - "type": "keyword" - }, - "relocating_node": { - "type": "keyword" - }, - "shard": { - "type": "long" - }, - "node": { - "type": "keyword" - } - } - }, - "job_stats": { - "properties": { - "job_id": { - "type": "keyword" - }, - "state": { - "type": "keyword" - }, - "data_counts": { - "properties": { - "input_bytes": { - "type": "long" - }, - "processed_record_count": { - "type": "long" - }, - "empty_bucket_count": { - "type": "long" - }, - "sparse_bucket_count": { - "type": "long" - }, - "bucket_count": { - "type": "long" - }, - "earliest_record_timestamp": { - "type": "date" - }, - "latest_record_timestamp": { - "type": "date" - } - } - }, - "model_size_stats": { - "properties": { - "model_bytes": { - "type": "long" - }, - "bucket_allocation_failures_count": { - "type": "long" - } - } - }, - "node": { - "properties": { - "id": { - "type": "keyword" - } - } - } - } - }, - "ccr_stats": { - "properties": { - "remote_cluster": { - "type": "keyword" - }, - "leader_index": { - "type": "keyword" - }, - "follower_index": { - "type": "keyword" - }, - "shard_id": { - "type": "integer" - }, - "leader_global_checkpoint": { - "type": "long" - }, - "leader_max_seq_no": { - "type": "long" - }, - "follower_global_checkpoint": { - "type": "long" - }, - "follower_max_seq_no": { - "type": "long" - }, - "last_requested_seq_no": { - "type": "long" - }, - "outstanding_read_requests": { - "type": "long" - }, - "outstanding_write_requests": { - "type": "long" - }, - "write_buffer_operation_count": { - "type": "long" - }, - "write_buffer_size_in_bytes": { - "type": "long" - }, - "follower_mapping_version": { - "type": "long" - }, - "follower_settings_version": { - "type": "long" - }, - "follower_aliases_version": { - "type": "long" - }, - "total_read_time_millis": { - "type": "long" - }, - "total_read_remote_exec_time_millis": { - "type": "long" - }, - "successful_read_requests": { - "type": "long" - }, - "failed_read_requests": { - "type": "long" - }, - "operations_read": { - "type": "long" - }, - "bytes_read": { - "type": "long" - }, - "total_write_time_millis": { - "type": "long" - }, - "successful_write_requests": { - "type": "long" - }, - "failed_write_requests": { - "type": "long" - }, - "operations_written": { - "type": "long" - }, - "read_exceptions": { - "type": "nested", - "properties": { - "from_seq_no": { - "type": "long" - }, - "retries": { - "type": "integer" - }, - "exception": { - "type": "object", - "properties": { - "type" : { - "type": "keyword" - }, - "reason": { - "type": "text" - } - } - } - } - }, - "time_since_last_read_millis": { - "type": "long" - }, - "fatal_exception": { - "type": "object", - "properties": { - "type" : { - "type": "keyword" - }, - "reason": { - "type": "text" - } - } - } - } - }, - "ccr_auto_follow_stats" : { - "properties": { - "number_of_failed_follow_indices": { - "type": "long" - }, - "number_of_failed_remote_cluster_state_requests": { - "type": "long" - }, - "number_of_successful_follow_indices": { - "type": "long" - }, - "recent_auto_follow_errors": { - "type": "nested", - "properties": { - "leader_index": { - "type": "keyword" - }, - "timestamp": { - "type": "long" - }, - "auto_follow_exception": { - "type": "object", - "properties": { - "type": { - "type": "keyword" - }, - "reason": { - "type": "text" - } - } - } - } - }, - "auto_followed_clusters": { - "type": "nested", - "properties": { - "cluster_name": { - "type": "keyword" - }, - "time_since_last_check_millis": { - "type": "long" - }, - "last_seen_metadata_version": { - "type": "long" - } - } - } - } - }, - "enrich_coordinator_stats" : { - "properties": { - "node_id": { - "type": "keyword" - }, - "queue_size": { - "type": "integer" - }, - "remote_requests_current" : { - "type": "long" - }, - "remote_requests_total" : { - "type": "long" - }, - "executed_searches_total" : { - "type": "long" - } - } - }, - "enrich_executing_policy_stats": { - "properties": { - "name": { - "type": "keyword" - }, - "task": { - "type": "object", - "properties": { - "node": { - "type": "keyword" - }, - "id": { - "type": "long" - }, - "type": { - "type": "keyword" - }, - "action": { - "type": "keyword" - }, - "description": { - "type": "keyword" - }, - "start_time_in_millis": { - "type": "date", - "format": "epoch_millis" - }, - "running_time_in_nanos": { - "type": "long" - }, - "cancellable": { - "type": "boolean" - } - } - } - } - } - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/monitoring-kibana.json b/x-pack/plugin/core/out/production/resources/monitoring-kibana.json deleted file mode 100644 index 6ae61f6d6c64b..0000000000000 --- a/x-pack/plugin/core/out/production/resources/monitoring-kibana.json +++ /dev/null @@ -1,232 +0,0 @@ -{ - "index_patterns": [ ".monitoring-kibana-${monitoring.template.version}-*" ], - "version": 7000199, - "settings": { - "index.number_of_shards": 1, - "index.number_of_replicas": 0, - "index.auto_expand_replicas": "0-1", - "index.format": 7, - "index.codec": "best_compression" - }, - "mappings": { - "_doc": { - "dynamic": false, - "properties": { - "cluster_uuid": { - "type": "keyword" - }, - "timestamp": { - "type": "date", - "format": "date_time" - }, - "interval_ms": { - "type": "long" - }, - "type": { - "type": "keyword" - }, - "source_node": { - "properties": { - "uuid": { - "type": "keyword" - }, - "host": { - "type": "keyword" - }, - "transport_address": { - "type": "keyword" - }, - "ip": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "timestamp": { - "type": "date", - "format": "date_time" - } - } - }, - "kibana_stats": { - "properties": { - "usage": { - "properties": { - "index": { - "type": "keyword" - } - } - }, - "kibana": { - "properties": { - "uuid": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "host": { - "type": "keyword" - }, - "transport_address": { - "type": "keyword" - }, - "version": { - "type": "keyword" - }, - "snapshot": { - "type": "boolean" - }, - "status": { - "type": "keyword" - }, - "statuses": { - "properties": { - "name": { - "type": "keyword" - }, - "state": { - "type": "keyword" - } - } - } - } - }, - "cloud": { - "properties": { - "name": { - "type": "keyword" - }, - "id": { - "type": "keyword" - }, - "vm_type": { - "type": "keyword" - }, - "region": { - "type": "keyword" - }, - "zone": { - "type": "keyword" - }, - "metadata": { - "type": "object" - } - } - }, - "os": { - "properties": { - "load": { - "properties": { - "1m": { - "type": "half_float" - }, - "5m": { - "type": "half_float" - }, - "15m": { - "type": "half_float" - } - } - }, - "memory": { - "properties": { - "total_in_bytes": { - "type": "float" - }, - "free_in_bytes": { - "type": "float" - }, - "used_in_bytes": { - "type": "float" - } - } - }, - "uptime_in_millis": { - "type": "long" - } - } - }, - "process": { - "properties": { - "memory": { - "properties": { - "heap": { - "properties": { - "total_in_bytes": { - "type": "float" - }, - "used_in_bytes": { - "type": "float" - }, - "size_limit": { - "type": "float" - } - } - }, - "resident_set_size_in_bytes": { - "type": "float" - } - } - }, - "event_loop_delay": { - "type": "float" - }, - "uptime_in_millis": { - "type": "long" - } - } - }, - "sockets": { - "properties": { - "http": { - "properties": { - "total": { - "type": "long" - } - } - }, - "https": { - "properties": { - "total": { - "type": "long" - } - } - } - } - }, - "timestamp": { - "type": "date" - }, - "requests": { - "properties": { - "disconnects": { - "type": "long" - }, - "total": { - "type": "long" - }, - "status_codes": { - "type": "object" - } - } - }, - "response_times": { - "properties": { - "average": { - "type": "float" - }, - "max": { - "type": "float" - } - } - }, - "concurrent_connections": { - "type": "long" - } - } - } - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/monitoring-logstash.json b/x-pack/plugin/core/out/production/resources/monitoring-logstash.json deleted file mode 100644 index 40f5b2ca217b6..0000000000000 --- a/x-pack/plugin/core/out/production/resources/monitoring-logstash.json +++ /dev/null @@ -1,412 +0,0 @@ -{ - "index_patterns": [ ".monitoring-logstash-${monitoring.template.version}-*" ], - "version": 7000199, - "settings": { - "index.number_of_shards": 1, - "index.number_of_replicas": 0, - "index.auto_expand_replicas": "0-1", - "index.format": 7, - "index.codec": "best_compression" - }, - "mappings": { - "_doc": { - "dynamic": false, - "properties": { - "cluster_uuid": { - "type": "keyword" - }, - "timestamp": { - "type": "date", - "format": "date_time" - }, - "interval_ms": { - "type": "long" - }, - "type": { - "type": "keyword" - }, - "source_node": { - "properties": { - "uuid": { - "type": "keyword" - }, - "host": { - "type": "keyword" - }, - "transport_address": { - "type": "keyword" - }, - "ip": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "timestamp": { - "type": "date", - "format": "date_time" - } - } - }, - "logstash_stats": { - "type": "object", - "properties": { - "logstash": { - "properties": { - "uuid": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "ephemeral_id": { - "type": "keyword" - }, - "host": { - "type": "keyword" - }, - "http_address": { - "type": "keyword" - }, - "version": { - "type": "keyword" - }, - "snapshot": { - "type": "boolean" - }, - "status": { - "type": "keyword" - }, - "pipeline": { - "properties": { - "workers": { - "type": "short" - }, - "batch_size": { - "type": "long" - } - } - } - } - }, - "events": { - "properties": { - "filtered": { - "type": "long" - }, - "in": { - "type": "long" - }, - "out": { - "type": "long" - }, - "duration_in_millis": { - "type": "long" - } - } - }, - "timestamp": { - "type": "date" - }, - "jvm": { - "properties": { - "uptime_in_millis": { - "type": "long" - }, - "gc": { - "properties": { - "collectors": { - "properties": { - "old": { - "properties": { - "collection_count": { - "type": "long" - }, - "collection_time_in_millis": { - "type": "long" - } - } - }, - "young": { - "properties": { - "collection_count": { - "type": "long" - }, - "collection_time_in_millis": { - "type": "long" - } - } - } - } - } - } - }, - "mem": { - "properties": { - "heap_max_in_bytes": { - "type": "long" - }, - "heap_used_in_bytes": { - "type": "long" - }, - "heap_used_percent": { - "type": "long" - } - } - } - } - }, - "os": { - "properties": { - "cpu": { - "properties": { - "load_average": { - "properties": { - "1m": { - "type": "half_float" - }, - "5m": { - "type": "half_float" - }, - "15m": { - "type": "half_float" - } - } - } - } - }, - "cgroup": { - "properties": { - "cpuacct": { - "properties": { - "control_group": { - "type": "keyword" - }, - "usage_nanos": { - "type": "long" - } - } - }, - "cpu": { - "properties": { - "control_group": { - "type": "keyword" - }, - "stat": { - "properties": { - "number_of_elapsed_periods": { - "type": "long" - }, - "number_of_times_throttled": { - "type": "long" - }, - "time_throttled_nanos": { - "type": "long" - } - } - } - } - } - } - } - } - }, - "process": { - "properties": { - "cpu": { - "properties": { - "percent": { - "type": "long" - } - } - }, - "max_file_descriptors": { - "type": "long" - }, - "open_file_descriptors": { - "type": "long" - } - } - }, - "reloads": { - "properties": { - "failures": { - "type": "long" - }, - "successes": { - "type": "long" - } - } - }, - "queue": { - "properties": { - "events_count": { - "type": "long" - }, - "type": { - "type": "keyword" - } - } - }, - "pipelines": { - "type": "nested", - "properties": { - "id": { - "type": "keyword" - }, - "hash": { - "type": "keyword" - }, - "ephemeral_id": { - "type": "keyword" - }, - "events": { - "properties": { - "in": { - "type": "long" - }, - "filtered": { - "type": "long" - }, - "out": { - "type": "long" - }, - "duration_in_millis":{ - "type": "long" - }, - "queue_push_duration_in_millis": { - "type": "long" - } - } - }, - "queue": { - "properties": { - "events_count": { - "type": "long" - }, - "type": { - "type": "keyword" - }, - "max_queue_size_in_bytes": { - "type": "long" - }, - "queue_size_in_bytes": { - "type": "long" - } - } - }, - "vertices": { - "type": "nested", - "properties": { - "id": { - "type": "keyword" - }, - "pipeline_ephemeral_id": { "type": "keyword" }, - "events_in": { "type": "long" }, - "events_out": { "type": "long" }, - "duration_in_millis": { "type": "long" }, - "queue_push_duration_in_millis": { "type": "long" }, - "long_counters": { - "type": "nested", - "properties": { - "name": { - "type": "keyword" - }, - "value": { - "type": "long" - } - } - }, - "double_gauges": { - "type": "nested", - "properties": { - "name": { - "type": "keyword" - }, - "value": { - "type": "double" - } - } - } - } - }, - "reloads": { - "properties": { - "failures": { - "type": "long" - }, - "successes": { - "type": "long" - } - } - } - } - }, - "workers": { - "type": "short" - }, - "batch_size": { - "type": "integer" - } - } - }, - "logstash_state": { - "properties": { - "uuid": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "host": { - "type": "keyword" - }, - "http_address": { - "type": "keyword" - }, - "ephemeral_id": { - "type": "keyword" - }, - "version": { - "type": "keyword" - }, - "snapshot": { - "type": "boolean" - }, - "status": { - "type": "keyword" - }, - "pipeline": { - "properties": { - "id": { - "type": "keyword" - }, - "hash": { - "type": "keyword" - }, - "ephemeral_id": { - "type": "keyword" - }, - "workers": { - "type": "short" - }, - "batch_size": { - "type": "integer" - }, - "format": { - "type": "keyword" - }, - "version": { - "type": "keyword" - }, - "representation": { - "enabled": false - } - } - } - } - } - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/annotations_index_mappings.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/annotations_index_mappings.json deleted file mode 100644 index 41c26b0f83d4f..0000000000000 --- a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/annotations_index_mappings.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "_doc": { - "_meta" : { - "version" : "${xpack.ml.version}" - }, - "properties" : { - "annotation" : { - "type" : "text" - }, - "create_time" : { - "type" : "date" - }, - "create_username" : { - "type" : "keyword" - }, - "end_timestamp" : { - "type" : "date" - }, - "job_id" : { - "type" : "keyword" - }, - "modified_time" : { - "type" : "date" - }, - "modified_username" : { - "type" : "keyword" - }, - "timestamp" : { - "type" : "date" - }, - "type" : { - "type" : "keyword" - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_mappings.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_mappings.json deleted file mode 100644 index 8ff990d2e5020..0000000000000 --- a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_mappings.json +++ /dev/null @@ -1,478 +0,0 @@ -{ - "${xpack.ml.mapping_type}" : { - "_meta" : { - "version" : "${xpack.ml.version}" - }, - "dynamic_templates" : [ - { - "strings_as_keywords" : { - "match" : "*", - "mapping" : { - "type" : "keyword" - } - } - } - ], - "properties" : { - "actual" : { - "type" : "double" - }, - "all_field_values" : { - "type" : "text", - "analyzer" : "whitespace" - }, - "anomaly_score" : { - "type" : "double" - }, - "average_bucket_processing_time_ms" : { - "type" : "double" - }, - "bucket_allocation_failures_count" : { - "type" : "long" - }, - "bucket_count" : { - "type" : "long" - }, - "bucket_influencers" : { - "type" : "nested", - "properties" : { - "anomaly_score" : { - "type" : "double" - }, - "bucket_span" : { - "type" : "long" - }, - "influencer_field_name" : { - "type" : "keyword" - }, - "initial_anomaly_score" : { - "type" : "double" - }, - "is_interim" : { - "type" : "boolean" - }, - "job_id" : { - "type" : "keyword" - }, - "probability" : { - "type" : "double" - }, - "raw_anomaly_score" : { - "type" : "double" - }, - "result_type" : { - "type" : "keyword" - }, - "timestamp" : { - "type" : "date" - } - } - }, - "bucket_span" : { - "type" : "long" - }, - "by_field_name" : { - "type" : "keyword" - }, - "by_field_value" : { - "type" : "keyword", - "copy_to" : [ - "all_field_values" - ] - }, - "category_id" : { - "type" : "long" - }, - "causes" : { - "type" : "nested", - "properties" : { - "actual" : { - "type" : "double" - }, - "by_field_name" : { - "type" : "keyword" - }, - "by_field_value" : { - "type" : "keyword", - "copy_to" : [ - "all_field_values" - ] - }, - "correlated_by_field_value" : { - "type" : "keyword", - "copy_to" : [ - "all_field_values" - ] - }, - "field_name" : { - "type" : "keyword" - }, - "function" : { - "type" : "keyword" - }, - "function_description" : { - "type" : "keyword" - }, - "geo_results" : { - "properties" : { - "actual_point" : { - "type" : "geo_point" - }, - "typical_point" : { - "type" : "geo_point" - } - } - }, - "over_field_name" : { - "type" : "keyword" - }, - "over_field_value" : { - "type" : "keyword", - "copy_to" : [ - "all_field_values" - ] - }, - "partition_field_name" : { - "type" : "keyword" - }, - "partition_field_value" : { - "type" : "keyword", - "copy_to" : [ - "all_field_values" - ] - }, - "probability" : { - "type" : "double" - }, - "typical" : { - "type" : "double" - } - } - }, - "description" : { - "type" : "text" - }, - "detector_index" : { - "type" : "integer" - }, - "earliest_record_timestamp" : { - "type" : "date" - }, - "empty_bucket_count" : { - "type" : "long" - }, - "event_count" : { - "type" : "long" - }, - "examples" : { - "type" : "text" - }, - "exponential_average_bucket_processing_time_ms" : { - "type" : "double" - }, - "exponential_average_calculation_context" : { - "properties" : { - "incremental_metric_value_ms" : { - "type" : "double" - }, - "latest_timestamp" : { - "type" : "date" - }, - "previous_exponential_average_ms" : { - "type" : "double" - } - } - }, - "field_name" : { - "type" : "keyword" - }, - "forecast_create_timestamp" : { - "type" : "date" - }, - "forecast_end_timestamp" : { - "type" : "date" - }, - "forecast_expiry_timestamp" : { - "type" : "date" - }, - "forecast_id" : { - "type" : "keyword" - }, - "forecast_lower" : { - "type" : "double" - }, - "forecast_memory_bytes" : { - "type" : "long" - }, - "forecast_messages" : { - "type" : "keyword" - }, - "forecast_prediction" : { - "type" : "double" - }, - "forecast_progress" : { - "type" : "double" - }, - "forecast_start_timestamp" : { - "type" : "date" - }, - "forecast_status" : { - "type" : "keyword" - }, - "forecast_upper" : { - "type" : "double" - }, - "function" : { - "type" : "keyword" - }, - "function_description" : { - "type" : "keyword" - }, - "geo_results" : { - "properties" : { - "actual_point" : { - "type" : "geo_point" - }, - "typical_point" : { - "type" : "geo_point" - } - } - }, - "influencer_field_name" : { - "type" : "keyword" - }, - "influencer_field_value" : { - "type" : "keyword", - "copy_to" : [ - "all_field_values" - ] - }, - "influencer_score" : { - "type" : "double" - }, - "influencers" : { - "type" : "nested", - "properties" : { - "influencer_field_name" : { - "type" : "keyword" - }, - "influencer_field_values" : { - "type" : "keyword", - "copy_to" : [ - "all_field_values" - ] - } - } - }, - "initial_anomaly_score" : { - "type" : "double" - }, - "initial_influencer_score" : { - "type" : "double" - }, - "initial_record_score" : { - "type" : "double" - }, - "input_bytes" : { - "type" : "long" - }, - "input_field_count" : { - "type" : "long" - }, - "input_record_count" : { - "type" : "long" - }, - "invalid_date_count" : { - "type" : "long" - }, - "is_interim" : { - "type" : "boolean" - }, - "job_id" : { - "type" : "keyword", - "copy_to" : [ - "all_field_values" - ] - }, - "last_data_time" : { - "type" : "date" - }, - "latest_empty_bucket_timestamp" : { - "type" : "date" - }, - "latest_record_time_stamp" : { - "type" : "date" - }, - "latest_record_timestamp" : { - "type" : "date" - }, - "latest_result_time_stamp" : { - "type" : "date" - }, - "latest_sparse_bucket_timestamp" : { - "type" : "date" - }, - "log_time" : { - "type" : "date" - }, - "max_matching_length" : { - "type" : "long" - }, - "maximum_bucket_processing_time_ms" : { - "type" : "double" - }, - "memory_status" : { - "type" : "keyword" - }, - "min_version" : { - "type" : "keyword" - }, - "minimum_bucket_processing_time_ms" : { - "type" : "double" - }, - "missing_field_count" : { - "type" : "long" - }, - "model_bytes" : { - "type" : "long" - }, - "model_feature" : { - "type" : "keyword" - }, - "model_lower" : { - "type" : "double" - }, - "model_median" : { - "type" : "double" - }, - "model_size_stats" : { - "properties" : { - "bucket_allocation_failures_count" : { - "type" : "long" - }, - "job_id" : { - "type" : "keyword" - }, - "log_time" : { - "type" : "date" - }, - "memory_status" : { - "type" : "keyword" - }, - "model_bytes" : { - "type" : "long" - }, - "result_type" : { - "type" : "keyword" - }, - "timestamp" : { - "type" : "date" - }, - "total_by_field_count" : { - "type" : "long" - }, - "total_over_field_count" : { - "type" : "long" - }, - "total_partition_field_count" : { - "type" : "long" - } - } - }, - "model_upper" : { - "type" : "double" - }, - "multi_bucket_impact" : { - "type" : "double" - }, - "out_of_order_timestamp_count" : { - "type" : "long" - }, - "over_field_name" : { - "type" : "keyword" - }, - "over_field_value" : { - "type" : "keyword", - "copy_to" : [ - "all_field_values" - ] - }, - "partition_field_name" : { - "type" : "keyword" - }, - "partition_field_value" : { - "type" : "keyword", - "copy_to" : [ - "all_field_values" - ] - }, - "probability" : { - "type" : "double" - }, - "processed_field_count" : { - "type" : "long" - }, - "processed_record_count" : { - "type" : "long" - }, - "processing_time_ms" : { - "type" : "long" - }, - "quantiles" : { - "type" : "object", - "enabled" : false - }, - "raw_anomaly_score" : { - "type" : "double" - }, - "record_score" : { - "type" : "double" - }, - "regex" : { - "type" : "keyword" - }, - "result_type" : { - "type" : "keyword" - }, - "retain" : { - "type" : "boolean" - }, - "scheduled_events" : { - "type" : "keyword" - }, - "search_count" : { - "type" : "long" - }, - "snapshot_doc_count" : { - "type" : "integer" - }, - "snapshot_id" : { - "type" : "keyword" - }, - "sparse_bucket_count" : { - "type" : "long" - }, - "terms" : { - "type" : "text" - }, - "timestamp" : { - "type" : "date" - }, - "total_by_field_count" : { - "type" : "long" - }, - "total_over_field_count" : { - "type" : "long" - }, - "total_partition_field_count" : { - "type" : "long" - }, - "total_search_time_ms" : { - "type" : "double" - }, - "typical" : { - "type" : "double" - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_template.json deleted file mode 100644 index bccad3e753678..0000000000000 --- a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/results_index_template.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "order" : 0, - "version" : ${xpack.ml.version.id}, - "index_patterns" : [ - ".ml-anomalies-*" - ], - "settings" : { - "index" : { - "translog" : { - "durability" : "async" - }, - "auto_expand_replicas" : "0-1", - "query" : { - "default_field" : "all_field_values" - }, - "hidden": true - } - }, - "mappings": ${xpack.ml.anomalydetection.results.mappings} -} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/state_index_template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/state_index_template.json deleted file mode 100644 index e3cd7f51dc43a..0000000000000 --- a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/anomalydetection/state_index_template.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "order" : 0, - "version" : ${xpack.ml.version.id}, - "index_patterns" : [ - ".ml-state*" - ], - "settings" : { - "index" : { - "auto_expand_replicas" : "0-1", - "hidden": true - } - ${xpack.ml.index.lifecycle.settings} - }, - "mappings" : { - "_doc": { - "_meta": { - "version": "${xpack.ml.version}" - }, - "enabled": false - } - }, - "aliases" : {} -} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_mappings.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_mappings.json deleted file mode 100644 index 0d4444209fe2b..0000000000000 --- a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_mappings.json +++ /dev/null @@ -1,371 +0,0 @@ -{ - "${xpack.ml.mapping_type}" : { - "_meta" : { - "version" : "${xpack.ml.version}" - }, - "dynamic_templates" : [ - { - "strings_as_keywords" : { - "match" : "*", - "mapping" : { - "type" : "keyword" - } - } - } - ], - "properties" : { - "aggregations" : { - "type" : "object", - "enabled" : false - }, - "allow_lazy_open" : { - "type" : "keyword" - }, - "analysis" : { - "properties" : { - "classification" : { - "properties" : { - "dependent_variable" : { - "type" : "keyword" - }, - "eta" : { - "type" : "double" - }, - "feature_bag_fraction" : { - "type" : "double" - }, - "gamma" : { - "type" : "double" - }, - "lambda" : { - "type" : "double" - }, - "max_trees" : { - "type" : "integer" - }, - "class_assignment_objective" : { - "type" : "keyword" - }, - "num_top_classes" : { - "type" : "integer" - }, - "num_top_feature_importance_values" : { - "type" : "integer" - }, - "prediction_field_name" : { - "type" : "keyword" - }, - "training_percent" : { - "type" : "double" - } - } - }, - "outlier_detection" : { - "properties" : { - "feature_influence_threshold" : { - "type" : "double" - }, - "method" : { - "type" : "keyword" - }, - "n_neighbors" : { - "type" : "integer" - } - } - }, - "regression" : { - "properties" : { - "dependent_variable" : { - "type" : "keyword" - }, - "eta" : { - "type" : "double" - }, - "feature_bag_fraction" : { - "type" : "double" - }, - "gamma" : { - "type" : "double" - }, - "lambda" : { - "type" : "double" - }, - "max_trees" : { - "type" : "integer" - }, - "num_top_feature_importance_values" : { - "type" : "integer" - }, - "prediction_field_name" : { - "type" : "keyword" - }, - "training_percent" : { - "type" : "double" - } - } - } - } - }, - "analysis_config" : { - "properties" : { - "bucket_span" : { - "type" : "keyword" - }, - "categorization_analyzer" : { - "type" : "object", - "enabled" : false - }, - "categorization_field_name" : { - "type" : "keyword" - }, - "categorization_filters" : { - "type" : "keyword" - }, - "detectors" : { - "properties" : { - "by_field_name" : { - "type" : "keyword" - }, - "custom_rules" : { - "type" : "nested", - "properties" : { - "actions" : { - "type" : "keyword" - }, - "conditions" : { - "type" : "nested", - "properties" : { - "applies_to" : { - "type" : "keyword" - }, - "operator" : { - "type" : "keyword" - }, - "value" : { - "type" : "double" - } - } - }, - "scope" : { - "type" : "object", - "enabled" : false - } - } - }, - "detector_description" : { - "type" : "text" - }, - "detector_index" : { - "type" : "integer" - }, - "exclude_frequent" : { - "type" : "keyword" - }, - "field_name" : { - "type" : "keyword" - }, - "function" : { - "type" : "keyword" - }, - "over_field_name" : { - "type" : "keyword" - }, - "partition_field_name" : { - "type" : "keyword" - }, - "use_null" : { - "type" : "boolean" - } - } - }, - "influencers" : { - "type" : "keyword" - }, - "latency" : { - "type" : "keyword" - }, - "multivariate_by_fields" : { - "type" : "boolean" - }, - "summary_count_field_name" : { - "type" : "keyword" - } - } - }, - "analysis_limits" : { - "properties" : { - "categorization_examples_limit" : { - "type" : "long" - }, - "model_memory_limit" : { - "type" : "keyword" - } - } - }, - "analyzed_fields" : { - "type" : "object", - "enabled" : false - }, - "background_persist_interval" : { - "type" : "keyword" - }, - "chunking_config" : { - "properties" : { - "mode" : { - "type" : "keyword" - }, - "time_span" : { - "type" : "keyword" - } - } - }, - "config_type" : { - "type" : "keyword" - }, - "create_time" : { - "type" : "date" - }, - "custom_settings" : { - "type" : "object", - "enabled" : false - }, - "data_description" : { - "properties" : { - "field_delimiter" : { - "type" : "keyword" - }, - "format" : { - "type" : "keyword" - }, - "quote_character" : { - "type" : "keyword" - }, - "time_field" : { - "type" : "keyword" - }, - "time_format" : { - "type" : "keyword" - } - } - }, - "datafeed_id" : { - "type" : "keyword" - }, - "delayed_data_check_config" : { - "properties" : { - "check_window" : { - "type" : "keyword" - }, - "enabled" : { - "type" : "boolean" - } - } - }, - "description" : { - "type" : "text" - }, - "dest" : { - "properties" : { - "index" : { - "type" : "keyword" - }, - "results_field" : { - "type" : "keyword" - } - } - }, - "finished_time" : { - "type" : "date" - }, - "frequency" : { - "type" : "keyword" - }, - "groups" : { - "type" : "keyword" - }, - "headers" : { - "type" : "object", - "enabled" : false - }, - "id" : { - "type" : "keyword" - }, - "indices" : { - "type" : "keyword" - }, - "indices_options": { - "type" : "object", - "enabled" : false - }, - "job_id" : { - "type" : "keyword" - }, - "job_type" : { - "type" : "keyword" - }, - "job_version" : { - "type" : "keyword" - }, - "model_plot_config" : { - "properties" : { - "enabled" : { - "type" : "boolean" - }, - "terms" : { - "type" : "keyword" - } - } - }, - "model_snapshot_id" : { - "type" : "keyword" - }, - "model_snapshot_min_version" : { - "type" : "keyword" - }, - "model_snapshot_retention_days" : { - "type" : "long" - }, - "query" : { - "type" : "object", - "enabled" : false - }, - "query_delay" : { - "type" : "keyword" - }, - "renormalization_window_days" : { - "type" : "long" - }, - "results_index_name" : { - "type" : "keyword" - }, - "results_retention_days" : { - "type" : "long" - }, - "script_fields" : { - "type" : "object", - "enabled" : false - }, - "scroll_size" : { - "type" : "long" - }, - "source" : { - "properties" : { - "_source" : { - "type" : "object", - "enabled" : false - }, - "index" : { - "type" : "keyword" - }, - "query" : { - "type" : "object", - "enabled" : false - } - } - }, - "version" : { - "type" : "keyword" - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_template.json deleted file mode 100644 index 8c6c352ab245a..0000000000000 --- a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/config_index_template.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order" : 0, - "version" : ${xpack.ml.version.id}, - "index_patterns" : [ - ".ml-config" - ], - "settings" : { - "index" : { - "max_result_window" : "${xpack.ml.config.max_result_window}", - "number_of_shards" : "1", - "auto_expand_replicas" : "0-1" - } - }, - "mappings": ${xpack.ml.config.mappings} -} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/inference_index_template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/inference_index_template.json deleted file mode 100644 index 2a1131ca557a9..0000000000000 --- a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/inference_index_template.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "order" : 0, - "version" : ${xpack.ml.version.id}, - "index_patterns" : [ - ".ml-inference-000001" - ], - "settings" : { - "index" : { - "number_of_shards" : "1", - "auto_expand_replicas" : "0-1" - } - }, - "mappings" : { - "_doc": { - "_meta": { - "version": "${xpack.ml.version}" - }, - "dynamic": "false", - "properties": { - "doc_type": { - "type": "keyword" - }, - "model_id": { - "type": "keyword" - }, - "created_by": { - "type": "keyword" - }, - "input": { - "enabled": false - }, - "version": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "create_time": { - "type": "date" - }, - "tags": { - "type": "keyword" - }, - "metadata": { - "enabled": false - }, - "estimated_operations": { - "type": "long" - }, - "estimated_heap_memory_usage_bytes": { - "type": "long" - }, - "doc_num": { - "type": "long" - }, - "definition": { - "enabled": false - }, - "compression_version": { - "type": "long" - }, - "definition_length": { - "type": "long" - }, - "total_definition_length": { - "type": "long" - }, - "default_field_map": { - "enabled": false - } - } - } - }, - "aliases" : { } -} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/meta_index_template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/meta_index_template.json deleted file mode 100644 index 19df45c52509c..0000000000000 --- a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/meta_index_template.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "order" : 0, - "version" : ${xpack.ml.version.id}, - "index_patterns" : [ - ".ml-meta" - ], - "settings" : { - "index" : { - "number_of_shards" : "1", - "auto_expand_replicas" : "0-1" - } - }, - "mappings" : { - "_doc": { - "_meta": { - "version": "${xpack.ml.version}" - }, - "dynamic_templates": [ - { - "strings_as_keywords": { - "match": "*", - "mapping": { - "type": "keyword" - } - } - } - ], - "properties": { - "calendar_id": { - "type": "keyword" - }, - "job_ids": { - "type": "keyword" - }, - "description": { - "type": "keyword" - }, - "start_time": { - "type": "date" - }, - "end_time": { - "type": "date" - } - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/notifications_index_template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/notifications_index_template.json deleted file mode 100644 index e8ac3f1fcce6f..0000000000000 --- a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/notifications_index_template.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "order" : 0, - "version" : ${xpack.ml.version.id}, - "index_patterns" : [ - ".ml-notifications-000001" - ], - "settings" : { - "index" : { - "number_of_shards" : "1", - "auto_expand_replicas" : "0-1", - "hidden": true - } - }, - "mappings" : { - "_doc": { - "_meta" : { - "version" : "${xpack.ml.version}" - }, - "dynamic" : "false", - "properties" : { - "job_id": { - "type": "keyword" - }, - "level": { - "type": "keyword" - }, - "message": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "timestamp": { - "type": "date" - }, - "node_name": { - "type": "keyword" - }, - "job_type": { - "type": "keyword" - } - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/size_based_ilm_policy.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/size_based_ilm_policy.json deleted file mode 100644 index 09a8db4e1ee9d..0000000000000 --- a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/size_based_ilm_policy.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "phases": { - "hot": { - "actions": { - "rollover": { - "max_size": "50GB" - } - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_mappings.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_mappings.json deleted file mode 100644 index d30586bebb1f7..0000000000000 --- a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_mappings.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "${xpack.ml.mapping_type}": { - "_meta": { - "version" : "${xpack.ml.version}" - }, - "dynamic": false, - "properties" : { - "iteration": { - "type": "integer" - }, - "hyperparameters": { - "properties": { - "class_assignment_objective": { - "type": "keyword" - }, - "downsample_factor": { - "type": "double" - }, - "eta": { - "type": "double" - }, - "eta_growth_rate_per_tree": { - "type": "double" - }, - "feature_bag_fraction": { - "type": "double" - }, - "max_attempts_to_add_tree": { - "type": "integer" - }, - "max_optimization_rounds_per_hyperparameter": { - "type": "integer" - }, - "max_trees": { - "type": "integer" - }, - "num_folds": { - "type": "integer" - }, - "num_splits_per_feature": { - "type": "integer" - }, - "regularization_depth_penalty_multiplier": { - "type": "double" - }, - "regularization_leaf_weight_penalty_multiplier": { - "type": "double" - }, - "regularization_soft_tree_depth_limit": { - "type": "double" - }, - "regularization_soft_tree_depth_tolerance": { - "type": "double" - }, - "regularization_tree_size_penalty_multiplier": { - "type": "double" - } - } - }, - "job_id" : { - "type" : "keyword" - }, - "parameters": { - "properties": { - "compute_feature_influence": { - "type": "boolean" - }, - "feature_influence_threshold": { - "type": "double" - }, - "method": { - "type": "keyword" - }, - "n_neighbors": { - "type": "integer" - }, - "outlier_fraction": { - "type": "double" - }, - "standardization_enabled": { - "type": "boolean" - } - } - }, - "peak_usage_bytes" : { - "type" : "long" - }, - "skipped_docs_count": { - "type": "long" - }, - "timestamp" : { - "type" : "date" - }, - "timing_stats": { - "properties": { - "elapsed_time": { - "type": "long" - }, - "iteration_time": { - "type": "long" - } - } - }, - "test_docs_count": { - "type": "long" - }, - "training_docs_count": { - "type": "long" - }, - "type" : { - "type" : "keyword" - }, - "validation_loss": { - "properties": { - "fold_values": { - "properties": { - "fold": { - "type": "integer" - }, - "values": { - "type": "double" - } - } - }, - "loss_type": { - "type": "keyword" - } - } - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_template.json deleted file mode 100644 index 223d1a79bad75..0000000000000 --- a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/core/ml/stats_index_template.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "order" : 0, - "version" : ${xpack.ml.version.id}, - "index_patterns" : [ - ".ml-stats-*" - ], - "settings": { - "index" : { - "number_of_shards" : "1", - "auto_expand_replicas" : "0-1", - "hidden": true - } - ${xpack.ml.index.lifecycle.settings} - }, - "mappings" : ${xpack.ml.stats.mappings}, - "aliases" : {} -} diff --git a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/idp/saml-service-provider-template.json b/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/idp/saml-service-provider-template.json deleted file mode 100644 index 8dfbcd246615b..0000000000000 --- a/x-pack/plugin/core/out/production/resources/org/elasticsearch/xpack/idp/saml-service-provider-template.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "index_patterns": [ - "saml-service-provider-*" - ], - "aliases": { - "saml-service-provider": {} - }, - "order": 100, - "settings": { - "number_of_shards": 1, - "number_of_replicas": 0, - "auto_expand_replicas": "0-1", - "index.priority": 10, - "index.refresh_interval": "1s", - "index.format": 1 - }, - "mappings": { - "_doc": { - "_meta": { - "idp-version": "${idp.template.version}" - }, - "dynamic": "strict", - "properties": { - "name": { - "type": "text" - }, - "entity_id": { - "type": "keyword" - }, - "acs": { - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "created": { - "type": "date", - "format": "epoch_millis" - }, - "last_modified": { - "type": "date", - "format": "epoch_millis" - }, - "name_id_format": { - "type": "keyword" - }, - "sign_messages": { - "type": "keyword" - }, - "authn_expiry_ms": { - "type": "long" - }, - "privileges": { - "type": "object", - "properties": { - "resource": { - "type": "keyword" - }, - "roles": { - "type": "object", - "dynamic": false - } - } - }, - "attributes": { - "type": "object", - "properties": { - "principal": { - "type": "keyword" - }, - "email": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "roles": { - "type": "keyword" - } - } - }, - "certificates": { - "type": "object", - "properties": { - "sp_signing": { - "type": "text" - }, - "idp_signing": { - "type": "text" - }, - "idp_metadata": { - "type": "text" - } - } - } - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/security-index-template-7.json b/x-pack/plugin/core/out/production/resources/security-index-template-7.json deleted file mode 100644 index fa3618616c093..0000000000000 --- a/x-pack/plugin/core/out/production/resources/security-index-template-7.json +++ /dev/null @@ -1,289 +0,0 @@ -{ - "index_patterns" : [ ".security-7" ], - "order" : 1000, - "settings" : { - "number_of_shards" : 1, - "number_of_replicas" : 0, - "auto_expand_replicas" : "0-1", - "index.priority": 1000, - "index.refresh_interval": "1s", - "index.format": 6, - "analysis" : { - "filter" : { - "email" : { - "type" : "pattern_capture", - "preserve_original" : true, - "patterns" : [ - "([^@]+)", - "(\\p{L}+)", - "(\\d+)", - "@(.+)" - ] - } - }, - "analyzer" : { - "email" : { - "tokenizer" : "uax_url_email", - "filter" : [ - "email", - "lowercase", - "unique" - ] - } - } - } - }, - "mappings" : { - "_doc" : { - "_meta": { - "security-version": "${security.template.version}" - }, - "dynamic" : "strict", - "properties" : { - "username" : { - "type" : "keyword" - }, - "roles" : { - "type" : "keyword" - }, - "role_templates" : { - "properties": { - "template" : { - "type": "text" - }, - "format" : { - "type": "keyword" - } - } - }, - "password" : { - "type" : "keyword", - "index" : false, - "doc_values": false - }, - "full_name" : { - "type" : "text" - }, - "email" : { - "type" : "text", - "analyzer" : "email" - }, - "metadata" : { - "type" : "object", - "dynamic" : false - }, - "enabled": { - "type": "boolean" - }, - "cluster" : { - "type" : "keyword" - }, - "indices" : { - "type" : "object", - "properties" : { - "field_security" : { - "properties" : { - "grant": { - "type": "keyword" - }, - "except": { - "type": "keyword" - } - } - }, - "names" : { - "type" : "keyword" - }, - "privileges" : { - "type" : "keyword" - }, - "query" : { - "type" : "keyword" - }, - "allow_restricted_indices" : { - "type" : "boolean" - } - } - }, - "applications": { - "type": "object", - "properties": { - "application": { - "type": "keyword" - }, - "privileges": { - "type": "keyword" - }, - "resources": { - "type": "keyword" - } - } - }, - "application" : { - "type" : "keyword" - }, - "global": { - "type": "object", - "properties": { - "application": { - "type": "object", - "properties": { - "manage": { - "type": "object", - "properties": { - "applications": { - "type": "keyword" - } - } - } - } - } - } - }, - "name" : { - "type" : "keyword" - }, - "run_as" : { - "type" : "keyword" - }, - "doc_type" : { - "type" : "keyword" - }, - "type" : { - "type" : "keyword" - }, - "actions" : { - "type" : "keyword" - }, - "expiration_time" : { - "type" : "date", - "format" : "epoch_millis" - }, - "creation_time" : { - "type" : "date", - "format" : "epoch_millis" - }, - "api_key_hash" : { - "type" : "keyword", - "index": false, - "doc_values": false - }, - "api_key_invalidated" : { - "type" : "boolean" - }, - "role_descriptors" : { - "type" : "object", - "enabled": false - }, - "limited_by_role_descriptors" : { - "type" : "object", - "enabled": false - }, - "version" : { - "type" : "integer" - }, - "creator" : { - "type" : "object", - "properties" : { - "principal" : { - "type": "keyword" - }, - "metadata" : { - "type" : "object", - "dynamic" : false - }, - "realm" : { - "type" : "keyword" - }, - "realm_type" : { - "type" : "keyword" - } - } - }, - "rules" : { - "type" : "object", - "dynamic" : false - }, - "refresh_token" : { - "type" : "object", - "properties" : { - "token" : { - "type" : "keyword" - }, - "refreshed" : { - "type" : "boolean" - }, - "refresh_time": { - "type": "date", - "format": "epoch_millis" - }, - "superseding": { - "type": "object", - "properties": { - "encrypted_tokens": { - "type": "binary" - }, - "encryption_iv": { - "type": "binary" - }, - "encryption_salt": { - "type": "binary" - } - } - }, - "invalidated" : { - "type" : "boolean" - }, - "client" : { - "type" : "object", - "properties" : { - "type" : { - "type" : "keyword" - }, - "user" : { - "type" : "keyword" - }, - "realm" : { - "type" : "keyword" - } - } - } - } - }, - "access_token" : { - "type" : "object", - "properties" : { - "user_token" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "keyword" - }, - "expiration_time" : { - "type" : "date", - "format" : "epoch_millis" - }, - "version" : { - "type" : "integer" - }, - "metadata" : { - "type" : "object", - "dynamic" : false - }, - "authentication" : { - "type" : "binary" - } - } - }, - "invalidated" : { - "type" : "boolean" - }, - "realm" : { - "type" : "keyword" - } - } - } - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/security-tokens-index-template-7.json b/x-pack/plugin/core/out/production/resources/security-tokens-index-template-7.json deleted file mode 100644 index 502daae3f79bd..0000000000000 --- a/x-pack/plugin/core/out/production/resources/security-tokens-index-template-7.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "index_patterns" : [ ".security-tokens-7" ], - "order" : 1000, - "settings" : { - "number_of_shards" : 1, - "number_of_replicas" : 0, - "auto_expand_replicas" : "0-1", - "index.priority": 1000, - "index.refresh_interval": "1s", - "index.format": 7 - }, - "mappings" : { - "_doc" : { - "_meta": { - "security-version": "${security.template.version}" - }, - "dynamic" : "strict", - "properties" : { - "doc_type" : { - "type" : "keyword" - }, - "creation_time" : { - "type" : "date", - "format" : "epoch_millis" - }, - "refresh_token" : { - "type" : "object", - "properties" : { - "token" : { - "type" : "keyword" - }, - "refreshed" : { - "type" : "boolean" - }, - "refresh_time": { - "type": "date", - "format": "epoch_millis" - }, - "superseding": { - "type": "object", - "properties": { - "encrypted_tokens": { - "type": "binary" - }, - "encryption_iv": { - "type": "binary" - }, - "encryption_salt": { - "type": "binary" - } - } - }, - "invalidated" : { - "type" : "boolean" - }, - "client" : { - "type" : "object", - "properties" : { - "type" : { - "type" : "keyword" - }, - "user" : { - "type" : "keyword" - }, - "realm" : { - "type" : "keyword" - } - } - } - } - }, - "access_token" : { - "type" : "object", - "properties" : { - "user_token" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "keyword" - }, - "expiration_time" : { - "type" : "date", - "format" : "epoch_millis" - }, - "version" : { - "type" : "integer" - }, - "metadata" : { - "type" : "object", - "dynamic" : false - }, - "authentication" : { - "type" : "binary" - } - } - }, - "invalidated" : { - "type" : "boolean" - }, - "realm" : { - "type" : "keyword" - } - } - } - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/slm-history-ilm-policy.json b/x-pack/plugin/core/out/production/resources/slm-history-ilm-policy.json deleted file mode 100644 index febae00bc3608..0000000000000 --- a/x-pack/plugin/core/out/production/resources/slm-history-ilm-policy.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "phases": { - "hot": { - "actions": { - "rollover": { - "max_size": "50GB", - "max_age": "30d" - } - } - }, - "delete": { - "min_age": "90d", - "actions": { - "delete": {} - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/slm-history.json b/x-pack/plugin/core/out/production/resources/slm-history.json deleted file mode 100644 index 7ddd995fb21eb..0000000000000 --- a/x-pack/plugin/core/out/production/resources/slm-history.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "index_patterns": [ - ".slm-history-${xpack.slm.template.version}*" - ], - "order": 2147483647, - "settings": { - "index.number_of_shards": 1, - "index.number_of_replicas": 0, - "index.auto_expand_replicas": "0-1", - "index.lifecycle.name": "slm-history-ilm-policy", - "index.lifecycle.rollover_alias": ".slm-history-${xpack.slm.template.version}", - "index.hidden": true, - "index.format": 1 - }, - "mappings": { - "_doc": { - "dynamic": false, - "properties": { - "@timestamp": { - "type": "date", - "format": "epoch_millis" - }, - "policy": { - "type": "keyword" - }, - "repository": { - "type": "keyword" - }, - "snapshot_name":{ - "type": "keyword" - }, - "operation": { - "type": "keyword" - }, - "success": { - "type": "boolean" - }, - "configuration": { - "type": "object", - "dynamic": false, - "properties": { - "indices": { - "type": "keyword" - }, - "partial": { - "type": "boolean" - }, - "include_global_state": { - "type": "boolean" - } - } - }, - "error_details": { - "type": "text", - "index": false - } - } - } - }, - "version": ${xpack.slm.template.version} -} diff --git a/x-pack/plugin/core/out/production/resources/triggered-watches.json b/x-pack/plugin/core/out/production/resources/triggered-watches.json deleted file mode 100644 index 28f3b0fea6537..0000000000000 --- a/x-pack/plugin/core/out/production/resources/triggered-watches.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "index_patterns": [ ".triggered_watches*" ], - "order": 2147483647, - "settings": { - "index.number_of_shards": 1, - "index.auto_expand_replicas": "0-1", - "index.refresh_interval" : "-1", - "index.format": 6, - "index.priority": 900 - }, - "mappings": { - "_doc": { - "dynamic" : "strict", - "properties": { - "trigger_event": { - "type": "object", - "dynamic": true, - "enabled" : false, - "properties": { - "schedule": { - "type": "object", - "dynamic": true, - "properties": { - "triggered_time": { - "type": "date" - }, - "scheduled_time": { - "type": "date" - } - } - } - } - }, - "state": { - "type": "keyword" - } - } - } - }, - "version": ${xpack.watcher.template.version} -} diff --git a/x-pack/plugin/core/out/production/resources/watch-history-10.json b/x-pack/plugin/core/out/production/resources/watch-history-10.json deleted file mode 100644 index 78c989c056955..0000000000000 --- a/x-pack/plugin/core/out/production/resources/watch-history-10.json +++ /dev/null @@ -1,567 +0,0 @@ -{ - "index_patterns": [ ".watcher-history-10*" ], - "order": 2147483647, - "settings": { - "index.number_of_shards": 1, - "index.number_of_replicas": 0, - "index.auto_expand_replicas": "0-1", - "index.lifecycle.name": "watch-history-ilm-policy", - "index.format": 6 - }, - "mappings": { - "_doc": { - "_meta": { - "watcher-history-version": "10" - }, - "dynamic_templates": [ - { - "disabled_payload_fields": { - "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.payload", - "match_pattern": "regex", - "mapping": { - "type": "object", - "enabled": false - } - } - }, - { - "disabled_search_request_body_fields": { - "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.search\\.request\\.(body|template)", - "match_pattern": "regex", - "mapping": { - "type": "object", - "enabled": false - } - } - }, - { - "disabled_exception_fields": { - "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*)|actions)\\.error", - "match_pattern": "regex", - "mapping": { - "type": "object", - "enabled": false - } - } - }, - { - "disabled_jira_custom_fields": { - "path_match": "result.actions.jira.fields.customfield_*", - "mapping": { - "type": "object", - "enabled": false - } - } - } - ], - "dynamic": false, - "properties": { - "watch_id": { - "type": "keyword" - }, - "node": { - "type": "keyword" - }, - "trigger_event": { - "type": "object", - "dynamic": true, - "properties": { - "type" : { - "type" : "keyword" - }, - "triggered_time": { - "type": "date" - }, - "manual": { - "type": "object", - "dynamic": true, - "properties": { - "schedule": { - "type": "object", - "dynamic": true, - "properties": { - "scheduled_time": { - "type": "date" - } - } - } - } - }, - "schedule": { - "type": "object", - "dynamic": true, - "properties": { - "scheduled_time": { - "type": "date" - } - } - } - } - }, - "vars" : { - "type" : "object", - "enabled" : false - }, - "input": { - "type": "object", - "enabled": false - }, - "condition": { - "type": "object", - "enabled": false - }, - "state": { - "type": "keyword" - }, - "status": { - "type": "object", - "enabled" : false, - "dynamic" : true - }, - "messages": { - "type": "text" - }, - "user": { - "type": "text" - }, - "exception" : { - "type" : "object", - "enabled" : false - }, - "result": { - "type": "object", - "dynamic": true, - "properties": { - "execution_time": { - "type": "date" - }, - "execution_duration": { - "type": "long" - }, - "input": { - "type": "object", - "dynamic": true, - "properties": { - "type" : { - "type" : "keyword" - }, - "status" : { - "type" : "keyword" - }, - "payload" : { - "type" : "object", - "enabled" : false - }, - "search": { - "type": "object", - "dynamic": true, - "properties": { - "request": { - "type": "object", - "dynamic": true, - "properties": { - "search_type": { - "type": "keyword" - }, - "indices": { - "type": "keyword" - }, - "types": { - "type": "keyword" - } - } - } - } - }, - "http": { - "type": "object", - "dynamic": true, - "properties": { - "request": { - "type": "object", - "dynamic": true, - "properties": { - "path": { - "type": "keyword" - }, - "host": { - "type": "keyword" - } - } - } - } - } - } - }, - "condition" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "status" : { - "type" : "keyword" - }, - "met" : { - "type" : "boolean" - }, - "compare" : { - "type" : "object", - "enabled" : false - }, - "array_compare" : { - "type" : "object", - "enabled" : false - }, - "script" : { - "type" : "object", - "enabled" : false - } - } - }, - "transform" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "search" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "request" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "indices" : { - "type" : "keyword" - }, - "types" : { - "type" : "keyword" - } - } - } - } - } - } - }, - "actions": { - "type": "nested", - "include_in_parent": true, - "dynamic": true, - "properties": { - "id" : { - "type" : "keyword" - }, - "type" : { - "type" : "keyword" - }, - "status" : { - "type" : "keyword" - }, - "reason" : { - "type" : "keyword" - }, - "number_of_actions_executed": { - "type": "integer" - }, - "foreach" : { - "type": "object", - "enabled" : false - }, - "email": { - "type": "object", - "dynamic": true, - "properties": { - "message": { - "type": "object", - "dynamic": true, - "properties": { - "id": { - "type": "keyword" - }, - "from": { - "type": "keyword" - }, - "reply_to": { - "type": "keyword" - }, - "to": { - "type": "keyword" - }, - "cc": { - "type": "keyword" - }, - "bcc": { - "type": "keyword" - } - } - } - } - }, - "webhook": { - "type": "object", - "dynamic": true, - "properties": { - "request": { - "type": "object", - "dynamic": true, - "properties": { - "path": { - "type": "keyword" - }, - "host": { - "type": "keyword" - } - } - } - } - }, - "index": { - "type": "object", - "dynamic": true, - "properties": { - "response": { - "type": "object", - "dynamic": true, - "properties": { - "index": { - "type": "keyword" - }, - "type": { - "type": "keyword" - }, - "id": { - "type": "keyword" - } - } - } - } - }, - "jira" : { - "type": "object", - "dynamic": true, - "properties": { - "account": { - "type": "keyword" - }, - "reason": { - "type": "text" - }, - "request" : { - "type" : "object", - "enabled" : false - }, - "response" : { - "type" : "object", - "enabled" : false - }, - "fields": { - "type": "object", - "dynamic": true, - "properties": { - "summary": { - "type": "text" - }, - "description": { - "type": "text" - }, - "labels" : { - "type": "text" - }, - "project" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "key" : { - "type" : "keyword" - }, - "id" : { - "type" : "keyword" - } - } - }, - "issuetype" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "name" : { - "type": "keyword" - }, - "id" : { - "type" : "keyword" - } - } - } - } - }, - "result": { - "type": "object", - "dynamic": true, - "properties" : { - "id" : { - "type" : "keyword" - }, - "key" : { - "type" : "keyword" - }, - "self" : { - "type" : "keyword" - } - } - } - } - }, - "slack" : { - "type": "object", - "dynamic": true, - "properties": { - "account": { - "type": "keyword" - }, - "sent_messages": { - "type": "nested", - "include_in_parent": true, - "dynamic": true, - "properties": { - "status": { - "type": "keyword" - }, - "reason": { - "type": "text" - }, - "request" : { - "type" : "object", - "enabled" : false - }, - "response" : { - "type" : "object", - "enabled" : false - }, - "to" : { - "type": "keyword" - }, - "message" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "from" : { - "type" : "text" - }, - "icon" : { - "type" : "keyword" - }, - "text" : { - "type" : "text" - }, - "attachments" : { - "type" : "nested", - "include_in_parent": true, - "dynamic" : true, - "properties" : { - "color" : { - "type" : "keyword" - }, - "fields" : { - "properties" : { - "value" : { - "type" : "text" - } - } - } - } - } - } - } - } - } - } - }, - "pagerduty" : { - "type": "object", - "dynamic": true, - "properties": { - "account": { - "type": "keyword" - }, - "sent_event": { - "type": "nested", - "include_in_parent": true, - "dynamic": true, - "properties": { - "reason": { - "type": "text" - }, - "request" : { - "type" : "object", - "enabled" : false - }, - "response" : { - "type" : "object", - "enabled" : false - }, - "event" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "client" : { - "type" : "text" - }, - "client_url" : { - "type" : "keyword" - }, - "account" : { - "type" : "keyword" - }, - "attach_payload" : { - "type" : "boolean" - }, - "incident_key" : { - "type" : "keyword" - }, - "description" : { - "type" : "text" - }, - "context" : { - "type" : "nested", - "include_in_parent": true, - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "href" : { - "type" : "keyword" - }, - "src" : { - "type" : "keyword" - }, - "alt" : { - "type" : "text" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "metadata": { - "type": "object", - "dynamic": true - } - } - } - }, - "version": 10 -} diff --git a/x-pack/plugin/core/out/production/resources/watch-history-ilm-policy.json b/x-pack/plugin/core/out/production/resources/watch-history-ilm-policy.json deleted file mode 100644 index e45e6b25e8f7b..0000000000000 --- a/x-pack/plugin/core/out/production/resources/watch-history-ilm-policy.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "phases": { - "delete": { - "min_age": "7d", - "actions": { - "delete": {} - } - } - } -} diff --git a/x-pack/plugin/core/out/production/resources/watch-history-no-ilm-10.json b/x-pack/plugin/core/out/production/resources/watch-history-no-ilm-10.json deleted file mode 100644 index c763f992468b2..0000000000000 --- a/x-pack/plugin/core/out/production/resources/watch-history-no-ilm-10.json +++ /dev/null @@ -1,616 +0,0 @@ -{ - "index_patterns": [ ".watcher-history-10*" ], - "order": 2147483646, - "settings": { - "index.number_of_shards": 1, - "index.number_of_replicas": 0, - "index.auto_expand_replicas": "0-1", - "index.format": 6 - }, - "mappings": { - "doc": { - "_meta": { - "watcher-history-version": "10" - }, - "dynamic_templates": [ - { - "disabled_payload_fields": { - "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.payload", - "match_pattern": "regex", - "mapping": { - "type": "object", - "enabled": false - } - } - }, - { - "disabled_search_request_body_fields": { - "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.search\\.request\\.(body|template)", - "match_pattern": "regex", - "mapping": { - "type": "object", - "enabled": false - } - } - }, - { - "disabled_exception_fields": { - "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*)|actions)\\.error", - "match_pattern": "regex", - "mapping": { - "type": "object", - "enabled": false - } - } - }, - { - "disabled_jira_custom_fields": { - "path_match": "result.actions.jira.fields.customfield_*", - "mapping": { - "type": "object", - "enabled": false - } - } - } - ], - "dynamic": false, - "properties": { - "watch_id": { - "type": "keyword" - }, - "node": { - "type": "keyword" - }, - "trigger_event": { - "type": "object", - "dynamic": true, - "properties": { - "type" : { - "type" : "keyword" - }, - "triggered_time": { - "type": "date" - }, - "manual": { - "type": "object", - "dynamic": true, - "properties": { - "schedule": { - "type": "object", - "dynamic": true, - "properties": { - "scheduled_time": { - "type": "date" - } - } - } - } - }, - "schedule": { - "type": "object", - "dynamic": true, - "properties": { - "scheduled_time": { - "type": "date" - } - } - } - } - }, - "vars" : { - "type" : "object", - "enabled" : false - }, - "input": { - "type": "object", - "enabled": false - }, - "condition": { - "type": "object", - "enabled": false - }, - "state": { - "type": "keyword" - }, - "status": { - "type": "object", - "enabled" : false, - "dynamic" : true - }, - "messages": { - "type": "text" - }, - "user": { - "type": "text" - }, - "exception" : { - "type" : "object", - "enabled" : false - }, - "result": { - "type": "object", - "dynamic": true, - "properties": { - "execution_time": { - "type": "date" - }, - "execution_duration": { - "type": "long" - }, - "input": { - "type": "object", - "dynamic": true, - "properties": { - "type" : { - "type" : "keyword" - }, - "status" : { - "type" : "keyword" - }, - "payload" : { - "type" : "object", - "enabled" : false - }, - "search": { - "type": "object", - "dynamic": true, - "properties": { - "request": { - "type": "object", - "dynamic": true, - "properties": { - "search_type": { - "type": "keyword" - }, - "indices": { - "type": "keyword" - }, - "types": { - "type": "keyword" - } - } - } - } - }, - "http": { - "type": "object", - "dynamic": true, - "properties": { - "request": { - "type": "object", - "dynamic": true, - "properties": { - "path": { - "type": "keyword" - }, - "host": { - "type": "keyword" - } - } - } - } - } - } - }, - "condition" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "status" : { - "type" : "keyword" - }, - "met" : { - "type" : "boolean" - }, - "compare" : { - "type" : "object", - "enabled" : false - }, - "array_compare" : { - "type" : "object", - "enabled" : false - }, - "script" : { - "type" : "object", - "enabled" : false - } - } - }, - "transform" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "search" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "request" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "indices" : { - "type" : "keyword" - }, - "types" : { - "type" : "keyword" - } - } - } - } - } - } - }, - "actions": { - "type": "nested", - "include_in_parent": true, - "dynamic": true, - "properties": { - "id" : { - "type" : "keyword" - }, - "type" : { - "type" : "keyword" - }, - "status" : { - "type" : "keyword" - }, - "reason" : { - "type" : "keyword" - }, - "email": { - "type": "object", - "dynamic": true, - "properties": { - "message": { - "type": "object", - "dynamic": true, - "properties": { - "id": { - "type": "keyword" - }, - "from": { - "type": "keyword" - }, - "reply_to": { - "type": "keyword" - }, - "to": { - "type": "keyword" - }, - "cc": { - "type": "keyword" - }, - "bcc": { - "type": "keyword" - } - } - } - } - }, - "webhook": { - "type": "object", - "dynamic": true, - "properties": { - "request": { - "type": "object", - "dynamic": true, - "properties": { - "path": { - "type": "keyword" - }, - "host": { - "type": "keyword" - } - } - } - } - }, - "index": { - "type": "object", - "dynamic": true, - "properties": { - "response": { - "type": "object", - "dynamic": true, - "properties": { - "index": { - "type": "keyword" - }, - "type": { - "type": "keyword" - }, - "id": { - "type": "keyword" - } - } - } - } - }, - "hipchat" : { - "type": "object", - "dynamic": true, - "properties": { - "account": { - "type": "keyword" - }, - "sent_messages": { - "type": "nested", - "include_in_parent": true, - "dynamic": true, - "properties": { - "status": { - "type": "keyword" - }, - "reason": { - "type": "text" - }, - "request" : { - "type" : "object", - "enabled" : false - }, - "response" : { - "type" : "object", - "enabled" : false - }, - "room" : { - "type": "keyword" - }, - "user" : { - "type": "keyword" - }, - "message" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "message_format" : { - "type" : "keyword" - }, - "color" : { - "type" : "keyword" - }, - "notify" : { - "type" : "boolean" - }, - "message" : { - "type" : "text" - }, - "from" : { - "type" : "text" - } - } - } - } - } - } - }, - "jira" : { - "type": "object", - "dynamic": true, - "properties": { - "account": { - "type": "keyword" - }, - "reason": { - "type": "text" - }, - "request" : { - "type" : "object", - "enabled" : false - }, - "response" : { - "type" : "object", - "enabled" : false - }, - "fields": { - "type": "object", - "dynamic": true, - "properties": { - "summary": { - "type": "text" - }, - "description": { - "type": "text" - }, - "labels" : { - "type": "text" - }, - "project" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "key" : { - "type" : "keyword" - }, - "id" : { - "type" : "keyword" - } - } - }, - "issuetype" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "name" : { - "type": "keyword" - }, - "id" : { - "type" : "keyword" - } - } - } - } - }, - "result": { - "type": "object", - "dynamic": true, - "properties" : { - "id" : { - "type" : "keyword" - }, - "key" : { - "type" : "keyword" - }, - "self" : { - "type" : "keyword" - } - } - } - } - }, - "slack" : { - "type": "object", - "dynamic": true, - "properties": { - "account": { - "type": "keyword" - }, - "sent_messages": { - "type": "nested", - "include_in_parent": true, - "dynamic": true, - "properties": { - "status": { - "type": "keyword" - }, - "reason": { - "type": "text" - }, - "request" : { - "type" : "object", - "enabled" : false - }, - "response" : { - "type" : "object", - "enabled" : false - }, - "to" : { - "type": "keyword" - }, - "message" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "from" : { - "type" : "text" - }, - "icon" : { - "type" : "keyword" - }, - "text" : { - "type" : "text" - }, - "attachments" : { - "type" : "nested", - "include_in_parent": true, - "dynamic" : true, - "properties" : { - "color" : { - "type" : "keyword" - }, - "fields" : { - "properties" : { - "value" : { - "type" : "text" - } - } - } - } - } - } - } - } - } - } - }, - "pagerduty" : { - "type": "object", - "dynamic": true, - "properties": { - "account": { - "type": "keyword" - }, - "sent_event": { - "type": "nested", - "include_in_parent": true, - "dynamic": true, - "properties": { - "reason": { - "type": "text" - }, - "request" : { - "type" : "object", - "enabled" : false - }, - "response" : { - "type" : "object", - "enabled" : false - }, - "event" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "client" : { - "type" : "text" - }, - "client_url" : { - "type" : "keyword" - }, - "account" : { - "type" : "keyword" - }, - "attach_payload" : { - "type" : "boolean" - }, - "incident_key" : { - "type" : "keyword" - }, - "description" : { - "type" : "text" - }, - "context" : { - "type" : "nested", - "include_in_parent": true, - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "href" : { - "type" : "keyword" - }, - "src" : { - "type" : "keyword" - }, - "alt" : { - "type" : "text" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "metadata": { - "type": "object", - "dynamic": true - } - } - } - }, - "version": 10 -} diff --git a/x-pack/plugin/core/out/production/resources/watch-history-no-ilm.json b/x-pack/plugin/core/out/production/resources/watch-history-no-ilm.json deleted file mode 100644 index 7b5910508392d..0000000000000 --- a/x-pack/plugin/core/out/production/resources/watch-history-no-ilm.json +++ /dev/null @@ -1,617 +0,0 @@ -{ - "index_patterns": [ ".watcher-history-${xpack.watcher.template.version}*" ], - "order": 2147483646, - "settings": { - "index.number_of_shards": 1, - "index.number_of_replicas": 0, - "index.auto_expand_replicas": "0-1", - "index.hidden": true, - "index.format": 6 - }, - "mappings": { - "doc": { - "_meta": { - "watcher-history-version": "${xpack.watcher.template.version}" - }, - "dynamic_templates": [ - { - "disabled_payload_fields": { - "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.payload", - "match_pattern": "regex", - "mapping": { - "type": "object", - "enabled": false - } - } - }, - { - "disabled_search_request_body_fields": { - "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.search\\.request\\.(body|template)", - "match_pattern": "regex", - "mapping": { - "type": "object", - "enabled": false - } - } - }, - { - "disabled_exception_fields": { - "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*)|actions)\\.error", - "match_pattern": "regex", - "mapping": { - "type": "object", - "enabled": false - } - } - }, - { - "disabled_jira_custom_fields": { - "path_match": "result.actions.jira.fields.customfield_*", - "mapping": { - "type": "object", - "enabled": false - } - } - } - ], - "dynamic": false, - "properties": { - "watch_id": { - "type": "keyword" - }, - "node": { - "type": "keyword" - }, - "trigger_event": { - "type": "object", - "dynamic": true, - "properties": { - "type" : { - "type" : "keyword" - }, - "triggered_time": { - "type": "date" - }, - "manual": { - "type": "object", - "dynamic": true, - "properties": { - "schedule": { - "type": "object", - "dynamic": true, - "properties": { - "scheduled_time": { - "type": "date" - } - } - } - } - }, - "schedule": { - "type": "object", - "dynamic": true, - "properties": { - "scheduled_time": { - "type": "date" - } - } - } - } - }, - "vars" : { - "type" : "object", - "enabled" : false - }, - "input": { - "type": "object", - "enabled": false - }, - "condition": { - "type": "object", - "enabled": false - }, - "state": { - "type": "keyword" - }, - "status": { - "type": "object", - "enabled" : false, - "dynamic" : true - }, - "messages": { - "type": "text" - }, - "user": { - "type": "text" - }, - "exception" : { - "type" : "object", - "enabled" : false - }, - "result": { - "type": "object", - "dynamic": true, - "properties": { - "execution_time": { - "type": "date" - }, - "execution_duration": { - "type": "long" - }, - "input": { - "type": "object", - "dynamic": true, - "properties": { - "type" : { - "type" : "keyword" - }, - "status" : { - "type" : "keyword" - }, - "payload" : { - "type" : "object", - "enabled" : false - }, - "search": { - "type": "object", - "dynamic": true, - "properties": { - "request": { - "type": "object", - "dynamic": true, - "properties": { - "search_type": { - "type": "keyword" - }, - "indices": { - "type": "keyword" - }, - "types": { - "type": "keyword" - } - } - } - } - }, - "http": { - "type": "object", - "dynamic": true, - "properties": { - "request": { - "type": "object", - "dynamic": true, - "properties": { - "path": { - "type": "keyword" - }, - "host": { - "type": "keyword" - } - } - } - } - } - } - }, - "condition" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "status" : { - "type" : "keyword" - }, - "met" : { - "type" : "boolean" - }, - "compare" : { - "type" : "object", - "enabled" : false - }, - "array_compare" : { - "type" : "object", - "enabled" : false - }, - "script" : { - "type" : "object", - "enabled" : false - } - } - }, - "transform" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "search" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "request" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "indices" : { - "type" : "keyword" - }, - "types" : { - "type" : "keyword" - } - } - } - } - } - } - }, - "actions": { - "type": "nested", - "include_in_parent": true, - "dynamic": true, - "properties": { - "id" : { - "type" : "keyword" - }, - "type" : { - "type" : "keyword" - }, - "status" : { - "type" : "keyword" - }, - "reason" : { - "type" : "keyword" - }, - "email": { - "type": "object", - "dynamic": true, - "properties": { - "message": { - "type": "object", - "dynamic": true, - "properties": { - "id": { - "type": "keyword" - }, - "from": { - "type": "keyword" - }, - "reply_to": { - "type": "keyword" - }, - "to": { - "type": "keyword" - }, - "cc": { - "type": "keyword" - }, - "bcc": { - "type": "keyword" - } - } - } - } - }, - "webhook": { - "type": "object", - "dynamic": true, - "properties": { - "request": { - "type": "object", - "dynamic": true, - "properties": { - "path": { - "type": "keyword" - }, - "host": { - "type": "keyword" - } - } - } - } - }, - "index": { - "type": "object", - "dynamic": true, - "properties": { - "response": { - "type": "object", - "dynamic": true, - "properties": { - "index": { - "type": "keyword" - }, - "type": { - "type": "keyword" - }, - "id": { - "type": "keyword" - } - } - } - } - }, - "hipchat" : { - "type": "object", - "dynamic": true, - "properties": { - "account": { - "type": "keyword" - }, - "sent_messages": { - "type": "nested", - "include_in_parent": true, - "dynamic": true, - "properties": { - "status": { - "type": "keyword" - }, - "reason": { - "type": "text" - }, - "request" : { - "type" : "object", - "enabled" : false - }, - "response" : { - "type" : "object", - "enabled" : false - }, - "room" : { - "type": "keyword" - }, - "user" : { - "type": "keyword" - }, - "message" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "message_format" : { - "type" : "keyword" - }, - "color" : { - "type" : "keyword" - }, - "notify" : { - "type" : "boolean" - }, - "message" : { - "type" : "text" - }, - "from" : { - "type" : "text" - } - } - } - } - } - } - }, - "jira" : { - "type": "object", - "dynamic": true, - "properties": { - "account": { - "type": "keyword" - }, - "reason": { - "type": "text" - }, - "request" : { - "type" : "object", - "enabled" : false - }, - "response" : { - "type" : "object", - "enabled" : false - }, - "fields": { - "type": "object", - "dynamic": true, - "properties": { - "summary": { - "type": "text" - }, - "description": { - "type": "text" - }, - "labels" : { - "type": "text" - }, - "project" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "key" : { - "type" : "keyword" - }, - "id" : { - "type" : "keyword" - } - } - }, - "issuetype" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "name" : { - "type": "keyword" - }, - "id" : { - "type" : "keyword" - } - } - } - } - }, - "result": { - "type": "object", - "dynamic": true, - "properties" : { - "id" : { - "type" : "keyword" - }, - "key" : { - "type" : "keyword" - }, - "self" : { - "type" : "keyword" - } - } - } - } - }, - "slack" : { - "type": "object", - "dynamic": true, - "properties": { - "account": { - "type": "keyword" - }, - "sent_messages": { - "type": "nested", - "include_in_parent": true, - "dynamic": true, - "properties": { - "status": { - "type": "keyword" - }, - "reason": { - "type": "text" - }, - "request" : { - "type" : "object", - "enabled" : false - }, - "response" : { - "type" : "object", - "enabled" : false - }, - "to" : { - "type": "keyword" - }, - "message" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "from" : { - "type" : "text" - }, - "icon" : { - "type" : "keyword" - }, - "text" : { - "type" : "text" - }, - "attachments" : { - "type" : "nested", - "include_in_parent": true, - "dynamic" : true, - "properties" : { - "color" : { - "type" : "keyword" - }, - "fields" : { - "properties" : { - "value" : { - "type" : "text" - } - } - } - } - } - } - } - } - } - } - }, - "pagerduty" : { - "type": "object", - "dynamic": true, - "properties": { - "account": { - "type": "keyword" - }, - "sent_event": { - "type": "nested", - "include_in_parent": true, - "dynamic": true, - "properties": { - "reason": { - "type": "text" - }, - "request" : { - "type" : "object", - "enabled" : false - }, - "response" : { - "type" : "object", - "enabled" : false - }, - "event" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "client" : { - "type" : "text" - }, - "client_url" : { - "type" : "keyword" - }, - "account" : { - "type" : "keyword" - }, - "attach_payload" : { - "type" : "boolean" - }, - "incident_key" : { - "type" : "keyword" - }, - "description" : { - "type" : "text" - }, - "context" : { - "type" : "nested", - "include_in_parent": true, - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "href" : { - "type" : "keyword" - }, - "src" : { - "type" : "keyword" - }, - "alt" : { - "type" : "text" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "metadata": { - "type": "object", - "dynamic": true - } - } - } - }, - "version": ${xpack.watcher.template.version} -} diff --git a/x-pack/plugin/core/out/production/resources/watch-history.json b/x-pack/plugin/core/out/production/resources/watch-history.json deleted file mode 100644 index 109ca95d75190..0000000000000 --- a/x-pack/plugin/core/out/production/resources/watch-history.json +++ /dev/null @@ -1,568 +0,0 @@ -{ - "index_patterns": [ ".watcher-history-${xpack.watcher.template.version}*" ], - "order": 2147483647, - "settings": { - "index.number_of_shards": 1, - "index.number_of_replicas": 0, - "index.auto_expand_replicas": "0-1", - "index.lifecycle.name": "watch-history-ilm-policy", - "index.hidden": true, - "index.format": 6 - }, - "mappings": { - "_doc": { - "_meta": { - "watcher-history-version": "${xpack.watcher.template.version}" - }, - "dynamic_templates": [ - { - "disabled_payload_fields": { - "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.payload", - "match_pattern": "regex", - "mapping": { - "type": "object", - "enabled": false - } - } - }, - { - "disabled_search_request_body_fields": { - "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*))\\.search\\.request\\.(body|template)", - "match_pattern": "regex", - "mapping": { - "type": "object", - "enabled": false - } - } - }, - { - "disabled_exception_fields": { - "path_match": "result\\.(input(\\..+)*|(transform(\\..+)*)|(actions\\.transform(\\..+)*)|actions)\\.error", - "match_pattern": "regex", - "mapping": { - "type": "object", - "enabled": false - } - } - }, - { - "disabled_jira_custom_fields": { - "path_match": "result.actions.jira.fields.customfield_*", - "mapping": { - "type": "object", - "enabled": false - } - } - } - ], - "dynamic": false, - "properties": { - "watch_id": { - "type": "keyword" - }, - "node": { - "type": "keyword" - }, - "trigger_event": { - "type": "object", - "dynamic": true, - "properties": { - "type" : { - "type" : "keyword" - }, - "triggered_time": { - "type": "date" - }, - "manual": { - "type": "object", - "dynamic": true, - "properties": { - "schedule": { - "type": "object", - "dynamic": true, - "properties": { - "scheduled_time": { - "type": "date" - } - } - } - } - }, - "schedule": { - "type": "object", - "dynamic": true, - "properties": { - "scheduled_time": { - "type": "date" - } - } - } - } - }, - "vars" : { - "type" : "object", - "enabled" : false - }, - "input": { - "type": "object", - "enabled": false - }, - "condition": { - "type": "object", - "enabled": false - }, - "state": { - "type": "keyword" - }, - "status": { - "type": "object", - "enabled" : false, - "dynamic" : true - }, - "messages": { - "type": "text" - }, - "user": { - "type": "text" - }, - "exception" : { - "type" : "object", - "enabled" : false - }, - "result": { - "type": "object", - "dynamic": true, - "properties": { - "execution_time": { - "type": "date" - }, - "execution_duration": { - "type": "long" - }, - "input": { - "type": "object", - "dynamic": true, - "properties": { - "type" : { - "type" : "keyword" - }, - "status" : { - "type" : "keyword" - }, - "payload" : { - "type" : "object", - "enabled" : false - }, - "search": { - "type": "object", - "dynamic": true, - "properties": { - "request": { - "type": "object", - "dynamic": true, - "properties": { - "search_type": { - "type": "keyword" - }, - "indices": { - "type": "keyword" - }, - "types": { - "type": "keyword" - } - } - } - } - }, - "http": { - "type": "object", - "dynamic": true, - "properties": { - "request": { - "type": "object", - "dynamic": true, - "properties": { - "path": { - "type": "keyword" - }, - "host": { - "type": "keyword" - } - } - } - } - } - } - }, - "condition" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "status" : { - "type" : "keyword" - }, - "met" : { - "type" : "boolean" - }, - "compare" : { - "type" : "object", - "enabled" : false - }, - "array_compare" : { - "type" : "object", - "enabled" : false - }, - "script" : { - "type" : "object", - "enabled" : false - } - } - }, - "transform" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "search" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "request" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "indices" : { - "type" : "keyword" - }, - "types" : { - "type" : "keyword" - } - } - } - } - } - } - }, - "actions": { - "type": "nested", - "include_in_parent": true, - "dynamic": true, - "properties": { - "id" : { - "type" : "keyword" - }, - "type" : { - "type" : "keyword" - }, - "status" : { - "type" : "keyword" - }, - "reason" : { - "type" : "keyword" - }, - "number_of_actions_executed": { - "type": "integer" - }, - "foreach" : { - "type": "object", - "enabled" : false - }, - "email": { - "type": "object", - "dynamic": true, - "properties": { - "message": { - "type": "object", - "dynamic": true, - "properties": { - "id": { - "type": "keyword" - }, - "from": { - "type": "keyword" - }, - "reply_to": { - "type": "keyword" - }, - "to": { - "type": "keyword" - }, - "cc": { - "type": "keyword" - }, - "bcc": { - "type": "keyword" - } - } - } - } - }, - "webhook": { - "type": "object", - "dynamic": true, - "properties": { - "request": { - "type": "object", - "dynamic": true, - "properties": { - "path": { - "type": "keyword" - }, - "host": { - "type": "keyword" - } - } - } - } - }, - "index": { - "type": "object", - "dynamic": true, - "properties": { - "response": { - "type": "object", - "dynamic": true, - "properties": { - "index": { - "type": "keyword" - }, - "type": { - "type": "keyword" - }, - "id": { - "type": "keyword" - } - } - } - } - }, - "jira" : { - "type": "object", - "dynamic": true, - "properties": { - "account": { - "type": "keyword" - }, - "reason": { - "type": "text" - }, - "request" : { - "type" : "object", - "enabled" : false - }, - "response" : { - "type" : "object", - "enabled" : false - }, - "fields": { - "type": "object", - "dynamic": true, - "properties": { - "summary": { - "type": "text" - }, - "description": { - "type": "text" - }, - "labels" : { - "type": "text" - }, - "project" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "key" : { - "type" : "keyword" - }, - "id" : { - "type" : "keyword" - } - } - }, - "issuetype" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "name" : { - "type": "keyword" - }, - "id" : { - "type" : "keyword" - } - } - } - } - }, - "result": { - "type": "object", - "dynamic": true, - "properties" : { - "id" : { - "type" : "keyword" - }, - "key" : { - "type" : "keyword" - }, - "self" : { - "type" : "keyword" - } - } - } - } - }, - "slack" : { - "type": "object", - "dynamic": true, - "properties": { - "account": { - "type": "keyword" - }, - "sent_messages": { - "type": "nested", - "include_in_parent": true, - "dynamic": true, - "properties": { - "status": { - "type": "keyword" - }, - "reason": { - "type": "text" - }, - "request" : { - "type" : "object", - "enabled" : false - }, - "response" : { - "type" : "object", - "enabled" : false - }, - "to" : { - "type": "keyword" - }, - "message" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "from" : { - "type" : "text" - }, - "icon" : { - "type" : "keyword" - }, - "text" : { - "type" : "text" - }, - "attachments" : { - "type" : "nested", - "include_in_parent": true, - "dynamic" : true, - "properties" : { - "color" : { - "type" : "keyword" - }, - "fields" : { - "properties" : { - "value" : { - "type" : "text" - } - } - } - } - } - } - } - } - } - } - }, - "pagerduty" : { - "type": "object", - "dynamic": true, - "properties": { - "account": { - "type": "keyword" - }, - "sent_event": { - "type": "nested", - "include_in_parent": true, - "dynamic": true, - "properties": { - "reason": { - "type": "text" - }, - "request" : { - "type" : "object", - "enabled" : false - }, - "response" : { - "type" : "object", - "enabled" : false - }, - "event" : { - "type" : "object", - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "client" : { - "type" : "text" - }, - "client_url" : { - "type" : "keyword" - }, - "account" : { - "type" : "keyword" - }, - "attach_payload" : { - "type" : "boolean" - }, - "incident_key" : { - "type" : "keyword" - }, - "description" : { - "type" : "text" - }, - "context" : { - "type" : "nested", - "include_in_parent": true, - "dynamic" : true, - "properties" : { - "type" : { - "type" : "keyword" - }, - "href" : { - "type" : "keyword" - }, - "src" : { - "type" : "keyword" - }, - "alt" : { - "type" : "text" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "metadata": { - "type": "object", - "dynamic": true - } - } - } - }, - "version": ${xpack.watcher.template.version} -} diff --git a/x-pack/plugin/core/out/production/resources/watches.json b/x-pack/plugin/core/out/production/resources/watches.json deleted file mode 100644 index 5181dfdc864f8..0000000000000 --- a/x-pack/plugin/core/out/production/resources/watches.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "index_patterns": [ ".watches*" ], - "order": 2147483647, - "settings": { - "index.number_of_shards": 1, - "index.number_of_replicas": 0, - "index.auto_expand_replicas": "0-1", - "index.format": 6, - "index.priority": 800 - }, - "mappings": { - "_doc": { - "dynamic" : "strict", - "properties": { - "status": { - "type": "object", - "enabled" : false, - "dynamic" : true - }, - "trigger" : { - "type": "object", - "enabled" : false, - "dynamic" : true - }, - "input": { - "type": "object", - "enabled" : false, - "dynamic" : true - }, - "condition": { - "type": "object", - "enabled" : false, - "dynamic" : true - }, - "throttle_period": { - "type" : "keyword", - "index" : false, - "doc_values" : false - }, - "throttle_period_in_millis": { - "type" : "long", - "index" : false, - "doc_values" : false - }, - "transform": { - "type" : "object", - "enabled" : false, - "dynamic" : true - }, - "actions": { - "type" : "object", - "enabled" : false, - "dynamic" : true - }, - "metadata" : { - "type" : "object", - "dynamic": true - } - } - } - }, - "version": ${xpack.watcher.template.version} -} diff --git a/x-pack/plugin/eql/out/production/resources/META-INF/services/org.elasticsearch.painless.spi.PainlessExtension b/x-pack/plugin/eql/out/production/resources/META-INF/services/org.elasticsearch.painless.spi.PainlessExtension deleted file mode 100644 index 70e279c04909a..0000000000000 --- a/x-pack/plugin/eql/out/production/resources/META-INF/services/org.elasticsearch.painless.spi.PainlessExtension +++ /dev/null @@ -1 +0,0 @@ -org.elasticsearch.xpack.eql.plugin.EqlPainlessExtension \ No newline at end of file diff --git a/x-pack/plugin/eql/out/production/resources/org/elasticsearch/xpack/eql/plugin/eql_whitelist.txt b/x-pack/plugin/eql/out/production/resources/org/elasticsearch/xpack/eql/plugin/eql_whitelist.txt deleted file mode 100644 index 6839583d14c1e..0000000000000 --- a/x-pack/plugin/eql/out/production/resources/org/elasticsearch/xpack/eql/plugin/eql_whitelist.txt +++ /dev/null @@ -1,59 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License; -# you may not use this file except in compliance with the Elastic License. -# - -# This file contains a whitelist for EQL specific utilities and classes available inside EQL scripting - -#### Classes - -class org.elasticsearch.xpack.ql.expression.function.scalar.whitelist.InternalQlScriptUtils { - -# -# Utilities -# - def docValue(java.util.Map, String) - boolean nullSafeFilter(Boolean) - double nullSafeSortNumeric(Number) - String nullSafeSortString(Object) - -# -# Comparison -# - Boolean eq(Object, Object) - Boolean nulleq(Object, Object) - Boolean neq(Object, Object) - Boolean lt(Object, Object) - Boolean lte(Object, Object) - Boolean gt(Object, Object) - Boolean gte(Object, Object) - Boolean in(Object, java.util.List) - -# -# Logical -# - Boolean and(Boolean, Boolean) - Boolean or(Boolean, Boolean) - Boolean not(Boolean) - Boolean isNull(Object) - Boolean isNotNull(Object) - -# -# Regex -# - Boolean regex(String, String) - -# -# Math -# - Number neg(Number) -} - -class org.elasticsearch.xpack.eql.expression.function.scalar.whitelist.InternalEqlScriptUtils { - -# -# ASCII Functions -# - String substring(String, Number, Number) -} From a213e6c7cc8ebb86d9c467155afe82348faff43e Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Fri, 27 Mar 2020 15:29:45 +0100 Subject: [PATCH 04/38] extend restcreateindexaction --- .../compat/version7/RestCreateIndexActionV7.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java index ab866d0cc1e8b..1649c5b8e8286 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java @@ -29,6 +29,7 @@ import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; +import org.elasticsearch.rest.action.admin.indices.RestCreateIndexAction; import java.io.IOException; import java.util.Collections; @@ -39,7 +40,7 @@ import static java.util.Collections.singletonMap; import static org.elasticsearch.rest.RestRequest.Method.PUT; -public class RestCreateIndexActionV7 extends BaseRestHandler { +public class RestCreateIndexActionV7 extends RestCreateIndexAction { /** * Parameter that controls whether certain REST apis should include type names in their requests or responses. @@ -48,16 +49,6 @@ public class RestCreateIndexActionV7 extends BaseRestHandler { public static final String INCLUDE_TYPE_NAME_PARAMETER = "include_type_name"; public static final boolean DEFAULT_INCLUDE_TYPE_NAME_POLICY = false; - @Override - public List routes() { - return List.of(new Route(PUT, "/{index}")); - } - - @Override - public String getName() { - return "create_index_action"; - } - @Override public String compatibleWithVersion() { return String.valueOf(Version.V_7_0_0.major); From f1ad6779f0eb699d3623e055cb932ec041abd39b Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Fri, 27 Mar 2020 16:14:13 +0100 Subject: [PATCH 05/38] code style and discovery nodes in indexaction --- .../version7/RestCreateIndexActionV7.java | 18 ++++++------------ .../org/elasticsearch/action/ActionModule.java | 14 +++++++------- .../org/elasticsearch/rest/MethodHandlers.java | 1 - .../org/elasticsearch/rest/RestController.java | 12 ++++++++++-- .../org/elasticsearch/rest/RestRequest.java | 14 ++++++++++++-- .../rest/action/document/RestIndexAction.java | 11 ++++++----- .../action/document/RestIndexActionTests.java | 7 +------ 7 files changed, 42 insertions(+), 35 deletions(-) diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java index 1649c5b8e8286..1aa97aee19b0d 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java @@ -26,7 +26,6 @@ import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; import org.elasticsearch.rest.action.admin.indices.RestCreateIndexAction; @@ -34,11 +33,9 @@ import java.io.IOException; import java.util.Collections; import java.util.HashMap; -import java.util.List; import java.util.Map; import static java.util.Collections.singletonMap; -import static org.elasticsearch.rest.RestRequest.Method.PUT; public class RestCreateIndexActionV7 extends RestCreateIndexAction { @@ -59,10 +56,9 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC CreateIndexRequest createIndexRequest = new CreateIndexRequest(request.param("index")); if (request.hasContent()) { - Map sourceAsMap = XContentHelper.convertToMap(request.requiredContent(), false, - request.getXContentType()).v2(); + Map sourceAsMap = XContentHelper.convertToMap(request.requiredContent(), false, request.getXContentType()).v2(); - request.param(INCLUDE_TYPE_NAME_PARAMETER);//just consume, it is not replaced with _doc + request.param(INCLUDE_TYPE_NAME_PARAMETER);// just consume, it is not replaced with _doc sourceAsMap = prepareMappingsV7(sourceAsMap, request); createIndexRequest.source(sourceAsMap, LoggingDeprecationHandler.INSTANCE); @@ -75,14 +71,13 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC } static Map prepareMappingsV7(Map source, RestRequest request) { - final boolean includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, - DEFAULT_INCLUDE_TYPE_NAME_POLICY); + final boolean includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, DEFAULT_INCLUDE_TYPE_NAME_POLICY); @SuppressWarnings("unchecked") Map mappings = (Map) source.get("mappings"); if (includeTypeName && mappings.size() == 1) { - //no matter what the type was, replace it with _doc + // no matter what the type was, replace it with _doc Map newSource = new HashMap<>(); String typeName = mappings.keySet().iterator().next(); @@ -91,14 +86,13 @@ static Map prepareMappingsV7(Map source, RestReq newSource.put("mappings", Collections.singletonMap(MapperService.SINGLE_MAPPING_NAME, typedMappings)); return newSource; - }else{ + } else { return prepareMappings(source); } } static Map prepareMappings(Map source) { - if (source.containsKey("mappings") == false - || (source.get("mappings") instanceof Map) == false) { + if (source.containsKey("mappings") == false || (source.get("mappings") instanceof Map) == false) { return source; } diff --git a/server/src/main/java/org/elasticsearch/action/ActionModule.java b/server/src/main/java/org/elasticsearch/action/ActionModule.java index c64ba9771ff39..c57000a5c9f40 100644 --- a/server/src/main/java/org/elasticsearch/action/ActionModule.java +++ b/server/src/main/java/org/elasticsearch/action/ActionModule.java @@ -28,9 +28,6 @@ import org.elasticsearch.action.admin.cluster.configuration.ClearVotingConfigExclusionsAction; import org.elasticsearch.action.admin.cluster.configuration.TransportAddVotingConfigExclusionsAction; import org.elasticsearch.action.admin.cluster.configuration.TransportClearVotingConfigExclusionsAction; -import org.elasticsearch.action.admin.indices.datastream.DeleteDataStreamAction; -import org.elasticsearch.action.admin.indices.datastream.GetDataStreamsAction; -import org.elasticsearch.action.admin.indices.datastream.CreateDataStreamAction; import org.elasticsearch.action.admin.cluster.health.ClusterHealthAction; import org.elasticsearch.action.admin.cluster.health.TransportClusterHealthAction; import org.elasticsearch.action.admin.cluster.node.hotthreads.NodesHotThreadsAction; @@ -108,6 +105,9 @@ import org.elasticsearch.action.admin.indices.close.TransportVerifyShardBeforeCloseAction; import org.elasticsearch.action.admin.indices.create.CreateIndexAction; import org.elasticsearch.action.admin.indices.create.TransportCreateIndexAction; +import org.elasticsearch.action.admin.indices.datastream.CreateDataStreamAction; +import org.elasticsearch.action.admin.indices.datastream.DeleteDataStreamAction; +import org.elasticsearch.action.admin.indices.datastream.GetDataStreamsAction; import org.elasticsearch.action.admin.indices.delete.DeleteIndexAction; import org.elasticsearch.action.admin.indices.delete.TransportDeleteIndexAction; import org.elasticsearch.action.admin.indices.flush.FlushAction; @@ -254,11 +254,9 @@ import org.elasticsearch.rest.action.admin.cluster.RestClusterStatsAction; import org.elasticsearch.rest.action.admin.cluster.RestClusterUpdateSettingsAction; import org.elasticsearch.rest.action.admin.cluster.RestCreateSnapshotAction; -import org.elasticsearch.rest.action.admin.indices.RestDeleteDataStreamAction; import org.elasticsearch.rest.action.admin.cluster.RestDeleteRepositoryAction; import org.elasticsearch.rest.action.admin.cluster.RestDeleteSnapshotAction; import org.elasticsearch.rest.action.admin.cluster.RestDeleteStoredScriptAction; -import org.elasticsearch.rest.action.admin.indices.RestGetDataStreamsAction; import org.elasticsearch.rest.action.admin.cluster.RestGetRepositoriesAction; import org.elasticsearch.rest.action.admin.cluster.RestGetScriptContextAction; import org.elasticsearch.rest.action.admin.cluster.RestGetScriptLanguageAction; @@ -271,7 +269,6 @@ import org.elasticsearch.rest.action.admin.cluster.RestNodesStatsAction; import org.elasticsearch.rest.action.admin.cluster.RestNodesUsageAction; import org.elasticsearch.rest.action.admin.cluster.RestPendingClusterTasksAction; -import org.elasticsearch.rest.action.admin.indices.RestCreateDataStreamAction; import org.elasticsearch.rest.action.admin.cluster.RestPutRepositoryAction; import org.elasticsearch.rest.action.admin.cluster.RestPutStoredScriptAction; import org.elasticsearch.rest.action.admin.cluster.RestReloadSecureSettingsAction; @@ -282,14 +279,17 @@ import org.elasticsearch.rest.action.admin.indices.RestAnalyzeAction; import org.elasticsearch.rest.action.admin.indices.RestClearIndicesCacheAction; import org.elasticsearch.rest.action.admin.indices.RestCloseIndexAction; +import org.elasticsearch.rest.action.admin.indices.RestCreateDataStreamAction; import org.elasticsearch.rest.action.admin.indices.RestCreateIndexAction; import org.elasticsearch.rest.action.admin.indices.RestDeleteComponentTemplateAction; +import org.elasticsearch.rest.action.admin.indices.RestDeleteDataStreamAction; import org.elasticsearch.rest.action.admin.indices.RestDeleteIndexAction; import org.elasticsearch.rest.action.admin.indices.RestDeleteIndexTemplateAction; import org.elasticsearch.rest.action.admin.indices.RestFlushAction; import org.elasticsearch.rest.action.admin.indices.RestForceMergeAction; import org.elasticsearch.rest.action.admin.indices.RestGetAliasesAction; import org.elasticsearch.rest.action.admin.indices.RestGetComponentTemplateAction; +import org.elasticsearch.rest.action.admin.indices.RestGetDataStreamsAction; import org.elasticsearch.rest.action.admin.indices.RestGetFieldMappingAction; import org.elasticsearch.rest.action.admin.indices.RestGetIndexTemplateAction; import org.elasticsearch.rest.action.admin.indices.RestGetIndicesAction; @@ -701,7 +701,7 @@ public void initRestHandlers(Supplier nodesInCluster) { registerHandler.accept(new RestIndexAction()); registerHandler.accept(new CreateHandler()); - registerHandler.accept(new AutoIdHandler(clusterService)); + registerHandler.accept(new AutoIdHandler(nodesInCluster)); registerHandler.accept(new RestGetAction()); registerHandler.accept(new RestGetSourceAction()); registerHandler.accept(new RestMultiGetAction(settings)); diff --git a/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java b/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java index ce3229ee30547..4f7bce7a0cdb4 100644 --- a/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java +++ b/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java @@ -19,7 +19,6 @@ package org.elasticsearch.rest; -import org.elasticsearch.Version; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.collect.Tuple; diff --git a/server/src/main/java/org/elasticsearch/rest/RestController.java b/server/src/main/java/org/elasticsearch/rest/RestController.java index 59820272563a7..ed8a964db00e9 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestController.java +++ b/server/src/main/java/org/elasticsearch/rest/RestController.java @@ -44,7 +44,11 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; -import java.util.*; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Supplier; import java.util.function.UnaryOperator; @@ -52,7 +56,11 @@ import static org.elasticsearch.rest.BytesRestResponse.TEXT_CONTENT_TYPE; import static org.elasticsearch.rest.CompatibleConstants.COMPATIBLE_VERSION; -import static org.elasticsearch.rest.RestStatus.*; +import static org.elasticsearch.rest.RestStatus.BAD_REQUEST; +import static org.elasticsearch.rest.RestStatus.INTERNAL_SERVER_ERROR; +import static org.elasticsearch.rest.RestStatus.METHOD_NOT_ALLOWED; +import static org.elasticsearch.rest.RestStatus.NOT_ACCEPTABLE; +import static org.elasticsearch.rest.RestStatus.OK; public class RestController implements HttpServerTransport.Dispatcher { diff --git a/server/src/main/java/org/elasticsearch/rest/RestRequest.java b/server/src/main/java/org/elasticsearch/rest/RestRequest.java index f2871d6ad9525..e252fa92c7c8e 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestRequest.java +++ b/server/src/main/java/org/elasticsearch/rest/RestRequest.java @@ -30,13 +30,23 @@ import org.elasticsearch.common.collect.Tuple; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.xcontent.*; +import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; +import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.http.HttpChannel; import org.elasticsearch.http.HttpRequest; import java.io.IOException; import java.io.InputStream; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.concurrent.atomic.AtomicLong; import java.util.regex.Pattern; import java.util.stream.Collectors; diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java index 7aea955036db6..326d3d46f29c4 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java @@ -23,7 +23,7 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.cluster.service.ClusterService; +import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.index.VersionType; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; @@ -33,6 +33,7 @@ import java.io.IOException; import java.util.List; import java.util.Locale; +import java.util.function.Supplier; import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.rest.RestRequest.Method.PUT; @@ -80,10 +81,10 @@ void validateOpType(String opType) { public static class AutoIdHandler extends RestIndexAction { - private final ClusterService clusterService; + private final Supplier nodesInCluster; - public AutoIdHandler(ClusterService clusterService) { - this.clusterService = clusterService; + public AutoIdHandler(Supplier nodesInCluster) { + this.nodesInCluster = nodesInCluster; } @Override @@ -99,7 +100,7 @@ public List routes() { @Override public RestChannelConsumer prepareRequest(RestRequest request, final NodeClient client) throws IOException { assert request.params().get("id") == null : "non-null id: " + request.params().get("id"); - if (request.params().get("op_type") == null && clusterService.state().nodes().getMinNodeVersion().onOrAfter(Version.V_7_5_0)) { + if (request.params().get("op_type") == null && nodesInCluster.get().getMinNodeVersion().onOrAfter(Version.V_7_5_0)) { // default to op_type create request.params().put("op_type", "create"); } diff --git a/server/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionTests.java index 84bc5f3bef340..bb549b64c724f 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionTests.java @@ -27,7 +27,6 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; @@ -43,9 +42,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; public class RestIndexActionTests extends RestActionTestCase { @@ -53,11 +50,9 @@ public class RestIndexActionTests extends RestActionTestCase { @Before public void setUpAction() { - ClusterService clusterService = mock(ClusterService.class); - when(clusterService.state()).thenAnswer(invocationOnMock -> clusterStateSupplier.get()); controller().registerHandler(new RestIndexAction()); controller().registerHandler(new CreateHandler()); - controller().registerHandler(new AutoIdHandler(clusterService)); + controller().registerHandler(new AutoIdHandler(() -> clusterStateSupplier.get().nodes())); } public void testCreateOpTypeValidation() { From 8ff3463f7558256da4aba434f14ba8446e1ebce8 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Mon, 30 Mar 2020 10:03:58 +0200 Subject: [PATCH 06/38] fix double registration --- .../elasticsearch/rest/MethodHandlers.java | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java b/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java index 4f7bce7a0cdb4..483a8e5a556d5 100644 --- a/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java +++ b/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java @@ -19,13 +19,12 @@ package org.elasticsearch.rest; +import org.elasticsearch.Version; import org.elasticsearch.common.Nullable; -import org.elasticsearch.common.collect.Tuple; import java.util.HashMap; import java.util.Map; import java.util.Set; -import java.util.stream.Collectors; /** * Encapsulate multiple handlers for the same path, allowing different handlers for different HTTP verbs. @@ -34,13 +33,14 @@ final class MethodHandlers { private final String path; //TODO maybe we should aim for having a type for version instead of string/byte - private final Map, RestHandler> methodHandlers; + private final Map> methodHandlers; MethodHandlers(String path, RestHandler handler, String version, RestRequest.Method... methods) { this.path = path; this.methodHandlers = new HashMap<>(methods.length); for (RestRequest.Method method : methods) { - methodHandlers.put(Tuple.tuple(method, version), handler); + methodHandlers.putIfAbsent(method, new HashMap<>()); + methodHandlers.get(method).put(version, handler); } } @@ -50,7 +50,8 @@ final class MethodHandlers { */ MethodHandlers addMethods(RestHandler handler, String version, RestRequest.Method... methods) { for (RestRequest.Method method : methods) { - RestHandler existing = methodHandlers.putIfAbsent(Tuple.tuple(method, version), handler); + methodHandlers.putIfAbsent(method, new HashMap<>()); + RestHandler existing = methodHandlers.get(method).put(version, handler); if (existing != null) { throw new IllegalArgumentException("Cannot replace existing handler for [" + path + "] for method: " + method); } @@ -58,25 +59,19 @@ MethodHandlers addMethods(RestHandler handler, String version, RestRequest.Metho return this; } - /** - * Returns the handler for the given method or {@code null} if none exists. - */ - @Nullable - RestHandler getHandler(RestRequest.Method method) { - return methodHandlers.get(method); - } - @Nullable RestHandler getHandler(RestRequest.Method method, String version) { - return methodHandlers.get(Tuple.tuple(method,version)); + Map versionToHandlers = methodHandlers.get(method); + if (versionToHandlers.containsKey(version)) { + return versionToHandlers.get(version); + } + return versionToHandlers.get(String.valueOf(Version.CURRENT.major)); } /** * Return a set of all valid HTTP methods for the particular path */ Set getValidMethods() { - return methodHandlers.keySet().stream() - .map(Tuple::v1) - .collect(Collectors.toSet()); + return methodHandlers.keySet(); } } From 9b8a26a46dc516fe88e1361e48cb276fdfeb5fd1 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Mon, 30 Mar 2020 20:24:40 +0200 Subject: [PATCH 07/38] add search action v7 --- .../rest/compat/RestCompatPlugin.java | 4 +- .../compat/version7/RestSearchActionV7.java | 63 +++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestSearchActionV7.java diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java index 3fe0c356a5a34..f99873d8a376a 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java @@ -33,6 +33,7 @@ import org.elasticsearch.rest.compat.version7.RestCreateIndexActionV7; import org.elasticsearch.rest.compat.version7.RestGetActionV7; import org.elasticsearch.rest.compat.version7.RestIndexActionV7; +import org.elasticsearch.rest.compat.version7.RestSearchActionV7; import java.util.Collections; import java.util.List; @@ -56,7 +57,8 @@ public List getRestHandlers( new RestIndexActionV7.CompatibleRestIndexAction(), new RestIndexActionV7.CompatibleCreateHandler(), new RestIndexActionV7.CompatibleAutoIdHandler(nodesInCluster), - new RestCreateIndexActionV7() + new RestCreateIndexActionV7(), + new RestSearchActionV7() ); } return Collections.emptyList(); diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestSearchActionV7.java new file mode 100644 index 0000000000000..6d29596abb179 --- /dev/null +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestSearchActionV7.java @@ -0,0 +1,63 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.rest.compat.version7; + +import org.apache.logging.log4j.LogManager; +import org.elasticsearch.Version; +import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.common.logging.DeprecationLogger; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.search.RestSearchAction; + +import java.io.IOException; +import java.util.List; + +import static org.elasticsearch.rest.RestRequest.Method.GET; +import static org.elasticsearch.rest.RestRequest.Method.POST; + +public class RestSearchActionV7 extends RestSearchAction { + public static final String INCLUDE_TYPE_NAME_PARAMETER = "include_type_name"; + public static final String TYPES_DEPRECATION_MESSAGE = "[types removal]" + + " Specifying types in search requests is deprecated."; + + private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSearchAction.class)); + + @Override + public List routes() { + return List.of(new Route(GET, "/{index}/{type}/_search"), + new Route(POST, "/{index}/{type}/_search")); + } + + @Override + public RestChannelConsumer prepareRequest(RestRequest request, final NodeClient client) throws IOException { + request.param(INCLUDE_TYPE_NAME_PARAMETER);// just consume, it is not replaced with _doc + + if (request.hasParam("type")) { + deprecationLogger.deprecatedAndMaybeLog("search_with_types", TYPES_DEPRECATION_MESSAGE); + } + + return super.prepareRequest(request, client); + } + + @Override + public String compatibleWithVersion() { + return String.valueOf(Version.V_7_0_0.major); + } +} From b0a12bdb082498a62a5befa5b881e123a1858d39 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Tue, 31 Mar 2020 14:30:27 +0200 Subject: [PATCH 08/38] search & multisearch --- .../rest/compat/RestCompatPlugin.java | 6 +- .../compat/version7/RestIndexActionV7.java | 2 +- .../search/MultiSearchRequestV7Builder.java | 171 ++++++++++++++++++ .../search/RestMultiSearchActionV7.java | 167 +++++++++++++++++ .../{ => search}/RestSearchActionV7.java | 2 +- .../rest/compat/AbstractCompatRestTest.java | 18 +- 6 files changed, 356 insertions(+), 10 deletions(-) create mode 100644 modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/MultiSearchRequestV7Builder.java create mode 100644 modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7.java rename modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/{ => search}/RestSearchActionV7.java (97%) diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java index f99873d8a376a..6fb3fc09c0822 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java @@ -33,7 +33,8 @@ import org.elasticsearch.rest.compat.version7.RestCreateIndexActionV7; import org.elasticsearch.rest.compat.version7.RestGetActionV7; import org.elasticsearch.rest.compat.version7.RestIndexActionV7; -import org.elasticsearch.rest.compat.version7.RestSearchActionV7; +import org.elasticsearch.rest.compat.version7.search.RestSearchActionV7; +import org.elasticsearch.rest.compat.version7.search.RestMultiSearchActionV7; import java.util.Collections; import java.util.List; @@ -58,7 +59,8 @@ public List getRestHandlers( new RestIndexActionV7.CompatibleCreateHandler(), new RestIndexActionV7.CompatibleAutoIdHandler(nodesInCluster), new RestCreateIndexActionV7(), - new RestSearchActionV7() + new RestSearchActionV7(), + new RestMultiSearchActionV7(settings) ); } return Collections.emptyList(); diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7.java index 51d2e3db47e79..64cb3b87b9e43 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7.java @@ -50,7 +50,7 @@ private static void logDeprecationMessage() { public static class CompatibleRestIndexAction extends RestIndexAction { @Override public List routes() { - assert Version.CURRENT.major == 8 : "REST API compatilbity for version 7 is only supported on version 8"; + assert Version.CURRENT.major == 8 : "REST API compatibility for version 7 is only supported on version 8"; return List.of(new Route(POST, "/{index}/{type}/{id}"), new Route(PUT, "/{index}/{type}/{id}")); } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/MultiSearchRequestV7Builder.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/MultiSearchRequestV7Builder.java new file mode 100644 index 0000000000000..40e775195fa63 --- /dev/null +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/MultiSearchRequestV7Builder.java @@ -0,0 +1,171 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.rest.compat.version7.search; + +import org.elasticsearch.action.search.SearchRequest; +import org.elasticsearch.action.support.IndicesOptions; +import org.elasticsearch.common.CheckedBiConsumer; +import org.elasticsearch.common.bytes.BytesReference; +import org.elasticsearch.common.logging.DeprecationLogger; +import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; +import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.common.xcontent.XContent; +import org.elasticsearch.common.xcontent.XContentParser; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Map; + +import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeBooleanValue; +import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeStringArrayValue; +import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeStringValue; + +/** + * A copy of v7 MultiSearchRequest static building/parsing methods that will provide information about containing types + */ +public class MultiSearchRequestV7Builder { + + public static boolean readMultiLineFormat(BytesReference data, + XContent xContent, + CheckedBiConsumer consumer, + String[] indices, + IndicesOptions indicesOptions, + String[] types, + String routing, + String searchType, + Boolean ccsMinimizeRoundtrips, + NamedXContentRegistry registry, + boolean allowExplicitIndex, + DeprecationLogger deprecationLogger) throws IOException { + + boolean hasTypes = false; + int from = 0; + byte marker = xContent.streamSeparator(); + while (true) { + int nextMarker = findNextMarker(marker, from, data); + if (nextMarker == -1) { + break; + } + // support first line with \n + if (nextMarker == 0) { + from = nextMarker + 1; + deprecationLogger.deprecated("support for empty first line before any action metadata in msearch API is deprecated and " + + "will be removed in the next major version"); + continue; + } + + SearchRequest searchRequest = new SearchRequest(); + if (indices != null) { + searchRequest.indices(indices); + } + if (indicesOptions != null) { + searchRequest.indicesOptions(indicesOptions); + } + if (types != null && types.length > 0) { + hasTypes = true; + } + if (routing != null) { + searchRequest.routing(routing); + } + if (searchType != null) { + searchRequest.searchType(searchType); + } + if (ccsMinimizeRoundtrips != null) { + searchRequest.setCcsMinimizeRoundtrips(ccsMinimizeRoundtrips); + } + IndicesOptions defaultOptions = searchRequest.indicesOptions(); + // now parse the action + if (nextMarker - from > 0) { + try (InputStream stream = data.slice(from, nextMarker - from).streamInput(); + XContentParser parser = xContent.createParser(registry, LoggingDeprecationHandler.INSTANCE, stream)) { + Map source = parser.map(); + Object expandWildcards = null; + Object ignoreUnavailable = null; + Object ignoreThrottled = null; + Object allowNoIndices = null; + for (Map.Entry entry : source.entrySet()) { + Object value = entry.getValue(); + if ("index".equals(entry.getKey()) || "indices".equals(entry.getKey())) { + if (!allowExplicitIndex) { + throw new IllegalArgumentException("explicit index in multi search is not allowed"); + } + searchRequest.indices(nodeStringArrayValue(value)); + } else if ("type".equals(entry.getKey()) || "types".equals(entry.getKey())) { + hasTypes = true; + } else if ("search_type".equals(entry.getKey()) || "searchType".equals(entry.getKey())) { + searchRequest.searchType(nodeStringValue(value, null)); + } else if ("ccs_minimize_roundtrips".equals(entry.getKey()) || "ccsMinimizeRoundtrips".equals(entry.getKey())) { + searchRequest.setCcsMinimizeRoundtrips(nodeBooleanValue(value)); + } else if ("request_cache".equals(entry.getKey()) || "requestCache".equals(entry.getKey())) { + searchRequest.requestCache(nodeBooleanValue(value, entry.getKey())); + } else if ("preference".equals(entry.getKey())) { + searchRequest.preference(nodeStringValue(value, null)); + } else if ("routing".equals(entry.getKey())) { + searchRequest.routing(nodeStringValue(value, null)); + } else if ("allow_partial_search_results".equals(entry.getKey())) { + searchRequest.allowPartialSearchResults(nodeBooleanValue(value, null)); + } else if ("expand_wildcards".equals(entry.getKey()) || "expandWildcards".equals(entry.getKey())) { + expandWildcards = value; + } else if ("ignore_unavailable".equals(entry.getKey()) || "ignoreUnavailable".equals(entry.getKey())) { + ignoreUnavailable = value; + } else if ("allow_no_indices".equals(entry.getKey()) || "allowNoIndices".equals(entry.getKey())) { + allowNoIndices = value; + } else if ("ignore_throttled".equals(entry.getKey()) || "ignoreThrottled".equals(entry.getKey())) { + ignoreThrottled = value; + } else { + throw new IllegalArgumentException("key [" + entry.getKey() + "] is not supported in the metadata section"); + } + } + defaultOptions = IndicesOptions.fromParameters(expandWildcards, ignoreUnavailable, allowNoIndices, ignoreThrottled, + defaultOptions); + } + } + searchRequest.indicesOptions(defaultOptions); + + // move pointers + from = nextMarker + 1; + // now for the body + nextMarker = findNextMarker(marker, from, data); + if (nextMarker == -1) { + break; + } + BytesReference bytes = data.slice(from, nextMarker - from); + try (InputStream stream = bytes.streamInput(); + XContentParser parser = xContent.createParser(registry, LoggingDeprecationHandler.INSTANCE, stream)) { + consumer.accept(searchRequest, parser); + } + // move pointers + from = nextMarker + 1; + } + return hasTypes; + } + + public static int findNextMarker(byte marker, int from, BytesReference data) { + final int res = data.indexOf(marker, from); + if (res != -1) { + assert res >= 0; + return res; + } + if (from != data.length()) { + throw new IllegalArgumentException("The msearch request must be terminated by a newline [\n]"); + } + return -1; + } +} diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7.java new file mode 100644 index 0000000000000..a4c28bf17f885 --- /dev/null +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7.java @@ -0,0 +1,167 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.rest.compat.version7.search; + +import org.apache.logging.log4j.LogManager; +import org.elasticsearch.Version; +import org.elasticsearch.action.search.MultiSearchRequest; +import org.elasticsearch.action.search.SearchRequest; +import org.elasticsearch.action.support.IndicesOptions; +import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.common.CheckedBiConsumer; +import org.elasticsearch.common.Strings; +import org.elasticsearch.common.bytes.BytesReference; +import org.elasticsearch.common.collect.Tuple; +import org.elasticsearch.common.logging.DeprecationLogger; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.xcontent.XContent; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.RestToXContentListener; +import org.elasticsearch.rest.action.search.RestMultiSearchAction; +import org.elasticsearch.rest.action.search.RestSearchAction; +import org.elasticsearch.search.builder.SearchSourceBuilder; + +import java.io.IOException; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import static org.elasticsearch.rest.RestRequest.Method.GET; +import static org.elasticsearch.rest.RestRequest.Method.POST; + +public class RestMultiSearchActionV7 extends RestMultiSearchAction { + private static final DeprecationLogger deprecationLogger = new DeprecationLogger( + LogManager.getLogger(RestMultiSearchAction.class)); + private static final String TYPES_DEPRECATION_MESSAGE = "[types removal]" + + " Specifying types in multi search requests is deprecated."; + + private static final Set RESPONSE_PARAMS; + + static { + final Set responseParams = new HashSet<>( + Arrays.asList(RestSearchAction.TYPED_KEYS_PARAM, RestSearchAction.TOTAL_HITS_AS_INT_PARAM) + ); + RESPONSE_PARAMS = Collections.unmodifiableSet(responseParams); + } + private final boolean allowExplicitIndex; + + public RestMultiSearchActionV7(Settings settings) { + super(settings); + this.allowExplicitIndex = MULTI_ALLOW_EXPLICIT_INDEX.get(settings); + } + + @Override + public String compatibleWithVersion() { + return String.valueOf(Version.V_7_0_0.major); + } + + @Override + public List routes() { + return List.of( + new Route(GET, "/_msearch"), + new Route(POST, "/_msearch"), + new Route(GET, "/{index}/_msearch"), + new Route(POST, "/{index}/_msearch"), + // Deprecated typed endpoints. + new Route(GET, "/{index}/{type}/_msearch"), + new Route(POST, "/{index}/{type}/_msearch")); + } + + @Override + public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { + //request,hasTypes pair + Tuple multiSearchRequest = parseRequestWithTypes(request, allowExplicitIndex); + + // Emit a single deprecation message if any search request contains types. + if (multiSearchRequest.v2()) { + deprecationLogger.deprecatedAndMaybeLog("msearch_with_types", TYPES_DEPRECATION_MESSAGE); + } + return channel -> client.multiSearch(multiSearchRequest.v1(), new RestToXContentListener<>(channel)); + } + + /** + * Parses a {@link RestRequest} body and returns a {@link MultiSearchRequest} + */ + public static Tuple parseRequestWithTypes(RestRequest restRequest, boolean allowExplicitIndex) + throws IOException { + MultiSearchRequest multiRequest = new MultiSearchRequest(); + IndicesOptions indicesOptions = IndicesOptions.fromRequest(restRequest, multiRequest.indicesOptions()); + multiRequest.indicesOptions(indicesOptions); + if (restRequest.hasParam("max_concurrent_searches")) { + multiRequest.maxConcurrentSearchRequests(restRequest.paramAsInt("max_concurrent_searches", 0)); + } + + Integer preFilterShardSize = null; + if (restRequest.hasParam("pre_filter_shard_size")) { + preFilterShardSize = restRequest.paramAsInt("pre_filter_shard_size", SearchRequest.DEFAULT_PRE_FILTER_SHARD_SIZE); + } + + final Integer maxConcurrentShardRequests; + if (restRequest.hasParam("max_concurrent_shard_requests")) { + // only set if we have the parameter since we auto adjust the max concurrency on the coordinator + // based on the number of nodes in the cluster + maxConcurrentShardRequests = restRequest.paramAsInt("max_concurrent_shard_requests", Integer.MIN_VALUE); + } else { + maxConcurrentShardRequests = null; + } + + boolean hasTypes = parseMultiLineRequestWithTypes(restRequest, multiRequest.indicesOptions(), allowExplicitIndex, + (searchRequest, parser) -> { + searchRequest.source(SearchSourceBuilder.fromXContent(parser, false)); + RestSearchAction.checkRestTotalHits(restRequest, searchRequest); + multiRequest.add(searchRequest); + }); + List requests = multiRequest.requests(); + for (SearchRequest request : requests) { + // preserve if it's set on the request + if (preFilterShardSize != null && request.getPreFilterShardSize() == null) { + request.setPreFilterShardSize(preFilterShardSize); + } + if (maxConcurrentShardRequests != null) { + request.setMaxConcurrentShardRequests(maxConcurrentShardRequests); + } + } + return Tuple.tuple(multiRequest, hasTypes); + } + + /** + * Parses a multi-line {@link RestRequest} body, instantiating a {@link SearchRequest} for each line and applying the given consumer. + */ + public static boolean parseMultiLineRequestWithTypes(RestRequest request, IndicesOptions indicesOptions, boolean allowExplicitIndex, + CheckedBiConsumer consumer) throws IOException { + + String[] indices = Strings.splitStringByCommaToArray(request.param("index")); + String[] types = Strings.splitStringByCommaToArray(request.param("type")); + String searchType = request.param("search_type"); + boolean ccsMinimizeRoundtrips = request.paramAsBoolean("ccs_minimize_roundtrips", true); + String routing = request.param("routing"); + + final Tuple sourceTuple = request.contentOrSourceParam(); + final XContent xContent = sourceTuple.v1().xContent(); + final BytesReference data = sourceTuple.v2(); + return MultiSearchRequestV7Builder.readMultiLineFormat(data, xContent, consumer, indices, indicesOptions, types, routing, + searchType, ccsMinimizeRoundtrips, request.getXContentRegistry(), allowExplicitIndex, deprecationLogger); + } + +} diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestSearchActionV7.java similarity index 97% rename from modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestSearchActionV7.java rename to modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestSearchActionV7.java index 6d29596abb179..16e28bde9c536 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestSearchActionV7.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.rest.compat.version7; +package org.elasticsearch.rest.compat.version7.search; import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; diff --git a/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java b/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java index 9cf2a780471fc..f8d8826285584 100644 --- a/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java +++ b/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java @@ -33,6 +33,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.function.Consumer; import java.util.stream.StreamSupport; /** @@ -72,7 +73,12 @@ public static Iterable createParameters() throws Exception { private static void mutateTestCandidate(ClientYamlTestCandidate testCandidate) { - testCandidate.getTestSection().getExecutableSections().stream().filter(s -> s instanceof DoSection).forEach(ds -> { + testCandidate.getSetupSection().getExecutableSections().stream().filter(s -> s instanceof DoSection).forEach(updateDoSection()); + testCandidate.getTestSection().getExecutableSections().stream().filter(s -> s instanceof DoSection).forEach(updateDoSection()); + } + + private static Consumer updateDoSection() { + return ds -> { DoSection doSection = (DoSection) ds; //TODO: be more selective here doSection.setIgnoreWarnings(true); @@ -80,11 +86,11 @@ private static void mutateTestCandidate(ClientYamlTestCandidate testCandidate) { String compatibleHeader = createCompatibleHeader(); //TODO decide which one to use - Accept or Content-Type doSection.getApiCallSection() - .addHeaders(Map.of( - CompatibleConstants.COMPATIBLE_HEADER, compatibleHeader, - "Content-Type", compatibleHeader - )); - }); + .addHeaders(Map.of( + CompatibleConstants.COMPATIBLE_HEADER, compatibleHeader, + "Content-Type", compatibleHeader + )); + }; } private static String createCompatibleHeader() { From b94be5c2150d2c2cf93a1c290582bc850a1d394e Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 1 Apr 2020 09:24:50 +0200 Subject: [PATCH 09/38] types with consumer --- .../client/RequestConvertersTests.java | 3 +- .../rest/compat/RestCompatPlugin.java | 4 +- .../search/MultiSearchRequestV7Builder.java | 9 +- .../search/RestMultiSearchActionV7.java | 92 ++++--------------- .../action/search/MultiSearchRequest.java | 8 +- .../action/search/RestMultiSearchAction.java | 17 ++-- .../search/MultiSearchRequestTests.java | 5 +- 7 files changed, 50 insertions(+), 88 deletions(-) diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/RequestConvertersTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/RequestConvertersTests.java index 1360b58e0b1ec..f5c5c926efd26 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/RequestConvertersTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/RequestConvertersTests.java @@ -1223,7 +1223,8 @@ public void testMultiSearch() throws IOException { }; MultiSearchRequest.readMultiLineFormat(new BytesArray(EntityUtils.toByteArray(request.getEntity())), REQUEST_BODY_CONTENT_TYPE.xContent(), consumer, null, multiSearchRequest.indicesOptions(), null, null, null, - xContentRegistry(), true); + xContentRegistry(), true, (key, foundAlready) -> { + }); assertEquals(requests, multiSearchRequest.requests()); } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java index 6fb3fc09c0822..b1b5d26290869 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java @@ -58,9 +58,9 @@ public List getRestHandlers( new RestIndexActionV7.CompatibleRestIndexAction(), new RestIndexActionV7.CompatibleCreateHandler(), new RestIndexActionV7.CompatibleAutoIdHandler(nodesInCluster), - new RestCreateIndexActionV7(), + new RestCreateIndexActionV7()/*, new RestSearchActionV7(), - new RestMultiSearchActionV7(settings) + new RestMultiSearchActionV7(settings)*/ ); } return Collections.emptyList(); diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/MultiSearchRequestV7Builder.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/MultiSearchRequestV7Builder.java index 40e775195fa63..f27855290e63f 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/MultiSearchRequestV7Builder.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/MultiSearchRequestV7Builder.java @@ -32,6 +32,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.Map; +import java.util.function.Function; import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeBooleanValue; import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeStringArrayValue; @@ -53,7 +54,9 @@ public static boolean readMultiLineFormat(BytesReference data, Boolean ccsMinimizeRoundtrips, NamedXContentRegistry registry, boolean allowExplicitIndex, - DeprecationLogger deprecationLogger) throws IOException { + DeprecationLogger deprecationLogger, + Function compatibleApiConsumer + ) throws IOException { boolean hasTypes = false; int from = 0; @@ -157,6 +160,10 @@ public static boolean readMultiLineFormat(BytesReference data, return hasTypes; } + private static boolean consumedByCompatibleApi(Function compatibleApiConsumer, String key) { + return compatibleApiConsumer.apply(key); + } + public static int findNextMarker(byte marker, int from, BytesReference data) { final int res = data.indexOf(marker, from); if (res != -1) { diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7.java index a4c28bf17f885..25f271fa42e34 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7.java @@ -22,23 +22,14 @@ import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; import org.elasticsearch.action.search.MultiSearchRequest; -import org.elasticsearch.action.search.SearchRequest; -import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.CheckedBiConsumer; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.collect.Tuple; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; import org.elasticsearch.rest.action.search.RestMultiSearchAction; import org.elasticsearch.rest.action.search.RestSearchAction; -import org.elasticsearch.search.builder.SearchSourceBuilder; import java.io.IOException; import java.util.Arrays; @@ -46,6 +37,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.function.Function; import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.POST; @@ -88,80 +80,32 @@ public List routes() { new Route(POST, "/{index}/{type}/_msearch")); } + @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { - //request,hasTypes pair - Tuple multiSearchRequest = parseRequestWithTypes(request, allowExplicitIndex); - // Emit a single deprecation message if any search request contains types. - if (multiSearchRequest.v2()) { + TypeConsumer typeConsumer = new TypeConsumer(); + + MultiSearchRequest multiSearchRequest = parseRequest(request, allowExplicitIndex, typeConsumer); + if(hasTypes(typeConsumer,request)){ deprecationLogger.deprecatedAndMaybeLog("msearch_with_types", TYPES_DEPRECATION_MESSAGE); } - return channel -> client.multiSearch(multiSearchRequest.v1(), new RestToXContentListener<>(channel)); + return channel -> client.multiSearch(multiSearchRequest, new RestToXContentListener<>(channel)); } - /** - * Parses a {@link RestRequest} body and returns a {@link MultiSearchRequest} - */ - public static Tuple parseRequestWithTypes(RestRequest restRequest, boolean allowExplicitIndex) - throws IOException { - MultiSearchRequest multiRequest = new MultiSearchRequest(); - IndicesOptions indicesOptions = IndicesOptions.fromRequest(restRequest, multiRequest.indicesOptions()); - multiRequest.indicesOptions(indicesOptions); - if (restRequest.hasParam("max_concurrent_searches")) { - multiRequest.maxConcurrentSearchRequests(restRequest.paramAsInt("max_concurrent_searches", 0)); - } - - Integer preFilterShardSize = null; - if (restRequest.hasParam("pre_filter_shard_size")) { - preFilterShardSize = restRequest.paramAsInt("pre_filter_shard_size", SearchRequest.DEFAULT_PRE_FILTER_SHARD_SIZE); - } - - final Integer maxConcurrentShardRequests; - if (restRequest.hasParam("max_concurrent_shard_requests")) { - // only set if we have the parameter since we auto adjust the max concurrency on the coordinator - // based on the number of nodes in the cluster - maxConcurrentShardRequests = restRequest.paramAsInt("max_concurrent_shard_requests", Integer.MIN_VALUE); - } else { - maxConcurrentShardRequests = null; - } + private boolean hasTypes(TypeConsumer typeConsumer, RestRequest request) { + String[] types = Strings.splitStringByCommaToArray(request.param("type")); + return types.length > 0 || typeConsumer.foundTypeInBody; + } - boolean hasTypes = parseMultiLineRequestWithTypes(restRequest, multiRequest.indicesOptions(), allowExplicitIndex, - (searchRequest, parser) -> { - searchRequest.source(SearchSourceBuilder.fromXContent(parser, false)); - RestSearchAction.checkRestTotalHits(restRequest, searchRequest); - multiRequest.add(searchRequest); - }); - List requests = multiRequest.requests(); - for (SearchRequest request : requests) { - // preserve if it's set on the request - if (preFilterShardSize != null && request.getPreFilterShardSize() == null) { - request.setPreFilterShardSize(preFilterShardSize); - } - if (maxConcurrentShardRequests != null) { - request.setMaxConcurrentShardRequests(maxConcurrentShardRequests); + static class TypeConsumer implements Function { + boolean foundTypeInBody = false; + @Override + public Boolean apply(String key) { + if (key.equals("type") || key.equals("types")) { + foundTypeInBody = true; } + return foundTypeInBody; } - return Tuple.tuple(multiRequest, hasTypes); } - - /** - * Parses a multi-line {@link RestRequest} body, instantiating a {@link SearchRequest} for each line and applying the given consumer. - */ - public static boolean parseMultiLineRequestWithTypes(RestRequest request, IndicesOptions indicesOptions, boolean allowExplicitIndex, - CheckedBiConsumer consumer) throws IOException { - - String[] indices = Strings.splitStringByCommaToArray(request.param("index")); - String[] types = Strings.splitStringByCommaToArray(request.param("type")); - String searchType = request.param("search_type"); - boolean ccsMinimizeRoundtrips = request.paramAsBoolean("ccs_minimize_roundtrips", true); - String routing = request.param("routing"); - - final Tuple sourceTuple = request.contentOrSourceParam(); - final XContent xContent = sourceTuple.v1().xContent(); - final BytesReference data = sourceTuple.v2(); - return MultiSearchRequestV7Builder.readMultiLineFormat(data, xContent, consumer, indices, indicesOptions, types, routing, - searchType, ccsMinimizeRoundtrips, request.getXContentRegistry(), allowExplicitIndex, deprecationLogger); - } - } diff --git a/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java b/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java index 2fba92f5bab26..1d31bf2508876 100644 --- a/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java +++ b/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java @@ -43,6 +43,8 @@ import java.util.Locale; import java.util.Map; import java.util.Objects; +import java.util.function.BiConsumer; +import java.util.function.Function; import static org.elasticsearch.action.ValidateActions.addValidationError; import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeBooleanValue; @@ -177,7 +179,7 @@ public static void readMultiLineFormat(BytesReference data, String searchType, Boolean ccsMinimizeRoundtrips, NamedXContentRegistry registry, - boolean allowExplicitIndex) throws IOException { + boolean allowExplicitIndex, Function typeConsumer) throws IOException { int from = 0; byte marker = xContent.streamSeparator(); while (true) { @@ -239,7 +241,9 @@ public static void readMultiLineFormat(BytesReference data, } else if ("ignore_throttled".equals(entry.getKey()) || "ignoreThrottled".equals(entry.getKey())) { ignoreThrottled = value; } else { - throw new IllegalArgumentException("key [" + entry.getKey() + "] is not supported in the metadata section"); + if(typeConsumer.apply(entry.getKey()) == false){ + throw new IllegalArgumentException("key [" + entry.getKey() + "] is not supported in the metadata section"); + } } } defaultOptions = IndicesOptions.fromParameters(expandWildcards, ignoreUnavailable, allowNoIndices, ignoreThrottled, diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java index ee6cba31d26f1..f900684a56259 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java @@ -42,6 +42,8 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.function.BiConsumer; +import java.util.function.Function; import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.POST; @@ -83,10 +85,13 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC return channel -> client.multiSearch(multiSearchRequest, new RestToXContentListener<>(channel)); } - /** - * Parses a {@link RestRequest} body and returns a {@link MultiSearchRequest} - */ public static MultiSearchRequest parseRequest(RestRequest restRequest, boolean allowExplicitIndex) throws IOException { + return parseRequest(restRequest,allowExplicitIndex, key->false); + } + /** + * Parses a {@link RestRequest} body and returns a {@link MultiSearchRequest} + */ + public static MultiSearchRequest parseRequest(RestRequest restRequest, boolean allowExplicitIndex, Function typeConsumer) throws IOException { MultiSearchRequest multiRequest = new MultiSearchRequest(); IndicesOptions indicesOptions = IndicesOptions.fromRequest(restRequest, multiRequest.indicesOptions()); multiRequest.indicesOptions(indicesOptions); @@ -112,7 +117,7 @@ public static MultiSearchRequest parseRequest(RestRequest restRequest, boolean a searchRequest.source(SearchSourceBuilder.fromXContent(parser, false)); RestSearchAction.checkRestTotalHits(restRequest, searchRequest); multiRequest.add(searchRequest); - }); + }, typeConsumer); List requests = multiRequest.requests(); for (SearchRequest request : requests) { // preserve if it's set on the request @@ -130,7 +135,7 @@ public static MultiSearchRequest parseRequest(RestRequest restRequest, boolean a * Parses a multi-line {@link RestRequest} body, instantiating a {@link SearchRequest} for each line and applying the given consumer. */ public static void parseMultiLineRequest(RestRequest request, IndicesOptions indicesOptions, boolean allowExplicitIndex, - CheckedBiConsumer consumer) throws IOException { + CheckedBiConsumer consumer, Function typeConsumer) throws IOException { String[] indices = Strings.splitStringByCommaToArray(request.param("index")); String searchType = request.param("search_type"); @@ -141,7 +146,7 @@ public static void parseMultiLineRequest(RestRequest request, IndicesOptions ind final XContent xContent = sourceTuple.v1().xContent(); final BytesReference data = sourceTuple.v2(); MultiSearchRequest.readMultiLineFormat(data, xContent, consumer, indices, indicesOptions, routing, - searchType, ccsMinimizeRoundtrips, request.getXContentRegistry(), allowExplicitIndex); + searchType, ccsMinimizeRoundtrips, request.getXContentRegistry(), allowExplicitIndex, typeConsumer); } @Override diff --git a/server/src/test/java/org/elasticsearch/action/search/MultiSearchRequestTests.java b/server/src/test/java/org/elasticsearch/action/search/MultiSearchRequestTests.java index 11e586a6724a9..bf0bee6b16af0 100644 --- a/server/src/test/java/org/elasticsearch/action/search/MultiSearchRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/MultiSearchRequestTests.java @@ -229,7 +229,7 @@ private MultiSearchRequest parseMultiSearchRequest(String sample) throws IOExcep (searchRequest, parser) -> { searchRequest.source(SearchSourceBuilder.fromXContent(parser, false)); request.add(searchRequest); - }); + }, k->false); return request; } @@ -256,7 +256,8 @@ public void testMultiLineSerialization() throws IOException { parsedRequest.add(r); }; MultiSearchRequest.readMultiLineFormat(new BytesArray(originalBytes), xContentType.xContent(), - consumer, null, null, null, null, null, xContentRegistry(), true); + consumer, null, null, null, null, null, xContentRegistry(), true, + key -> false); assertEquals(originalRequest, parsedRequest); } } From f78e0211fb9c83949b6b161b071db548e829b8be Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 1 Apr 2020 10:18:31 +0200 Subject: [PATCH 10/38] cleanup type funciton --- .../client/RequestConvertersTests.java | 3 +- .../RestMultiSearchTemplateAction.java | 2 +- modules/rest-compatibility/build.gradle | 4 + .../search/MultiSearchRequestV7Builder.java | 178 ------------------ .../search/RestMultiSearchActionV7.java | 4 +- .../search/RestMultiSearchTemplateAction.java | 110 +++++++++++ .../action/search/MultiSearchRequest.java | 3 +- .../action/search/RestMultiSearchAction.java | 14 +- 8 files changed, 130 insertions(+), 188 deletions(-) delete mode 100644 modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/MultiSearchRequestV7Builder.java create mode 100644 modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchTemplateAction.java diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/RequestConvertersTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/RequestConvertersTests.java index f5c5c926efd26..bbdefddd4cb55 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/RequestConvertersTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/RequestConvertersTests.java @@ -1223,8 +1223,7 @@ public void testMultiSearch() throws IOException { }; MultiSearchRequest.readMultiLineFormat(new BytesArray(EntityUtils.toByteArray(request.getEntity())), REQUEST_BODY_CONTENT_TYPE.xContent(), consumer, null, multiSearchRequest.indicesOptions(), null, null, null, - xContentRegistry(), true, (key, foundAlready) -> { - }); + xContentRegistry(), true, key -> false); assertEquals(requests, multiSearchRequest.requests()); } diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java index 52052d5ad67ac..ae8bc401b0366 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java @@ -94,7 +94,7 @@ public static MultiSearchTemplateRequest parseRequest(RestRequest restRequest, b throw new IllegalArgumentException("Malformed search template"); } RestSearchAction.checkRestTotalHits(restRequest, searchRequest); - }); + }, k->false); return multiRequest; } diff --git a/modules/rest-compatibility/build.gradle b/modules/rest-compatibility/build.gradle index 96e81f07d823a..a069d3b5778d5 100644 --- a/modules/rest-compatibility/build.gradle +++ b/modules/rest-compatibility/build.gradle @@ -22,5 +22,9 @@ esplugin { classname 'org.elasticsearch.rest.compat.RestCompatPlugin' } +dependencies { + compile project(':modules:lang-mustache') +} + integTest.enabled = false test.enabled = true diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/MultiSearchRequestV7Builder.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/MultiSearchRequestV7Builder.java deleted file mode 100644 index f27855290e63f..0000000000000 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/MultiSearchRequestV7Builder.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.elasticsearch.rest.compat.version7.search; - -import org.elasticsearch.action.search.SearchRequest; -import org.elasticsearch.action.support.IndicesOptions; -import org.elasticsearch.common.CheckedBiConsumer; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentParser; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Map; -import java.util.function.Function; - -import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeBooleanValue; -import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeStringArrayValue; -import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeStringValue; - -/** - * A copy of v7 MultiSearchRequest static building/parsing methods that will provide information about containing types - */ -public class MultiSearchRequestV7Builder { - - public static boolean readMultiLineFormat(BytesReference data, - XContent xContent, - CheckedBiConsumer consumer, - String[] indices, - IndicesOptions indicesOptions, - String[] types, - String routing, - String searchType, - Boolean ccsMinimizeRoundtrips, - NamedXContentRegistry registry, - boolean allowExplicitIndex, - DeprecationLogger deprecationLogger, - Function compatibleApiConsumer - ) throws IOException { - - boolean hasTypes = false; - int from = 0; - byte marker = xContent.streamSeparator(); - while (true) { - int nextMarker = findNextMarker(marker, from, data); - if (nextMarker == -1) { - break; - } - // support first line with \n - if (nextMarker == 0) { - from = nextMarker + 1; - deprecationLogger.deprecated("support for empty first line before any action metadata in msearch API is deprecated and " + - "will be removed in the next major version"); - continue; - } - - SearchRequest searchRequest = new SearchRequest(); - if (indices != null) { - searchRequest.indices(indices); - } - if (indicesOptions != null) { - searchRequest.indicesOptions(indicesOptions); - } - if (types != null && types.length > 0) { - hasTypes = true; - } - if (routing != null) { - searchRequest.routing(routing); - } - if (searchType != null) { - searchRequest.searchType(searchType); - } - if (ccsMinimizeRoundtrips != null) { - searchRequest.setCcsMinimizeRoundtrips(ccsMinimizeRoundtrips); - } - IndicesOptions defaultOptions = searchRequest.indicesOptions(); - // now parse the action - if (nextMarker - from > 0) { - try (InputStream stream = data.slice(from, nextMarker - from).streamInput(); - XContentParser parser = xContent.createParser(registry, LoggingDeprecationHandler.INSTANCE, stream)) { - Map source = parser.map(); - Object expandWildcards = null; - Object ignoreUnavailable = null; - Object ignoreThrottled = null; - Object allowNoIndices = null; - for (Map.Entry entry : source.entrySet()) { - Object value = entry.getValue(); - if ("index".equals(entry.getKey()) || "indices".equals(entry.getKey())) { - if (!allowExplicitIndex) { - throw new IllegalArgumentException("explicit index in multi search is not allowed"); - } - searchRequest.indices(nodeStringArrayValue(value)); - } else if ("type".equals(entry.getKey()) || "types".equals(entry.getKey())) { - hasTypes = true; - } else if ("search_type".equals(entry.getKey()) || "searchType".equals(entry.getKey())) { - searchRequest.searchType(nodeStringValue(value, null)); - } else if ("ccs_minimize_roundtrips".equals(entry.getKey()) || "ccsMinimizeRoundtrips".equals(entry.getKey())) { - searchRequest.setCcsMinimizeRoundtrips(nodeBooleanValue(value)); - } else if ("request_cache".equals(entry.getKey()) || "requestCache".equals(entry.getKey())) { - searchRequest.requestCache(nodeBooleanValue(value, entry.getKey())); - } else if ("preference".equals(entry.getKey())) { - searchRequest.preference(nodeStringValue(value, null)); - } else if ("routing".equals(entry.getKey())) { - searchRequest.routing(nodeStringValue(value, null)); - } else if ("allow_partial_search_results".equals(entry.getKey())) { - searchRequest.allowPartialSearchResults(nodeBooleanValue(value, null)); - } else if ("expand_wildcards".equals(entry.getKey()) || "expandWildcards".equals(entry.getKey())) { - expandWildcards = value; - } else if ("ignore_unavailable".equals(entry.getKey()) || "ignoreUnavailable".equals(entry.getKey())) { - ignoreUnavailable = value; - } else if ("allow_no_indices".equals(entry.getKey()) || "allowNoIndices".equals(entry.getKey())) { - allowNoIndices = value; - } else if ("ignore_throttled".equals(entry.getKey()) || "ignoreThrottled".equals(entry.getKey())) { - ignoreThrottled = value; - } else { - throw new IllegalArgumentException("key [" + entry.getKey() + "] is not supported in the metadata section"); - } - } - defaultOptions = IndicesOptions.fromParameters(expandWildcards, ignoreUnavailable, allowNoIndices, ignoreThrottled, - defaultOptions); - } - } - searchRequest.indicesOptions(defaultOptions); - - // move pointers - from = nextMarker + 1; - // now for the body - nextMarker = findNextMarker(marker, from, data); - if (nextMarker == -1) { - break; - } - BytesReference bytes = data.slice(from, nextMarker - from); - try (InputStream stream = bytes.streamInput(); - XContentParser parser = xContent.createParser(registry, LoggingDeprecationHandler.INSTANCE, stream)) { - consumer.accept(searchRequest, parser); - } - // move pointers - from = nextMarker + 1; - } - return hasTypes; - } - - private static boolean consumedByCompatibleApi(Function compatibleApiConsumer, String key) { - return compatibleApiConsumer.apply(key); - } - - public static int findNextMarker(byte marker, int from, BytesReference data) { - final int res = data.indexOf(marker, from); - if (res != -1) { - assert res >= 0; - return res; - } - if (from != data.length()) { - throw new IllegalArgumentException("The msearch request must be terminated by a newline [\n]"); - } - return -1; - } -} diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7.java index 25f271fa42e34..70f299e429dbb 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7.java @@ -83,7 +83,6 @@ public List routes() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { - TypeConsumer typeConsumer = new TypeConsumer(); MultiSearchRequest multiSearchRequest = parseRequest(request, allowExplicitIndex, typeConsumer); @@ -104,8 +103,9 @@ static class TypeConsumer implements Function { public Boolean apply(String key) { if (key.equals("type") || key.equals("types")) { foundTypeInBody = true; + return true; } - return foundTypeInBody; + return false; } } } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchTemplateAction.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchTemplateAction.java new file mode 100644 index 0000000000000..af3e8efb226dd --- /dev/null +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchTemplateAction.java @@ -0,0 +1,110 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.rest.compat.version7.search; + +import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.rest.BaseRestHandler; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.RestToXContentListener; +import org.elasticsearch.rest.action.search.RestMultiSearchAction; +import org.elasticsearch.rest.action.search.RestSearchAction; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import static java.util.Arrays.asList; +import static org.elasticsearch.rest.RestRequest.Method.GET; +import static org.elasticsearch.rest.RestRequest.Method.POST; + +public class RestMultiSearchTemplateActionV7 extends RestMultiSearchTemplateActionV7 { + + private static final Set RESPONSE_PARAMS; + + static { + final Set responseParams = new HashSet<>( + asList(RestSearchAction.TYPED_KEYS_PARAM, RestSearchAction.TOTAL_HITS_AS_INT_PARAM) + ); + RESPONSE_PARAMS = Collections.unmodifiableSet(responseParams); + } + + + private final boolean allowExplicitIndex; + + public RestMultiSearchTemplateAction(Settings settings) { + this.allowExplicitIndex = MULTI_ALLOW_EXPLICIT_INDEX.get(settings); + } + + @Override + public List routes() { + return List.of( + new Route(GET, "/_msearch/template"), + new Route(POST, "/_msearch/template"), + new Route(GET, "/{index}/_msearch/template"), + new Route(POST, "/{index}/_msearch/template")); + } + + @Override + public String getName() { + return "multi_search_template_action"; + } + + @Override + public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { + MultiSearchTemplateRequest multiRequest = parseRequest(request, allowExplicitIndex); + return channel -> client.execute(MultiSearchTemplateAction.INSTANCE, multiRequest, new RestToXContentListener<>(channel)); + } + + /** + * Parses a {@link RestRequest} body and returns a {@link MultiSearchTemplateRequest} + */ + public static MultiSearchTemplateRequest parseRequest(RestRequest restRequest, boolean allowExplicitIndex) throws IOException { + MultiSearchTemplateRequest multiRequest = new MultiSearchTemplateRequest(); + if (restRequest.hasParam("max_concurrent_searches")) { + multiRequest.maxConcurrentSearchRequests(restRequest.paramAsInt("max_concurrent_searches", 0)); + } + + RestMultiSearchAction.parseMultiLineRequest(restRequest, multiRequest.indicesOptions(), allowExplicitIndex, + (searchRequest, bytes) -> { + SearchTemplateRequest searchTemplateRequest = SearchTemplateRequest.fromXContent(bytes); + if (searchTemplateRequest.getScript() != null) { + searchTemplateRequest.setRequest(searchRequest); + multiRequest.add(searchTemplateRequest); + } else { + throw new IllegalArgumentException("Malformed search template"); + } + RestSearchAction.checkRestTotalHits(restRequest, searchRequest); + }, k->false); + return multiRequest; + } + + @Override + public boolean supportsContentStream() { + return true; + } + + @Override + protected Set responseParams() { + return RESPONSE_PARAMS; + } +} diff --git a/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java b/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java index 1d31bf2508876..3c99e9a0e2f2e 100644 --- a/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java +++ b/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java @@ -179,7 +179,8 @@ public static void readMultiLineFormat(BytesReference data, String searchType, Boolean ccsMinimizeRoundtrips, NamedXContentRegistry registry, - boolean allowExplicitIndex, Function typeConsumer) throws IOException { + boolean allowExplicitIndex, + Function typeConsumer) throws IOException { int from = 0; byte marker = xContent.streamSeparator(); while (true) { diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java index f900684a56259..80071e0602210 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java @@ -88,10 +88,16 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC public static MultiSearchRequest parseRequest(RestRequest restRequest, boolean allowExplicitIndex) throws IOException { return parseRequest(restRequest,allowExplicitIndex, key->false); } - /** - * Parses a {@link RestRequest} body and returns a {@link MultiSearchRequest} - */ - public static MultiSearchRequest parseRequest(RestRequest restRequest, boolean allowExplicitIndex, Function typeConsumer) throws IOException { + + /** + * Parses a {@link RestRequest} body and returns a {@link MultiSearchRequest} + * + * @param typeConsumer - is a function used when parsing a request body. if it contains a types field it will consume it, + * allowing the same parsing logic to work in v7 and v8. + * It takes a string - field name, returns a boolean - if the field was "type or types" + */ + public static MultiSearchRequest parseRequest(RestRequest restRequest, boolean allowExplicitIndex, Function typeConsumer + /*TODO rename to unexpected field consumer?*/) throws IOException { MultiSearchRequest multiRequest = new MultiSearchRequest(); IndicesOptions indicesOptions = IndicesOptions.fromRequest(restRequest, multiRequest.indicesOptions()); multiRequest.indicesOptions(indicesOptions); From 9eb1c68fd15f8910cbf029ec41b9daa146dcdb4d Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 1 Apr 2020 12:10:09 +0200 Subject: [PATCH 11/38] packages fixed --- .../RestMultiSearchTemplateAction.java | 15 +++- modules/rest-compatibility/build.gradle | 1 + .../{rest => }/compat/RestCompatPlugin.java | 22 +++-- .../elasticsearch/compat/TypeConsumer.java | 48 ++++++++++ .../reindex/RestDeleteByQueryActionV7.java | 40 +++++++++ .../reindex/RestUpdateByQueryActionV7.java | 23 +++++ .../indices}/RestCreateIndexActionV7.java | 4 +- .../document}/RestGetActionV7.java | 4 +- .../document}/RestIndexActionV7.java | 4 +- .../search/RestMultiSearchActionV7.java | 52 ++--------- .../search/RestSearchActionV7.java | 8 +- .../RestMultiSearchTemplateActionV7.java} | 87 ++++++++++--------- .../mustache/RestSearchTemplateActionV7.java | 58 +++++++++++++ .../RestDeleteByQueryActionV7Tests.java | 64 ++++++++++++++ .../compat/version7/RestGetActionV7Tests.java | 1 + .../version7/RestIndexActionV7Tests.java | 1 + .../search/RestMultiSearchActionV7Tests.java | 66 ++++++++++++++ .../RestMultiSearchTemplateActionV7Tests.java | 67 ++++++++++++++ .../search/RestSearchActionV7Tests.java | 61 +++++++++++++ .../RestSearchTemplateActionV7Tests.java | 61 +++++++++++++ .../action/search/RestMultiSearchAction.java | 2 +- 21 files changed, 579 insertions(+), 110 deletions(-) rename modules/rest-compatibility/src/main/java/org/elasticsearch/{rest => }/compat/RestCompatPlugin.java (74%) create mode 100644 modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java create mode 100644 modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java create mode 100644 modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java rename modules/rest-compatibility/src/main/java/org/elasticsearch/rest/{compat/version7 => action/admin/indices}/RestCreateIndexActionV7.java (97%) rename modules/rest-compatibility/src/main/java/org/elasticsearch/rest/{compat/version7 => action/document}/RestGetActionV7.java (95%) rename modules/rest-compatibility/src/main/java/org/elasticsearch/rest/{compat/version7 => action/document}/RestIndexActionV7.java (97%) rename modules/rest-compatibility/src/main/java/org/elasticsearch/rest/{compat/version7 => action}/search/RestMultiSearchActionV7.java (59%) rename modules/rest-compatibility/src/main/java/org/elasticsearch/rest/{compat/version7 => action}/search/RestSearchActionV7.java (92%) rename modules/rest-compatibility/src/main/java/org/elasticsearch/{rest/compat/version7/search/RestMultiSearchTemplateAction.java => script/mustache/RestMultiSearchTemplateActionV7.java} (55%) create mode 100644 modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java create mode 100644 modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java create mode 100644 modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7Tests.java create mode 100644 modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchTemplateActionV7Tests.java create mode 100644 modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestSearchActionV7Tests.java create mode 100644 modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestSearchTemplateActionV7Tests.java diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java index ae8bc401b0366..e1856d651d362 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java @@ -32,6 +32,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.function.Function; import static java.util.Arrays.asList; import static org.elasticsearch.rest.RestRequest.Method.GET; @@ -49,7 +50,7 @@ public class RestMultiSearchTemplateAction extends BaseRestHandler { } - private final boolean allowExplicitIndex; + protected final boolean allowExplicitIndex; public RestMultiSearchTemplateAction(Settings settings) { this.allowExplicitIndex = MULTI_ALLOW_EXPLICIT_INDEX.get(settings); @@ -79,6 +80,16 @@ public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client * Parses a {@link RestRequest} body and returns a {@link MultiSearchTemplateRequest} */ public static MultiSearchTemplateRequest parseRequest(RestRequest restRequest, boolean allowExplicitIndex) throws IOException { + return parseRequest(restRequest,allowExplicitIndex, k->false); + } + + /** + * Parses a {@link RestRequest} body and returns a {@link MultiSearchTemplateRequest} + * @param typeConsumer - is a function used when parsing a request body. if it contains a types field it will consume it, + * allowing the same parsing logic to work in v7 and v8. + * It takes a string - field name, returns a boolean - if the field was "type or types" + */ + public static MultiSearchTemplateRequest parseRequest(RestRequest restRequest, boolean allowExplicitIndex, Function typeConsumer) throws IOException { MultiSearchTemplateRequest multiRequest = new MultiSearchTemplateRequest(); if (restRequest.hasParam("max_concurrent_searches")) { multiRequest.maxConcurrentSearchRequests(restRequest.paramAsInt("max_concurrent_searches", 0)); @@ -94,7 +105,7 @@ public static MultiSearchTemplateRequest parseRequest(RestRequest restRequest, b throw new IllegalArgumentException("Malformed search template"); } RestSearchAction.checkRestTotalHits(restRequest, searchRequest); - }, k->false); + }, typeConsumer); return multiRequest; } diff --git a/modules/rest-compatibility/build.gradle b/modules/rest-compatibility/build.gradle index a069d3b5778d5..49f9e97598f4d 100644 --- a/modules/rest-compatibility/build.gradle +++ b/modules/rest-compatibility/build.gradle @@ -24,6 +24,7 @@ esplugin { dependencies { compile project(':modules:lang-mustache') + compile project(':modules:reindex') } integTest.enabled = false diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/RestCompatPlugin.java similarity index 74% rename from modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java rename to modules/rest-compatibility/src/main/java/org/elasticsearch/compat/RestCompatPlugin.java index b1b5d26290869..d8378a8b79fc3 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/RestCompatPlugin.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/RestCompatPlugin.java @@ -7,7 +7,7 @@ * not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.rest.compat; +package org.elasticsearch.compat; import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; @@ -30,11 +30,13 @@ import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestHandler; -import org.elasticsearch.rest.compat.version7.RestCreateIndexActionV7; -import org.elasticsearch.rest.compat.version7.RestGetActionV7; -import org.elasticsearch.rest.compat.version7.RestIndexActionV7; -import org.elasticsearch.rest.compat.version7.search.RestSearchActionV7; -import org.elasticsearch.rest.compat.version7.search.RestMultiSearchActionV7; +import org.elasticsearch.rest.action.admin.indices.RestCreateIndexActionV7; +import org.elasticsearch.rest.action.document.RestGetActionV7; +import org.elasticsearch.rest.action.document.RestIndexActionV7; +import org.elasticsearch.rest.action.search.RestMultiSearchActionV7; +import org.elasticsearch.rest.action.search.RestSearchActionV7; +import org.elasticsearch.script.mustache.RestMultiSearchTemplateActionV7; +import org.elasticsearch.script.mustache.RestSearchTemplateActionV7; import java.util.Collections; import java.util.List; @@ -58,9 +60,11 @@ public List getRestHandlers( new RestIndexActionV7.CompatibleRestIndexAction(), new RestIndexActionV7.CompatibleCreateHandler(), new RestIndexActionV7.CompatibleAutoIdHandler(nodesInCluster), - new RestCreateIndexActionV7()/*, + new RestCreateIndexActionV7(), new RestSearchActionV7(), - new RestMultiSearchActionV7(settings)*/ + new RestMultiSearchActionV7(settings), + new RestSearchTemplateActionV7(), + new RestMultiSearchTemplateActionV7(settings) ); } return Collections.emptyList(); diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java new file mode 100644 index 0000000000000..2c22b152c9d6b --- /dev/null +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java @@ -0,0 +1,48 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.compat; + +import org.elasticsearch.common.Strings; +import org.elasticsearch.rest.RestRequest; + +import java.util.function.Function; + +public class TypeConsumer implements Function { + boolean foundTypeInBody = false; + private RestRequest request; + + public TypeConsumer(RestRequest request) { + this.request = request; + } + + @Override + public Boolean apply(String key) { + if (key.equals("type") || key.equals("types")) { + foundTypeInBody = true; + return true; + } + return false; + } + + public boolean hasTypes() { + String[] types = Strings.splitStringByCommaToArray(request.param("type")); + return types.length > 0 || foundTypeInBody; + } +} diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java new file mode 100644 index 0000000000000..22dd9ea517062 --- /dev/null +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java @@ -0,0 +1,40 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.index.reindex; + +import org.elasticsearch.Version; +import org.elasticsearch.index.reindex.RestDeleteByQueryAction; + +import java.util.List; + +import static org.elasticsearch.rest.RestRequest.Method.POST; + +public class RestDeleteByQueryActionV7 extends RestDeleteByQueryAction { + @Override + public List routes() { + return List.of(new Route(POST, "/{index}/_delete_by_query"), + new Route(POST, "/{index}/{type}/_delete_by_query")); + } + + @Override + public String compatibleWithVersion() { + return String.valueOf(Version.V_7_0_0.major); + } +} diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java new file mode 100644 index 0000000000000..89d9cb3152b0d --- /dev/null +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java @@ -0,0 +1,23 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.index.reindex; + +public class RestUpdateByQueryActionV7 { +} diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7.java similarity index 97% rename from modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java rename to modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7.java index 1aa97aee19b0d..d7babc4d50341 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7.java @@ -7,7 +7,7 @@ * not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.rest.compat.version7; +package org.elasticsearch.rest.action.admin.indices; import org.elasticsearch.Version; import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestGetActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestGetActionV7.java similarity index 95% rename from modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestGetActionV7.java rename to modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestGetActionV7.java index d779ff96ef9b2..971b84312b477 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestGetActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestGetActionV7.java @@ -7,7 +7,7 @@ * not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.rest.compat.version7; +package org.elasticsearch.rest.action.document; import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestIndexActionV7.java similarity index 97% rename from modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7.java rename to modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestIndexActionV7.java index 64cb3b87b9e43..ab8e878651c74 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestIndexActionV7.java @@ -7,7 +7,7 @@ * not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.rest.compat.version7; +package org.elasticsearch.rest.action.document; import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java similarity index 59% rename from modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7.java rename to modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java index 70f299e429dbb..ff4b2d9046599 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java @@ -17,50 +17,30 @@ * under the License. */ -package org.elasticsearch.rest.compat.version7.search; +package org.elasticsearch.rest.action.search; import org.apache.logging.log4j.LogManager; +import org.elasticsearch.compat.TypeConsumer; import org.elasticsearch.Version; import org.elasticsearch.action.search.MultiSearchRequest; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.Strings; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; -import org.elasticsearch.rest.action.search.RestMultiSearchAction; -import org.elasticsearch.rest.action.search.RestSearchAction; import java.io.IOException; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; import java.util.List; -import java.util.Set; -import java.util.function.Function; import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.POST; public class RestMultiSearchActionV7 extends RestMultiSearchAction { - private static final DeprecationLogger deprecationLogger = new DeprecationLogger( - LogManager.getLogger(RestMultiSearchAction.class)); - private static final String TYPES_DEPRECATION_MESSAGE = "[types removal]" + - " Specifying types in multi search requests is deprecated."; - - private static final Set RESPONSE_PARAMS; - - static { - final Set responseParams = new HashSet<>( - Arrays.asList(RestSearchAction.TYPED_KEYS_PARAM, RestSearchAction.TOTAL_HITS_AS_INT_PARAM) - ); - RESPONSE_PARAMS = Collections.unmodifiableSet(responseParams); - } - private final boolean allowExplicitIndex; + private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestMultiSearchAction.class)); + static final String TYPES_DEPRECATION_MESSAGE = "[types removal]" + " Specifying types in multi search requests is deprecated."; public RestMultiSearchActionV7(Settings settings) { super(settings); - this.allowExplicitIndex = MULTI_ALLOW_EXPLICIT_INDEX.get(settings); } @Override @@ -77,35 +57,19 @@ public List routes() { new Route(POST, "/{index}/_msearch"), // Deprecated typed endpoints. new Route(GET, "/{index}/{type}/_msearch"), - new Route(POST, "/{index}/{type}/_msearch")); + new Route(POST, "/{index}/{type}/_msearch") + ); } - @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { - TypeConsumer typeConsumer = new TypeConsumer(); + TypeConsumer typeConsumer = new TypeConsumer(request); MultiSearchRequest multiSearchRequest = parseRequest(request, allowExplicitIndex, typeConsumer); - if(hasTypes(typeConsumer,request)){ + if (typeConsumer.hasTypes()) { deprecationLogger.deprecatedAndMaybeLog("msearch_with_types", TYPES_DEPRECATION_MESSAGE); } return channel -> client.multiSearch(multiSearchRequest, new RestToXContentListener<>(channel)); } - private boolean hasTypes(TypeConsumer typeConsumer, RestRequest request) { - String[] types = Strings.splitStringByCommaToArray(request.param("type")); - return types.length > 0 || typeConsumer.foundTypeInBody; - } - - static class TypeConsumer implements Function { - boolean foundTypeInBody = false; - @Override - public Boolean apply(String key) { - if (key.equals("type") || key.equals("types")) { - foundTypeInBody = true; - return true; - } - return false; - } - } } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java similarity index 92% rename from modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestSearchActionV7.java rename to modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java index 16e28bde9c536..7515555165ae5 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.rest.compat.version7.search; +package org.elasticsearch.rest.action.search; import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; @@ -34,15 +34,13 @@ public class RestSearchActionV7 extends RestSearchAction { public static final String INCLUDE_TYPE_NAME_PARAMETER = "include_type_name"; - public static final String TYPES_DEPRECATION_MESSAGE = "[types removal]" + - " Specifying types in search requests is deprecated."; + public static final String TYPES_DEPRECATION_MESSAGE = "[types removal]" + " Specifying types in search requests is deprecated."; private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSearchAction.class)); @Override public List routes() { - return List.of(new Route(GET, "/{index}/{type}/_search"), - new Route(POST, "/{index}/{type}/_search")); + return List.of(new Route(GET, "/{index}/{type}/_search"), new Route(POST, "/{index}/{type}/_search")); } @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchTemplateAction.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java similarity index 55% rename from modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchTemplateAction.java rename to modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java index af3e8efb226dd..aae34867bb243 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchTemplateAction.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java @@ -7,7 +7,7 @@ * not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an @@ -17,42 +17,39 @@ * under the License. */ -package org.elasticsearch.rest.compat.version7.search; +package org.elasticsearch.script.mustache; +import org.apache.logging.log4j.LogManager; +import org.elasticsearch.compat.TypeConsumer; +import org.elasticsearch.Version; import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; import org.elasticsearch.rest.action.search.RestMultiSearchAction; import org.elasticsearch.rest.action.search.RestSearchAction; import java.io.IOException; -import java.util.Collections; -import java.util.HashSet; import java.util.List; -import java.util.Set; -import static java.util.Arrays.asList; import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.POST; -public class RestMultiSearchTemplateActionV7 extends RestMultiSearchTemplateActionV7 { +public class RestMultiSearchTemplateActionV7 extends RestMultiSearchTemplateAction { + private static final DeprecationLogger deprecationLogger = new DeprecationLogger( + LogManager.getLogger(RestMultiSearchTemplateAction.class) + ); + static final String TYPES_DEPRECATION_MESSAGE = "[types removal]" + + " Specifying types in multi search template requests is deprecated."; - private static final Set RESPONSE_PARAMS; - - static { - final Set responseParams = new HashSet<>( - asList(RestSearchAction.TYPED_KEYS_PARAM, RestSearchAction.TOTAL_HITS_AS_INT_PARAM) - ); - RESPONSE_PARAMS = Collections.unmodifiableSet(responseParams); + public RestMultiSearchTemplateActionV7(Settings settings) { + super(settings); } - - private final boolean allowExplicitIndex; - - public RestMultiSearchTemplateAction(Settings settings) { - this.allowExplicitIndex = MULTI_ALLOW_EXPLICIT_INDEX.get(settings); + @Override + public String compatibleWithVersion() { + return String.valueOf(Version.V_7_0_0.major); } @Override @@ -61,7 +58,12 @@ public List routes() { new Route(GET, "/_msearch/template"), new Route(POST, "/_msearch/template"), new Route(GET, "/{index}/_msearch/template"), - new Route(POST, "/{index}/_msearch/template")); + new Route(POST, "/{index}/_msearch/template"), + + // Deprecated typed endpoints. + new Route(GET, "/{index}/{type}/_msearch/template"), + new Route(POST, "/{index}/{type}/_msearch/template") + ); } @Override @@ -71,7 +73,11 @@ public String getName() { @Override public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { - MultiSearchTemplateRequest multiRequest = parseRequest(request, allowExplicitIndex); + TypeConsumer typeConsumer = new TypeConsumer(request); + MultiSearchTemplateRequest multiRequest = parseRequest(request, allowExplicitIndex, typeConsumer); + if (typeConsumer.hasTypes()) { + deprecationLogger.deprecatedAndMaybeLog("msearch_with_types", TYPES_DEPRECATION_MESSAGE); + } return channel -> client.execute(MultiSearchTemplateAction.INSTANCE, multiRequest, new RestToXContentListener<>(channel)); } @@ -84,27 +90,22 @@ public static MultiSearchTemplateRequest parseRequest(RestRequest restRequest, b multiRequest.maxConcurrentSearchRequests(restRequest.paramAsInt("max_concurrent_searches", 0)); } - RestMultiSearchAction.parseMultiLineRequest(restRequest, multiRequest.indicesOptions(), allowExplicitIndex, - (searchRequest, bytes) -> { - SearchTemplateRequest searchTemplateRequest = SearchTemplateRequest.fromXContent(bytes); - if (searchTemplateRequest.getScript() != null) { - searchTemplateRequest.setRequest(searchRequest); - multiRequest.add(searchTemplateRequest); - } else { - throw new IllegalArgumentException("Malformed search template"); - } - RestSearchAction.checkRestTotalHits(restRequest, searchRequest); - }, k->false); + RestMultiSearchAction.parseMultiLineRequest( + restRequest, + multiRequest.indicesOptions(), + allowExplicitIndex, + (searchRequest, bytes) -> { + SearchTemplateRequest searchTemplateRequest = SearchTemplateRequest.fromXContent(bytes); + if (searchTemplateRequest.getScript() != null) { + searchTemplateRequest.setRequest(searchRequest); + multiRequest.add(searchTemplateRequest); + } else { + throw new IllegalArgumentException("Malformed search template"); + } + RestSearchAction.checkRestTotalHits(restRequest, searchRequest); + }, + k -> false + ); return multiRequest; } - - @Override - public boolean supportsContentStream() { - return true; - } - - @Override - protected Set responseParams() { - return RESPONSE_PARAMS; - } } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java new file mode 100644 index 0000000000000..dff2f6a2b27b5 --- /dev/null +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java @@ -0,0 +1,58 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.script.mustache; + +import org.elasticsearch.Version; +import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.script.mustache.RestSearchTemplateAction; + +import java.io.IOException; +import java.util.List; + +import static org.elasticsearch.rest.RestRequest.Method.GET; +import static org.elasticsearch.rest.RestRequest.Method.POST; + +public class RestSearchTemplateActionV7 extends RestSearchTemplateAction { + + @Override + public List routes() { + return List.of( + new Route(GET, "/_search/template"), + new Route(POST, "/_search/template"), + new Route(GET, "/{index}/_search/template"), + new Route(POST, "/{index}/_search/template"), + // Deprecated typed endpoints. + new Route(GET, "/{index}/{type}/_search/template"), + new Route(POST, "/{index}/{type}/_search/template") + ); + } + + @Override + public String compatibleWithVersion() { + return String.valueOf(Version.V_7_0_0.major); + } + + @Override + public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { + request.param("type"); + return super.prepareRequest(request, client); + } +} diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java new file mode 100644 index 0000000000000..7dd4fe2888f63 --- /dev/null +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java @@ -0,0 +1,64 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.index.reindex; + +import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.search.RestSearchActionV7; +import org.elasticsearch.test.rest.FakeRestRequest; +import org.elasticsearch.test.rest.RestActionTestCase; +import org.junit.Before; + +import java.io.IOException; + +import static java.util.Collections.emptyList; + +public class RestDeleteByQueryActionV7Tests extends RestActionTestCase { + private RestDeleteByQueryActionV7 action; + + @Before + public void setUpAction() { + action = new RestDeleteByQueryActionV7(); + controller().registerHandler(action); + } + + public void testTypeInPath() throws IOException { + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) + .withMethod(RestRequest.Method.POST) + .withPath("/some_index/some_type/_delete_by_query") + .build(); + dispatchRequest(request); + + // checks the type in the URL is propagated correctly to the request object + // only works after the request is dispatched, so its params are filled from url. + DeleteByQueryRequest dbqRequest = action.buildRequest(request); +// assertArrayEquals(new String[]{"some_type"}, dbqRequest.getDocTypes()); + + // RestDeleteByQueryAction itself doesn't check for a deprecated type usage + // checking here for a deprecation from its internal search request + assertWarnings(RestSearchActionV7.TYPES_DEPRECATION_MESSAGE); + } + + public void testParseEmpty() throws IOException { + DeleteByQueryRequest request = action.buildRequest(new FakeRestRequest.Builder(new NamedXContentRegistry(emptyList())).build()); +// assertEquals(AbstractBulkByScrollRequest.SIZE_ALL_MATCHES, request.getSize()); + assertEquals(AbstractBulkByScrollRequest.DEFAULT_SCROLL_SIZE, request.getSearchRequest().source().size()); + } +} diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestGetActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestGetActionV7Tests.java index c84972ad4bb33..99057a01114b7 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestGetActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestGetActionV7Tests.java @@ -20,6 +20,7 @@ package org.elasticsearch.rest.compat.version7; import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.document.RestGetActionV7; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7Tests.java index 59946abdd3d8e..f72be18a520b1 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7Tests.java @@ -21,6 +21,7 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.document.RestIndexActionV7; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7Tests.java new file mode 100644 index 0000000000000..13bde8de2c995 --- /dev/null +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7Tests.java @@ -0,0 +1,66 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.rest.compat.version7.search; + +import org.elasticsearch.common.bytes.BytesArray; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.test.rest.FakeRestRequest; +import org.elasticsearch.test.rest.RestActionTestCase; +import org.junit.Before; + +import java.nio.charset.StandardCharsets; + +public class RestMultiSearchActionV7Tests extends RestActionTestCase { + + @Before + public void setUpAction() { + controller().registerHandler(new RestMultiSearchActionV7(Settings.EMPTY)); + } + + public void testTypeInPath() { + String content = "{ \"index\": \"some_index\" } \n {} \n"; + BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8)); + + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) + .withMethod(RestRequest.Method.GET) + .withPath("/some_index/some_type/_msearch") + .withContent(bytesContent, XContentType.JSON) + .build(); + + dispatchRequest(request); + assertWarnings(RestMultiSearchActionV7.TYPES_DEPRECATION_MESSAGE); + } + + public void testTypeInBody() { + String content = "{ \"index\": \"some_index\", \"type\": \"some_type\" } \n {} \n"; + BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8)); + + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) + .withMethod(RestRequest.Method.POST) + .withPath("/some_index/_msearch") + .withContent(bytesContent, XContentType.JSON) + .build(); + + dispatchRequest(request); + assertWarnings(RestMultiSearchActionV7.TYPES_DEPRECATION_MESSAGE); + } +} diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchTemplateActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchTemplateActionV7Tests.java new file mode 100644 index 0000000000000..892e5f26448ff --- /dev/null +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchTemplateActionV7Tests.java @@ -0,0 +1,67 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.elasticsearch.rest.compat.version7.search; + +import org.elasticsearch.common.bytes.BytesArray; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.script.mustache.RestMultiSearchTemplateActionV7; +import org.elasticsearch.test.rest.FakeRestRequest; +import org.elasticsearch.test.rest.RestActionTestCase; +import org.junit.Before; + +import java.nio.charset.StandardCharsets; + +public class RestMultiSearchTemplateActionV7Tests extends RestActionTestCase { + + @Before + public void setUpAction() { + controller().registerHandler(new RestMultiSearchTemplateActionV7(Settings.EMPTY)); + } + + public void testTypeInPath() { + String content = "{ \"index\": \"some_index\" } \n" + + "{\"source\": {\"query\" : {\"match_all\" :{}}}} \n"; + BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8)); + + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) + .withMethod(RestRequest.Method.GET) + .withPath("/some_index/some_type/_msearch/template") + .withContent(bytesContent, XContentType.JSON) + .build(); + + dispatchRequest(request); + assertWarnings(RestMultiSearchTemplateActionV7.TYPES_DEPRECATION_MESSAGE); + } + + public void testTypeInBody() { + String content = "{ \"index\": \"some_index\", \"type\": \"some_type\" } \n" + + "{\"source\": {\"query\" : {\"match_all\" :{}}}} \n"; + BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8)); + + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) + .withPath("/some_index/_msearch/template") + .withContent(bytesContent, XContentType.JSON) + .build(); + + dispatchRequest(request); + assertWarnings(RestMultiSearchTemplateActionV7.TYPES_DEPRECATION_MESSAGE); + } +} diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestSearchActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestSearchActionV7Tests.java new file mode 100644 index 0000000000000..b72f5a34c9b85 --- /dev/null +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestSearchActionV7Tests.java @@ -0,0 +1,61 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.rest.compat.version7.search; + +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.search.RestSearchActionV7; +import org.elasticsearch.test.rest.FakeRestRequest; +import org.elasticsearch.test.rest.RestActionTestCase; +import org.junit.Before; + +import java.util.HashMap; +import java.util.Map; + +public class RestSearchActionV7Tests extends RestActionTestCase { + + @Before + public void setUpAction() { + controller().registerHandler(new RestSearchActionV7()); + } + + public void testTypeInPath() { + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) + .withMethod(RestRequest.Method.GET) + .withPath("/some_index/some_type/_search") + .build(); + + dispatchRequest(request); + assertWarnings(RestSearchActionV7.TYPES_DEPRECATION_MESSAGE); + } + + public void testTypeParameter() { + Map params = new HashMap<>(); + params.put("type", "some_type"); + + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) + .withMethod(RestRequest.Method.GET) + .withPath("/some_index/_search") + .withParams(params) + .build(); + + dispatchRequest(request); + assertWarnings(RestSearchActionV7.TYPES_DEPRECATION_MESSAGE); + } +} diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestSearchTemplateActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestSearchTemplateActionV7Tests.java new file mode 100644 index 0000000000000..fb1cab1dda209 --- /dev/null +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestSearchTemplateActionV7Tests.java @@ -0,0 +1,61 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.elasticsearch.rest.compat.version7.search; + +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.search.RestSearchActionV7; +import org.elasticsearch.script.mustache.RestSearchTemplateActionV7; +import org.elasticsearch.test.rest.FakeRestRequest; +import org.elasticsearch.test.rest.RestActionTestCase; +import org.junit.Before; + +import java.util.HashMap; +import java.util.Map; + +public class RestSearchTemplateActionV7Tests extends RestActionTestCase { + + @Before + public void setUpAction() { + controller().registerHandler(new RestSearchTemplateActionV7()); + } + + public void testTypeInPath() { + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) + .withMethod(RestRequest.Method.GET) + .withPath("/some_index/some_type/_search/template") + .build(); + + dispatchRequest(request); + assertWarnings(RestSearchActionV7.TYPES_DEPRECATION_MESSAGE); + } + + public void testTypeParameter() { + Map params = new HashMap<>(); + params.put("type", "some_type"); + + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) + .withMethod(RestRequest.Method.GET) + .withPath("/some_index/_search/template") + .withParams(params) + .build(); + + dispatchRequest(request); + assertWarnings(RestSearchActionV7.TYPES_DEPRECATION_MESSAGE); + } +} diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java index 80071e0602210..f07341f80d585 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java @@ -59,7 +59,7 @@ public class RestMultiSearchAction extends BaseRestHandler { RESPONSE_PARAMS = Collections.unmodifiableSet(responseParams); } - private final boolean allowExplicitIndex; + protected final boolean allowExplicitIndex; public RestMultiSearchAction(Settings settings) { this.allowExplicitIndex = MULTI_ALLOW_EXPLICIT_INDEX.get(settings); From a421d56a4e914f3ea676ee14e4023a3b1e2a81cb Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 1 Apr 2020 13:01:23 +0200 Subject: [PATCH 12/38] update by query, delete by query, multi term and term --- .../compat/RestCompatPlugin.java | 11 ++- .../reindex/RestDeleteByQueryActionV7.java | 13 ++- .../reindex/RestUpdateByQueryActionV7.java | 26 +++++- .../RestMultiTermVectorsActionV7.java | 59 +++++++++++++ .../document/RestTermVectorsActionV7.java | 64 ++++++++++++++ .../search/RestMultiSearchActionV7.java | 1 + .../action/search/RestSearchActionV7.java | 3 +- .../RestMultiSearchTemplateActionV7.java | 2 + .../mustache/RestSearchTemplateActionV7.java | 4 - .../action/DocWriteResponseV7Tests.java | 4 +- .../reindex/RestUpdateByQueryActionTests.java | 65 ++++++++++++++ .../document}/RestGetActionV7Tests.java | 5 +- .../document}/RestIndexActionV7Tests.java | 5 +- .../RestMultiTermVectorsActionV7Tests.java | 86 +++++++++++++++++++ .../RestTermVectorsActionV7Tests.java | 66 ++++++++++++++ .../search/RestMultiSearchActionV7Tests.java | 4 +- .../search/RestSearchActionV7Tests.java | 5 +- .../RestMultiSearchTemplateActionV7Tests.java | 5 +- .../RestSearchTemplateActionV7Tests.java | 5 +- 19 files changed, 403 insertions(+), 30 deletions(-) create mode 100644 modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java create mode 100644 modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java create mode 100644 modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java rename modules/rest-compatibility/src/test/java/org/elasticsearch/rest/{compat/version7 => action/document}/RestGetActionV7Tests.java (93%) rename modules/rest-compatibility/src/test/java/org/elasticsearch/rest/{compat/version7 => action/document}/RestIndexActionV7Tests.java (95%) create mode 100644 modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java create mode 100644 modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7Tests.java rename modules/rest-compatibility/src/test/java/org/elasticsearch/rest/{compat/version7 => action}/search/RestMultiSearchActionV7Tests.java (95%) rename modules/rest-compatibility/src/test/java/org/elasticsearch/rest/{compat/version7 => action}/search/RestSearchActionV7Tests.java (92%) rename modules/rest-compatibility/src/test/java/org/elasticsearch/{rest/compat/version7/search => script/mustache}/RestMultiSearchTemplateActionV7Tests.java (93%) rename modules/rest-compatibility/src/test/java/org/elasticsearch/{rest/compat/version7/search => script/mustache}/RestSearchTemplateActionV7Tests.java (92%) diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/RestCompatPlugin.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/RestCompatPlugin.java index d8378a8b79fc3..b80235313c856 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/RestCompatPlugin.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/RestCompatPlugin.java @@ -26,6 +26,9 @@ import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; +import org.elasticsearch.index.reindex.RestDeleteByQueryActionV7; +import org.elasticsearch.index.reindex.RestUpdateByQueryAction; +import org.elasticsearch.index.reindex.RestUpdateByQueryActionV7; import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestController; @@ -33,6 +36,8 @@ import org.elasticsearch.rest.action.admin.indices.RestCreateIndexActionV7; import org.elasticsearch.rest.action.document.RestGetActionV7; import org.elasticsearch.rest.action.document.RestIndexActionV7; +import org.elasticsearch.rest.action.document.RestMultiTermVectorsActionV7; +import org.elasticsearch.rest.action.document.RestTermVectorsActionV7; import org.elasticsearch.rest.action.search.RestMultiSearchActionV7; import org.elasticsearch.rest.action.search.RestSearchActionV7; import org.elasticsearch.script.mustache.RestMultiSearchTemplateActionV7; @@ -56,11 +61,15 @@ public List getRestHandlers( ) { if (Version.CURRENT.major == 8) { return List.of( + new RestDeleteByQueryActionV7(), + new RestUpdateByQueryActionV7(), + new RestCreateIndexActionV7(), new RestGetActionV7(), new RestIndexActionV7.CompatibleRestIndexAction(), new RestIndexActionV7.CompatibleCreateHandler(), new RestIndexActionV7.CompatibleAutoIdHandler(nodesInCluster), - new RestCreateIndexActionV7(), + new RestTermVectorsActionV7(), + new RestMultiTermVectorsActionV7(), new RestSearchActionV7(), new RestMultiSearchActionV7(settings), new RestSearchTemplateActionV7(), diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java index 22dd9ea517062..b0f7abbfb8010 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java @@ -20,8 +20,10 @@ package org.elasticsearch.index.reindex; import org.elasticsearch.Version; -import org.elasticsearch.index.reindex.RestDeleteByQueryAction; +import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.rest.RestRequest; +import java.io.IOException; import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.POST; @@ -29,12 +31,17 @@ public class RestDeleteByQueryActionV7 extends RestDeleteByQueryAction { @Override public List routes() { - return List.of(new Route(POST, "/{index}/_delete_by_query"), - new Route(POST, "/{index}/{type}/_delete_by_query")); + return List.of(new Route(POST, "/{index}/{type}/_delete_by_query")); } @Override public String compatibleWithVersion() { return String.valueOf(Version.V_7_0_0.major); } + + @Override + public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { + request.param("type"); + return super.prepareRequest(request, client); + } } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java index 89d9cb3152b0d..98986fd14b4c6 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java @@ -19,5 +19,29 @@ package org.elasticsearch.index.reindex; -public class RestUpdateByQueryActionV7 { +import org.elasticsearch.Version; +import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.rest.RestRequest; + +import java.io.IOException; +import java.util.List; + +import static org.elasticsearch.rest.RestRequest.Method.POST; + +public class RestUpdateByQueryActionV7 extends RestUpdateByQueryAction { + @Override + public List routes() { + return List.of(new Route(POST, "/{index}/{type}/_update_by_query")); + } + + @Override + public String compatibleWithVersion() { + return String.valueOf(Version.V_7_0_0.major); + } + + @Override + public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { + request.param("type"); + return super.prepareRequest(request, client); + } } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java new file mode 100644 index 0000000000000..21df5789da7e9 --- /dev/null +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java @@ -0,0 +1,59 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.rest.action.document; + +import org.apache.logging.log4j.LogManager; +import org.elasticsearch.Version; +import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.common.logging.DeprecationLogger; +import org.elasticsearch.rest.RestRequest; + +import java.io.IOException; +import java.util.List; + +import static org.elasticsearch.rest.RestRequest.Method.GET; +import static org.elasticsearch.rest.RestRequest.Method.POST; + +public class RestMultiTermVectorsActionV7 extends RestMultiTermVectorsAction { + private static final DeprecationLogger deprecationLogger = new DeprecationLogger( + LogManager.getLogger(RestTermVectorsAction.class)); + static final String TYPES_DEPRECATION_MESSAGE = "[types removal] " + + "Specifying types in multi term vector requests is deprecated."; + + @Override + public List routes() { + return List.of(new Route(GET, "/{index}/{type}/_mtermvectors"), + new Route(POST, "/{index}/{type}/_mtermvectors")); + } + + @Override + public String compatibleWithVersion() { + return String.valueOf(Version.V_7_0_0.major); + } + + @Override + public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { + if (request.hasParam("type")) { + request.param("type"); + deprecationLogger.deprecatedAndMaybeLog("mtermvectors_with_types", TYPES_DEPRECATION_MESSAGE); + } + return super.prepareRequest(request, client); + } +} diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java new file mode 100644 index 0000000000000..8fcbaf54dd70d --- /dev/null +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java @@ -0,0 +1,64 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.rest.action.document; + +import org.apache.logging.log4j.LogManager; +import org.elasticsearch.Version; +import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.common.logging.DeprecationLogger; +import org.elasticsearch.rest.RestRequest; + +import java.io.IOException; +import java.util.List; + +import static org.elasticsearch.rest.RestRequest.Method.GET; +import static org.elasticsearch.rest.RestRequest.Method.POST; + +public class RestTermVectorsActionV7 extends RestTermVectorsAction { + private static final DeprecationLogger deprecationLogger = new DeprecationLogger( + LogManager.getLogger(RestTermVectorsAction.class)); + public static final String TYPES_DEPRECATION_MESSAGE = "[types removal] " + + "Specifying types in term vector requests is deprecated."; + + @Override + public List routes() { + return List.of( + // Deprecated typed endpoints. + new Route(GET, "/{index}/{type}/_termvectors"), + new Route(POST, "/{index}/{type}/_termvectors"), + new Route(GET, "/{index}/{type}/{id}/_termvectors"), + new Route(POST, "/{index}/{type}/{id}/_termvectors") + ); + } + + @Override + public String compatibleWithVersion() { + return String.valueOf(Version.V_7_0_0.major); + } + + @Override + public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { + if (request.hasParam("type")) { + request.param("type"); + deprecationLogger.deprecatedAndMaybeLog("termvectors_with_types", TYPES_DEPRECATION_MESSAGE); + } + return super.prepareRequest(request, client); + } +} diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java index ff4b2d9046599..2a8ce8467831f 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java @@ -63,6 +63,7 @@ public List routes() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { + request.param("type"); TypeConsumer typeConsumer = new TypeConsumer(request); MultiSearchRequest multiSearchRequest = parseRequest(request, allowExplicitIndex, typeConsumer); diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java index 7515555165ae5..891200935afd8 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java @@ -40,7 +40,8 @@ public class RestSearchActionV7 extends RestSearchAction { @Override public List routes() { - return List.of(new Route(GET, "/{index}/{type}/_search"), new Route(POST, "/{index}/{type}/_search")); + return List.of(new Route(GET, "/{index}/{type}/_search"), + new Route(POST, "/{index}/{type}/_search")); } @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java index aae34867bb243..84cce360ea93c 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java @@ -73,6 +73,8 @@ public String getName() { @Override public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { + request.param("type"); + TypeConsumer typeConsumer = new TypeConsumer(request); MultiSearchTemplateRequest multiRequest = parseRequest(request, allowExplicitIndex, typeConsumer); if (typeConsumer.hasTypes()) { diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java index dff2f6a2b27b5..5d0e3b494c3a0 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java @@ -35,10 +35,6 @@ public class RestSearchTemplateActionV7 extends RestSearchTemplateAction { @Override public List routes() { return List.of( - new Route(GET, "/_search/template"), - new Route(POST, "/_search/template"), - new Route(GET, "/{index}/_search/template"), - new Route(POST, "/{index}/_search/template"), // Deprecated typed endpoints. new Route(GET, "/{index}/{type}/_search/template"), new Route(POST, "/{index}/{type}/_search/template") diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/action/DocWriteResponseV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/action/DocWriteResponseV7Tests.java index 5815f08f6ee2f..e137f9d70e93a 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/action/DocWriteResponseV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/action/DocWriteResponseV7Tests.java @@ -31,9 +31,7 @@ import java.io.IOException; -import static org.hamcrest.Matchers.hasEntry; -import static org.hamcrest.Matchers.hasKey; -import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.*; public class DocWriteResponseV7Tests extends ESTestCase { diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java new file mode 100644 index 0000000000000..61f5b50caa36c --- /dev/null +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java @@ -0,0 +1,65 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.index.reindex; + +import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.search.RestSearchActionV7; +import org.elasticsearch.test.rest.FakeRestRequest; +import org.elasticsearch.test.rest.RestActionTestCase; +import org.junit.Before; + +import java.io.IOException; + +import static java.util.Collections.emptyList; + +public class RestUpdateByQueryActionTests extends RestActionTestCase { + + private RestUpdateByQueryAction action; + + @Before + public void setUpAction() { + action = new RestUpdateByQueryAction(); + controller().registerHandler(action); + } + + public void testTypeInPath() throws IOException { + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) + .withMethod(RestRequest.Method.POST) + .withPath("/some_index/some_type/_update_by_query") + .build(); + dispatchRequest(request); + + // checks the type in the URL is propagated correctly to the request object + // only works after the request is dispatched, so its params are filled from url. + UpdateByQueryRequest ubqRequest = action.buildRequest(request); +// assertArrayEquals(new String[]{"some_type"}, ubqRequest.getDocTypes()); + + // RestUpdateByQueryAction itself doesn't check for a deprecated type usage + // checking here for a deprecation from its internal search request + assertWarnings(RestSearchActionV7.TYPES_DEPRECATION_MESSAGE); + } + + public void testParseEmpty() throws IOException { + UpdateByQueryRequest request = action.buildRequest(new FakeRestRequest.Builder(new NamedXContentRegistry(emptyList())).build()); +// assertEquals(AbstractBulkByScrollRequest.SIZE_ALL_MATCHES, request.getSize()); + assertEquals(AbstractBulkByScrollRequest.DEFAULT_SCROLL_SIZE, request.getSearchRequest().source().size()); + } +} diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestGetActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestGetActionV7Tests.java similarity index 93% rename from modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestGetActionV7Tests.java rename to modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestGetActionV7Tests.java index 99057a01114b7..4ea277e1a3cd0 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestGetActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestGetActionV7Tests.java @@ -7,7 +7,7 @@ * not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an @@ -17,10 +17,9 @@ * under the License. */ -package org.elasticsearch.rest.compat.version7; +package org.elasticsearch.rest.action.document; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.rest.action.document.RestGetActionV7; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionV7Tests.java similarity index 95% rename from modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7Tests.java rename to modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionV7Tests.java index f72be18a520b1..afd05bd8c1cbc 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionV7Tests.java @@ -7,7 +7,7 @@ * not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an @@ -17,11 +17,10 @@ * under the License. */ -package org.elasticsearch.rest.compat.version7; +package org.elasticsearch.rest.action.document; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.rest.action.document.RestIndexActionV7; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java new file mode 100644 index 0000000000000..5fc9bc2564ced --- /dev/null +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java @@ -0,0 +1,86 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.rest.action.document; + +import org.elasticsearch.common.bytes.BytesReference; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.RestRequest.Method; +import org.elasticsearch.test.rest.FakeRestRequest; +import org.elasticsearch.test.rest.RestActionTestCase; +import org.junit.Before; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class RestMultiTermVectorsActionV7Tests extends RestActionTestCase { + + @Before + public void setUpAction() { + controller().registerHandler(new RestMultiTermVectorsAction()); + } + + public void testTypeInPath() { + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) + .withMethod(Method.POST) + .withPath("/some_index/some_type/_mtermvectors") + .build(); + + dispatchRequest(request); + assertWarnings(RestMultiTermVectorsActionV7.TYPES_DEPRECATION_MESSAGE); + } + + public void testTypeParameter() { + Map params = new HashMap<>(); + params.put("type", "some_type"); + + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) + .withMethod(Method.GET) + .withPath("/some_index/_mtermvectors") + .withParams(params) + .build(); + + dispatchRequest(request); + assertWarnings(RestMultiTermVectorsActionV7.TYPES_DEPRECATION_MESSAGE); + } + + public void testTypeInBody() throws IOException { + XContentBuilder content = XContentFactory.jsonBuilder().startObject() + .startArray("docs") + .startObject() + .field("_type", "some_type") + .field("_id", 1) + .endObject() + .endArray() + .endObject(); + + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) + .withMethod(Method.GET) + .withPath("/some_index/_mtermvectors") + .withContent(BytesReference.bytes(content), XContentType.JSON) + .build(); + + dispatchRequest(request); + assertWarnings(RestTermVectorsActionV7.TYPES_DEPRECATION_MESSAGE); + } +} diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7Tests.java new file mode 100644 index 0000000000000..b90b0ec2fc7d6 --- /dev/null +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7Tests.java @@ -0,0 +1,66 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.rest.action.document; + +import org.elasticsearch.common.bytes.BytesReference; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.RestRequest.Method; +import org.elasticsearch.test.rest.FakeRestRequest; +import org.elasticsearch.test.rest.RestActionTestCase; +import org.junit.Before; + +import java.io.IOException; + +public class RestTermVectorsActionV7Tests extends RestActionTestCase { + + @Before + public void setUpAction() { + controller().registerHandler(new RestMultiTermVectorsActionV7()); + } + + public void testTypeInPath() { + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) + .withMethod(Method.POST) + .withPath("/some_index/some_type/some_id/_termvectors") + .build(); + + dispatchRequest(request); + assertWarnings(RestTermVectorsActionV7.TYPES_DEPRECATION_MESSAGE); + } + + public void testTypeInBody() throws IOException { + XContentBuilder content = XContentFactory.jsonBuilder().startObject() + .field("_type", "some_type") + .field("_id", 1) + .endObject(); + + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) + .withMethod(Method.GET) + .withPath("/some_index/_termvectors/some_id") + .withContent(BytesReference.bytes(content), XContentType.JSON) + .build(); + + dispatchRequest(request); + assertWarnings(RestTermVectorsActionV7.TYPES_DEPRECATION_MESSAGE); + } +} diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7Tests.java similarity index 95% rename from modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7Tests.java rename to modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7Tests.java index 13bde8de2c995..430317d9bc6b6 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7Tests.java @@ -7,7 +7,7 @@ * not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.rest.compat.version7.search; +package org.elasticsearch.rest.action.search; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestSearchActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestSearchActionV7Tests.java similarity index 92% rename from modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestSearchActionV7Tests.java rename to modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestSearchActionV7Tests.java index b72f5a34c9b85..e069d84b2a3df 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestSearchActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestSearchActionV7Tests.java @@ -7,7 +7,7 @@ * not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an @@ -17,10 +17,9 @@ * under the License. */ -package org.elasticsearch.rest.compat.version7.search; +package org.elasticsearch.rest.action.search; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.rest.action.search.RestSearchActionV7; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchTemplateActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7Tests.java similarity index 93% rename from modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchTemplateActionV7Tests.java rename to modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7Tests.java index 892e5f26448ff..f8f60bc92eaba 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestMultiSearchTemplateActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7Tests.java @@ -7,7 +7,7 @@ * not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an @@ -16,13 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.rest.compat.version7.search; +package org.elasticsearch.script.mustache; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.script.mustache.RestMultiSearchTemplateActionV7; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestSearchTemplateActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7Tests.java similarity index 92% rename from modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestSearchTemplateActionV7Tests.java rename to modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7Tests.java index fb1cab1dda209..c7d7fde6c82ea 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/search/RestSearchTemplateActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7Tests.java @@ -7,7 +7,7 @@ * not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an @@ -16,11 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.rest.compat.version7.search; +package org.elasticsearch.script.mustache; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.search.RestSearchActionV7; -import org.elasticsearch.script.mustache.RestSearchTemplateActionV7; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; From 336414170a8bd11237ccaf473e2e57ddaacf7279 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 1 Apr 2020 13:07:15 +0200 Subject: [PATCH 13/38] package rename --- modules/rest-compatibility/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rest-compatibility/build.gradle b/modules/rest-compatibility/build.gradle index 49f9e97598f4d..505238da590a4 100644 --- a/modules/rest-compatibility/build.gradle +++ b/modules/rest-compatibility/build.gradle @@ -19,7 +19,7 @@ esplugin { description 'Adds a compatiblity layer for the prior major versions REST API' - classname 'org.elasticsearch.rest.compat.RestCompatPlugin' + classname 'org.elasticsearch.compat.RestCompatPlugin' } dependencies { From 8abcc0a255f9d03eebc5ed765333d33c807eefa1 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 1 Apr 2020 13:54:32 +0200 Subject: [PATCH 14/38] spotless --- .../org/elasticsearch/compat/RestCompatPlugin.java | 1 - .../admin/indices/RestCreateIndexActionV7.java | 1 - .../rest/action/document/RestGetActionV7.java | 1 - .../rest/action/document/RestIndexActionV7.java | 1 - .../document/RestMultiTermVectorsActionV7.java | 9 +++------ .../action/document/RestTermVectorsActionV7.java | 6 ++---- .../rest/action/search/RestSearchActionV7.java | 4 +--- .../script/mustache/RestSearchTemplateActionV7.java | 1 - .../reindex/RestDeleteByQueryActionV7Tests.java | 7 +++---- .../index/reindex/RestUpdateByQueryActionTests.java | 7 +++---- .../document/RestMultiTermVectorsActionV7Tests.java | 12 +++++------- .../document/RestTermVectorsActionV7Tests.java | 11 +++-------- .../action/search/RestMultiSearchActionV7Tests.java | 6 ++---- .../rest/action/search/RestSearchActionV7Tests.java | 6 ++---- .../RestMultiSearchTemplateActionV7Tests.java | 12 ++++-------- .../mustache/RestSearchTemplateActionV7Tests.java | 6 ++---- 16 files changed, 30 insertions(+), 61 deletions(-) diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/RestCompatPlugin.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/RestCompatPlugin.java index b80235313c856..f82ee1590c395 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/RestCompatPlugin.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/RestCompatPlugin.java @@ -27,7 +27,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.index.reindex.RestDeleteByQueryActionV7; -import org.elasticsearch.index.reindex.RestUpdateByQueryAction; import org.elasticsearch.index.reindex.RestUpdateByQueryActionV7; import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.Plugin; diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7.java index d7babc4d50341..aaa8d3860c44e 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7.java @@ -28,7 +28,6 @@ import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; -import org.elasticsearch.rest.action.admin.indices.RestCreateIndexAction; import java.io.IOException; import java.util.Collections; diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestGetActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestGetActionV7.java index 971b84312b477..37f2c10f1198f 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestGetActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestGetActionV7.java @@ -24,7 +24,6 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.rest.action.document.RestGetAction; import java.io.IOException; import java.util.List; diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestIndexActionV7.java index ab8e878651c74..08a52eb7d584b 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestIndexActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestIndexActionV7.java @@ -25,7 +25,6 @@ import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.rest.action.document.RestIndexAction; import java.io.IOException; import java.util.List; diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java index 21df5789da7e9..60cc2c2c4dc18 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java @@ -32,15 +32,12 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; public class RestMultiTermVectorsActionV7 extends RestMultiTermVectorsAction { - private static final DeprecationLogger deprecationLogger = new DeprecationLogger( - LogManager.getLogger(RestTermVectorsAction.class)); - static final String TYPES_DEPRECATION_MESSAGE = "[types removal] " + - "Specifying types in multi term vector requests is deprecated."; + private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestTermVectorsAction.class)); + static final String TYPES_DEPRECATION_MESSAGE = "[types removal] " + "Specifying types in multi term vector requests is deprecated."; @Override public List routes() { - return List.of(new Route(GET, "/{index}/{type}/_mtermvectors"), - new Route(POST, "/{index}/{type}/_mtermvectors")); + return List.of(new Route(GET, "/{index}/{type}/_mtermvectors"), new Route(POST, "/{index}/{type}/_mtermvectors")); } @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java index 8fcbaf54dd70d..a979575cf86ab 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java @@ -32,10 +32,8 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; public class RestTermVectorsActionV7 extends RestTermVectorsAction { - private static final DeprecationLogger deprecationLogger = new DeprecationLogger( - LogManager.getLogger(RestTermVectorsAction.class)); - public static final String TYPES_DEPRECATION_MESSAGE = "[types removal] " + - "Specifying types in term vector requests is deprecated."; + private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestTermVectorsAction.class)); + public static final String TYPES_DEPRECATION_MESSAGE = "[types removal] " + "Specifying types in term vector requests is deprecated."; @Override public List routes() { diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java index 891200935afd8..149391d228e56 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java @@ -24,7 +24,6 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.rest.action.search.RestSearchAction; import java.io.IOException; import java.util.List; @@ -40,8 +39,7 @@ public class RestSearchActionV7 extends RestSearchAction { @Override public List routes() { - return List.of(new Route(GET, "/{index}/{type}/_search"), - new Route(POST, "/{index}/{type}/_search")); + return List.of(new Route(GET, "/{index}/{type}/_search"), new Route(POST, "/{index}/{type}/_search")); } @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java index 5d0e3b494c3a0..6754f81d6fc0a 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java @@ -22,7 +22,6 @@ import org.elasticsearch.Version; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.script.mustache.RestSearchTemplateAction; import java.io.IOException; import java.util.List; diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java index 7dd4fe2888f63..44e8450a5614d 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java @@ -40,8 +40,7 @@ public void setUpAction() { } public void testTypeInPath() throws IOException { - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) - .withMethod(RestRequest.Method.POST) + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.POST) .withPath("/some_index/some_type/_delete_by_query") .build(); dispatchRequest(request); @@ -49,7 +48,7 @@ public void testTypeInPath() throws IOException { // checks the type in the URL is propagated correctly to the request object // only works after the request is dispatched, so its params are filled from url. DeleteByQueryRequest dbqRequest = action.buildRequest(request); -// assertArrayEquals(new String[]{"some_type"}, dbqRequest.getDocTypes()); + // assertArrayEquals(new String[]{"some_type"}, dbqRequest.getDocTypes()); // RestDeleteByQueryAction itself doesn't check for a deprecated type usage // checking here for a deprecation from its internal search request @@ -58,7 +57,7 @@ public void testTypeInPath() throws IOException { public void testParseEmpty() throws IOException { DeleteByQueryRequest request = action.buildRequest(new FakeRestRequest.Builder(new NamedXContentRegistry(emptyList())).build()); -// assertEquals(AbstractBulkByScrollRequest.SIZE_ALL_MATCHES, request.getSize()); + // assertEquals(AbstractBulkByScrollRequest.SIZE_ALL_MATCHES, request.getSize()); assertEquals(AbstractBulkByScrollRequest.DEFAULT_SCROLL_SIZE, request.getSearchRequest().source().size()); } } diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java index 61f5b50caa36c..82e3e117b1513 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java @@ -41,8 +41,7 @@ public void setUpAction() { } public void testTypeInPath() throws IOException { - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) - .withMethod(RestRequest.Method.POST) + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.POST) .withPath("/some_index/some_type/_update_by_query") .build(); dispatchRequest(request); @@ -50,7 +49,7 @@ public void testTypeInPath() throws IOException { // checks the type in the URL is propagated correctly to the request object // only works after the request is dispatched, so its params are filled from url. UpdateByQueryRequest ubqRequest = action.buildRequest(request); -// assertArrayEquals(new String[]{"some_type"}, ubqRequest.getDocTypes()); + // assertArrayEquals(new String[]{"some_type"}, ubqRequest.getDocTypes()); // RestUpdateByQueryAction itself doesn't check for a deprecated type usage // checking here for a deprecation from its internal search request @@ -59,7 +58,7 @@ public void testTypeInPath() throws IOException { public void testParseEmpty() throws IOException { UpdateByQueryRequest request = action.buildRequest(new FakeRestRequest.Builder(new NamedXContentRegistry(emptyList())).build()); -// assertEquals(AbstractBulkByScrollRequest.SIZE_ALL_MATCHES, request.getSize()); + // assertEquals(AbstractBulkByScrollRequest.SIZE_ALL_MATCHES, request.getSize()); assertEquals(AbstractBulkByScrollRequest.DEFAULT_SCROLL_SIZE, request.getSearchRequest().source().size()); } } diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java index 5fc9bc2564ced..aeab4c61d5c5b 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java @@ -41,8 +41,7 @@ public void setUpAction() { } public void testTypeInPath() { - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) - .withMethod(Method.POST) + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(Method.POST) .withPath("/some_index/some_type/_mtermvectors") .build(); @@ -54,8 +53,7 @@ public void testTypeParameter() { Map params = new HashMap<>(); params.put("type", "some_type"); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) - .withMethod(Method.GET) + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(Method.GET) .withPath("/some_index/_mtermvectors") .withParams(params) .build(); @@ -65,7 +63,8 @@ public void testTypeParameter() { } public void testTypeInBody() throws IOException { - XContentBuilder content = XContentFactory.jsonBuilder().startObject() + XContentBuilder content = XContentFactory.jsonBuilder() + .startObject() .startArray("docs") .startObject() .field("_type", "some_type") @@ -74,8 +73,7 @@ public void testTypeInBody() throws IOException { .endArray() .endObject(); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) - .withMethod(Method.GET) + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(Method.GET) .withPath("/some_index/_mtermvectors") .withContent(BytesReference.bytes(content), XContentType.JSON) .build(); diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7Tests.java index b90b0ec2fc7d6..1f810f8e19924 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7Tests.java @@ -39,8 +39,7 @@ public void setUpAction() { } public void testTypeInPath() { - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) - .withMethod(Method.POST) + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(Method.POST) .withPath("/some_index/some_type/some_id/_termvectors") .build(); @@ -49,13 +48,9 @@ public void testTypeInPath() { } public void testTypeInBody() throws IOException { - XContentBuilder content = XContentFactory.jsonBuilder().startObject() - .field("_type", "some_type") - .field("_id", 1) - .endObject(); + XContentBuilder content = XContentFactory.jsonBuilder().startObject().field("_type", "some_type").field("_id", 1).endObject(); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) - .withMethod(Method.GET) + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(Method.GET) .withPath("/some_index/_termvectors/some_id") .withContent(BytesReference.bytes(content), XContentType.JSON) .build(); diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7Tests.java index 430317d9bc6b6..72448b5f16cda 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7Tests.java @@ -40,8 +40,7 @@ public void testTypeInPath() { String content = "{ \"index\": \"some_index\" } \n {} \n"; BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8)); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) - .withMethod(RestRequest.Method.GET) + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.GET) .withPath("/some_index/some_type/_msearch") .withContent(bytesContent, XContentType.JSON) .build(); @@ -54,8 +53,7 @@ public void testTypeInBody() { String content = "{ \"index\": \"some_index\", \"type\": \"some_type\" } \n {} \n"; BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8)); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) - .withMethod(RestRequest.Method.POST) + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.POST) .withPath("/some_index/_msearch") .withContent(bytesContent, XContentType.JSON) .build(); diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestSearchActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestSearchActionV7Tests.java index e069d84b2a3df..1455293cdeb0c 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestSearchActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestSearchActionV7Tests.java @@ -35,8 +35,7 @@ public void setUpAction() { } public void testTypeInPath() { - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) - .withMethod(RestRequest.Method.GET) + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.GET) .withPath("/some_index/some_type/_search") .build(); @@ -48,8 +47,7 @@ public void testTypeParameter() { Map params = new HashMap<>(); params.put("type", "some_type"); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) - .withMethod(RestRequest.Method.GET) + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.GET) .withPath("/some_index/_search") .withParams(params) .build(); diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7Tests.java index f8f60bc92eaba..d3501165691a6 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7Tests.java @@ -36,12 +36,10 @@ public void setUpAction() { } public void testTypeInPath() { - String content = "{ \"index\": \"some_index\" } \n" + - "{\"source\": {\"query\" : {\"match_all\" :{}}}} \n"; + String content = "{ \"index\": \"some_index\" } \n" + "{\"source\": {\"query\" : {\"match_all\" :{}}}} \n"; BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8)); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) - .withMethod(RestRequest.Method.GET) + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.GET) .withPath("/some_index/some_type/_msearch/template") .withContent(bytesContent, XContentType.JSON) .build(); @@ -51,12 +49,10 @@ public void testTypeInPath() { } public void testTypeInBody() { - String content = "{ \"index\": \"some_index\", \"type\": \"some_type\" } \n" + - "{\"source\": {\"query\" : {\"match_all\" :{}}}} \n"; + String content = "{ \"index\": \"some_index\", \"type\": \"some_type\" } \n" + "{\"source\": {\"query\" : {\"match_all\" :{}}}} \n"; BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8)); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) - .withPath("/some_index/_msearch/template") + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withPath("/some_index/_msearch/template") .withContent(bytesContent, XContentType.JSON) .build(); diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7Tests.java index c7d7fde6c82ea..f9071ef3a6615 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7Tests.java @@ -35,8 +35,7 @@ public void setUpAction() { } public void testTypeInPath() { - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) - .withMethod(RestRequest.Method.GET) + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.GET) .withPath("/some_index/some_type/_search/template") .build(); @@ -48,8 +47,7 @@ public void testTypeParameter() { Map params = new HashMap<>(); params.put("type", "some_type"); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()) - .withMethod(RestRequest.Method.GET) + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.GET) .withPath("/some_index/_search/template") .withParams(params) .build(); From 6efdb306a31cb4ef5a0a5c0e8954a6665f1f674d Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 1 Apr 2020 14:06:41 +0200 Subject: [PATCH 15/38] checkstyle --- .../mustache/RestMultiSearchTemplateAction.java | 4 +++- .../action/DocWriteResponseV7Tests.java | 4 +++- .../action/search/MultiSearchRequest.java | 1 - .../rest/action/search/RestMultiSearchAction.java | 12 ++++++++---- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java index e1856d651d362..2ce168b39d407 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java @@ -89,7 +89,9 @@ public static MultiSearchTemplateRequest parseRequest(RestRequest restRequest, b * allowing the same parsing logic to work in v7 and v8. * It takes a string - field name, returns a boolean - if the field was "type or types" */ - public static MultiSearchTemplateRequest parseRequest(RestRequest restRequest, boolean allowExplicitIndex, Function typeConsumer) throws IOException { + public static MultiSearchTemplateRequest parseRequest(RestRequest restRequest, + boolean allowExplicitIndex, + Function typeConsumer) throws IOException { MultiSearchTemplateRequest multiRequest = new MultiSearchTemplateRequest(); if (restRequest.hasParam("max_concurrent_searches")) { multiRequest.maxConcurrentSearchRequests(restRequest.paramAsInt("max_concurrent_searches", 0)); diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/action/DocWriteResponseV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/action/DocWriteResponseV7Tests.java index e137f9d70e93a..5815f08f6ee2f 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/action/DocWriteResponseV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/action/DocWriteResponseV7Tests.java @@ -31,7 +31,9 @@ import java.io.IOException; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.hasEntry; +import static org.hamcrest.Matchers.hasKey; +import static org.hamcrest.Matchers.not; public class DocWriteResponseV7Tests extends ESTestCase { diff --git a/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java b/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java index 3c99e9a0e2f2e..ce570731dc10f 100644 --- a/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java +++ b/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java @@ -43,7 +43,6 @@ import java.util.Locale; import java.util.Map; import java.util.Objects; -import java.util.function.BiConsumer; import java.util.function.Function; import static org.elasticsearch.action.ValidateActions.addValidationError; diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java index f07341f80d585..19a32213f213c 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java @@ -42,7 +42,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.function.BiConsumer; import java.util.function.Function; import static org.elasticsearch.rest.RestRequest.Method.GET; @@ -96,7 +95,9 @@ public static MultiSearchRequest parseRequest(RestRequest restRequest, boolean a * allowing the same parsing logic to work in v7 and v8. * It takes a string - field name, returns a boolean - if the field was "type or types" */ - public static MultiSearchRequest parseRequest(RestRequest restRequest, boolean allowExplicitIndex, Function typeConsumer + public static MultiSearchRequest parseRequest(RestRequest restRequest, + boolean allowExplicitIndex, + Function typeConsumer /*TODO rename to unexpected field consumer?*/) throws IOException { MultiSearchRequest multiRequest = new MultiSearchRequest(); IndicesOptions indicesOptions = IndicesOptions.fromRequest(restRequest, multiRequest.indicesOptions()); @@ -140,8 +141,11 @@ public static MultiSearchRequest parseRequest(RestRequest restRequest, boolean a /** * Parses a multi-line {@link RestRequest} body, instantiating a {@link SearchRequest} for each line and applying the given consumer. */ - public static void parseMultiLineRequest(RestRequest request, IndicesOptions indicesOptions, boolean allowExplicitIndex, - CheckedBiConsumer consumer, Function typeConsumer) throws IOException { + public static void parseMultiLineRequest(RestRequest request, + IndicesOptions indicesOptions, + boolean allowExplicitIndex, + CheckedBiConsumer consumer, + Function typeConsumer) throws IOException { String[] indices = Strings.splitStringByCommaToArray(request.param("index")); String searchType = request.param("search_type"); From 90c37e21d4e4894cdf10c2f4d507ad3021fe1073 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 1 Apr 2020 15:37:43 +0200 Subject: [PATCH 16/38] fake request build iwth compat --- .../RestMultiTermVectorsActionV7.java | 7 ++- .../document/RestTermVectorsActionV7.java | 4 ++ .../action/search/RestSearchActionV7.java | 7 ++- .../mustache/RestSearchTemplateActionV7.java | 4 ++ .../compat/FakeCompatRestRequestBuilder.java | 44 +++++++++++++++++++ .../RestDeleteByQueryActionV7Tests.java | 6 +-- .../reindex/RestUpdateByQueryActionTests.java | 6 +-- .../action/document/RestGetActionV7Tests.java | 23 ++++------ .../document/RestIndexActionV7Tests.java | 18 ++------ .../RestMultiTermVectorsActionV7Tests.java | 10 ++--- .../RestTermVectorsActionV7Tests.java | 8 ++-- .../search/RestMultiSearchActionV7Tests.java | 6 +-- .../search/RestSearchActionV7Tests.java | 6 +-- .../RestMultiSearchTemplateActionV7Tests.java | 6 +-- .../RestSearchTemplateActionV7Tests.java | 6 +-- .../test/rest/FakeRestRequest.java | 5 +++ 16 files changed, 109 insertions(+), 57 deletions(-) create mode 100644 modules/rest-compatibility/src/test/java/org/elasticsearch/compat/FakeCompatRestRequestBuilder.java diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java index 60cc2c2c4dc18..d750ff19d14a5 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java @@ -37,7 +37,12 @@ public class RestMultiTermVectorsActionV7 extends RestMultiTermVectorsAction { @Override public List routes() { - return List.of(new Route(GET, "/{index}/{type}/_mtermvectors"), new Route(POST, "/{index}/{type}/_mtermvectors")); + return List.of(new Route(GET, "/_mtermvectors"), + new Route(POST, "/_mtermvectors"), + new Route(GET, "/{index}/_mtermvectors"), + new Route(POST, "/{index}/_mtermvectors"), + new Route(GET, "/{index}/{type}/_mtermvectors"), + new Route(POST, "/{index}/{type}/_mtermvectors")); } @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java index a979575cf86ab..35e4c1456b9f1 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java @@ -38,6 +38,10 @@ public class RestTermVectorsActionV7 extends RestTermVectorsAction { @Override public List routes() { return List.of( + new Route(GET, "/{index}/_termvectors"), + new Route(POST, "/{index}/_termvectors"), + new Route(GET, "/{index}/_termvectors/{id}"), + new Route(POST, "/{index}/_termvectors/{id}"), // Deprecated typed endpoints. new Route(GET, "/{index}/{type}/_termvectors"), new Route(POST, "/{index}/{type}/_termvectors"), diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java index 149391d228e56..4587f4f570839 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java @@ -39,7 +39,12 @@ public class RestSearchActionV7 extends RestSearchAction { @Override public List routes() { - return List.of(new Route(GET, "/{index}/{type}/_search"), new Route(POST, "/{index}/{type}/_search")); + return List.of( + new Route(GET, "/_search"), + new Route(POST, "/_search"), + new Route(GET, "/{index}/_search"), + new Route(POST, "/{index}/_search"), + new Route(GET, "/{index}/{type}/_search"), new Route(POST, "/{index}/{type}/_search")); } @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java index 6754f81d6fc0a..65d15f71febec 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java @@ -34,6 +34,10 @@ public class RestSearchTemplateActionV7 extends RestSearchTemplateAction { @Override public List routes() { return List.of( + new Route(GET, "/_search/template"), + new Route(POST, "/_search/template"), + new Route(GET, "/{index}/_search/template"), + new Route(POST, "/{index}/_search/template"), // Deprecated typed endpoints. new Route(GET, "/{index}/{type}/_search/template"), new Route(POST, "/{index}/{type}/_search/template") diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/compat/FakeCompatRestRequestBuilder.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/compat/FakeCompatRestRequestBuilder.java new file mode 100644 index 0000000000000..9c2d98ad2f4f0 --- /dev/null +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/compat/FakeCompatRestRequestBuilder.java @@ -0,0 +1,44 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.compat; + +import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.test.rest.FakeRestRequest; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import static org.elasticsearch.test.ESTestCase.randomFrom; + +public class FakeCompatRestRequestBuilder extends FakeRestRequest.Builder { + final String mimeType = randomFrom("application/vnd.elasticsearch+json;compatible-with=7"); + final List contentTypeHeader = Collections.singletonList(mimeType); + + public FakeCompatRestRequestBuilder(NamedXContentRegistry xContentRegistry) { + super(xContentRegistry); + } + + @Override + public FakeRestRequest build() { + addHeaders(Map.of("Content-Type", contentTypeHeader, "Accept", contentTypeHeader)); + return super.build(); + } +} diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java index 44e8450a5614d..e41c089467139 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java @@ -19,10 +19,10 @@ package org.elasticsearch.index.reindex; +import org.elasticsearch.compat.FakeCompatRestRequestBuilder; import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.search.RestSearchActionV7; -import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; @@ -40,7 +40,7 @@ public void setUpAction() { } public void testTypeInPath() throws IOException { - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.POST) + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(RestRequest.Method.POST) .withPath("/some_index/some_type/_delete_by_query") .build(); dispatchRequest(request); @@ -56,7 +56,7 @@ public void testTypeInPath() throws IOException { } public void testParseEmpty() throws IOException { - DeleteByQueryRequest request = action.buildRequest(new FakeRestRequest.Builder(new NamedXContentRegistry(emptyList())).build()); + DeleteByQueryRequest request = action.buildRequest(new FakeCompatRestRequestBuilder(new NamedXContentRegistry(emptyList())).build()); // assertEquals(AbstractBulkByScrollRequest.SIZE_ALL_MATCHES, request.getSize()); assertEquals(AbstractBulkByScrollRequest.DEFAULT_SCROLL_SIZE, request.getSearchRequest().source().size()); } diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java index 82e3e117b1513..f8dbd7eefcf2c 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java @@ -19,10 +19,10 @@ package org.elasticsearch.index.reindex; +import org.elasticsearch.compat.FakeCompatRestRequestBuilder; import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.search.RestSearchActionV7; -import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; @@ -41,7 +41,7 @@ public void setUpAction() { } public void testTypeInPath() throws IOException { - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.POST) + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(RestRequest.Method.POST) .withPath("/some_index/some_type/_update_by_query") .build(); dispatchRequest(request); @@ -57,7 +57,7 @@ public void testTypeInPath() throws IOException { } public void testParseEmpty() throws IOException { - UpdateByQueryRequest request = action.buildRequest(new FakeRestRequest.Builder(new NamedXContentRegistry(emptyList())).build()); + UpdateByQueryRequest request = action.buildRequest(new FakeCompatRestRequestBuilder(new NamedXContentRegistry(emptyList())).build()); // assertEquals(AbstractBulkByScrollRequest.SIZE_ALL_MATCHES, request.getSize()); assertEquals(AbstractBulkByScrollRequest.DEFAULT_SCROLL_SIZE, request.getSearchRequest().source().size()); } diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestGetActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestGetActionV7Tests.java index 4ea277e1a3cd0..5daad38cab713 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestGetActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestGetActionV7Tests.java @@ -19,18 +19,13 @@ package org.elasticsearch.rest.action.document; +import org.elasticsearch.compat.FakeCompatRestRequestBuilder; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; -import java.util.Collections; -import java.util.List; -import java.util.Map; - public class RestGetActionV7Tests extends RestActionTestCase { - final String mimeType = randomFrom("application/vnd.elasticsearch+json;compatible-with=7"); - final List contentTypeHeader = Collections.singletonList(mimeType); @Before public void setUpAction() { @@ -38,18 +33,18 @@ public void setUpAction() { } public void testTypeInPathWithGet() { - FakeRestRequest.Builder deprecatedRequest = new FakeRestRequest.Builder(xContentRegistry()).withHeaders( - Map.of("Content-Type", contentTypeHeader, "Accept", contentTypeHeader) - ).withPath("/some_index/some_type/some_id"); - dispatchRequest(deprecatedRequest.withMethod(RestRequest.Method.GET).build()); + FakeRestRequest deprecatedRequest = new FakeCompatRestRequestBuilder(xContentRegistry()).withPath("/some_index/some_type/some_id") + .withMethod(RestRequest.Method.GET) + .build(); + dispatchRequest(deprecatedRequest); assertWarnings(RestGetActionV7.TYPES_DEPRECATION_MESSAGE); } public void testTypeInPathWithHead() { - FakeRestRequest.Builder deprecatedRequest = new FakeRestRequest.Builder(xContentRegistry()).withHeaders( - Map.of("Content-Type", contentTypeHeader, "Accept", contentTypeHeader) - ).withPath("/some_index/some_type/some_id"); - dispatchRequest(deprecatedRequest.withMethod(RestRequest.Method.HEAD).build()); + FakeRestRequest deprecatedRequest = new FakeCompatRestRequestBuilder(xContentRegistry()).withPath("/some_index/some_type/some_id") + .withMethod(RestRequest.Method.HEAD) + .build(); + dispatchRequest(deprecatedRequest); assertWarnings(RestGetActionV7.TYPES_DEPRECATION_MESSAGE); } diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionV7Tests.java index afd05bd8c1cbc..74f4f9b2d3bf2 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionV7Tests.java @@ -19,22 +19,15 @@ package org.elasticsearch.rest.action.document; +import org.elasticsearch.compat.FakeCompatRestRequestBuilder; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; -import java.util.Collections; -import java.util.List; -import java.util.Map; import java.util.concurrent.atomic.AtomicReference; public class RestIndexActionV7Tests extends RestActionTestCase { - - final String mimeType = randomFrom("application/vnd.elasticsearch+json;compatible-with=7"); - final List contentTypeHeader = Collections.singletonList(mimeType); - private final AtomicReference clusterStateSupplier = new AtomicReference<>(); @Before @@ -46,8 +39,7 @@ public void setUpAction() { public void testTypeInPath() { // using CompatibleRestIndexAction - RestRequest deprecatedRequest = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.PUT) - .withHeaders(Map.of("Content-Type", contentTypeHeader, "Accept", contentTypeHeader)) + RestRequest deprecatedRequest = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(RestRequest.Method.PUT) .withPath("/some_index/some_type/some_id") .build(); dispatchRequest(deprecatedRequest); @@ -56,8 +48,7 @@ public void testTypeInPath() { public void testCreateWithTypeInPath() { // using CompatibleCreateHandler - RestRequest deprecatedRequest = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.PUT) - .withHeaders(Map.of("Content-Type", contentTypeHeader, "Accept", contentTypeHeader)) + RestRequest deprecatedRequest = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(RestRequest.Method.PUT) .withPath("/some_index/some_type/some_id/_create") .build(); dispatchRequest(deprecatedRequest); @@ -66,8 +57,7 @@ public void testCreateWithTypeInPath() { public void testAutoIdWithType() { // using CompatibleAutoIdHandler - RestRequest deprecatedRequest = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.POST) - .withHeaders(Map.of("Content-Type", contentTypeHeader, "Accept", contentTypeHeader)) + RestRequest deprecatedRequest = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(RestRequest.Method.POST) .withPath("/some_index/some_type/") .build(); dispatchRequest(deprecatedRequest); diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java index aeab4c61d5c5b..a48c1f683855b 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java @@ -19,13 +19,13 @@ package org.elasticsearch.rest.action.document; +import org.elasticsearch.compat.FakeCompatRestRequestBuilder; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequest.Method; -import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; @@ -37,11 +37,11 @@ public class RestMultiTermVectorsActionV7Tests extends RestActionTestCase { @Before public void setUpAction() { - controller().registerHandler(new RestMultiTermVectorsAction()); + controller().registerHandler(new RestMultiTermVectorsActionV7()); } public void testTypeInPath() { - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(Method.POST) + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(Method.POST) .withPath("/some_index/some_type/_mtermvectors") .build(); @@ -53,7 +53,7 @@ public void testTypeParameter() { Map params = new HashMap<>(); params.put("type", "some_type"); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(Method.GET) + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(Method.GET) .withPath("/some_index/_mtermvectors") .withParams(params) .build(); @@ -73,7 +73,7 @@ public void testTypeInBody() throws IOException { .endArray() .endObject(); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(Method.GET) + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(Method.GET) .withPath("/some_index/_mtermvectors") .withContent(BytesReference.bytes(content), XContentType.JSON) .build(); diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7Tests.java index 1f810f8e19924..3aa7503e74813 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7Tests.java @@ -19,13 +19,13 @@ package org.elasticsearch.rest.action.document; +import org.elasticsearch.compat.FakeCompatRestRequestBuilder; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequest.Method; -import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; @@ -35,11 +35,11 @@ public class RestTermVectorsActionV7Tests extends RestActionTestCase { @Before public void setUpAction() { - controller().registerHandler(new RestMultiTermVectorsActionV7()); + controller().registerHandler(new RestTermVectorsActionV7()); } public void testTypeInPath() { - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(Method.POST) + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(Method.POST) .withPath("/some_index/some_type/some_id/_termvectors") .build(); @@ -50,7 +50,7 @@ public void testTypeInPath() { public void testTypeInBody() throws IOException { XContentBuilder content = XContentFactory.jsonBuilder().startObject().field("_type", "some_type").field("_id", 1).endObject(); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(Method.GET) + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(Method.GET) .withPath("/some_index/_termvectors/some_id") .withContent(BytesReference.bytes(content), XContentType.JSON) .build(); diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7Tests.java index 72448b5f16cda..b221e9ebf6295 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7Tests.java @@ -19,11 +19,11 @@ package org.elasticsearch.rest.action.search; +import org.elasticsearch.compat.FakeCompatRestRequestBuilder; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; @@ -40,7 +40,7 @@ public void testTypeInPath() { String content = "{ \"index\": \"some_index\" } \n {} \n"; BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8)); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.GET) + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(RestRequest.Method.GET) .withPath("/some_index/some_type/_msearch") .withContent(bytesContent, XContentType.JSON) .build(); @@ -53,7 +53,7 @@ public void testTypeInBody() { String content = "{ \"index\": \"some_index\", \"type\": \"some_type\" } \n {} \n"; BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8)); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.POST) + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(RestRequest.Method.POST) .withPath("/some_index/_msearch") .withContent(bytesContent, XContentType.JSON) .build(); diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestSearchActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestSearchActionV7Tests.java index 1455293cdeb0c..66396725ec63c 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestSearchActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/search/RestSearchActionV7Tests.java @@ -19,8 +19,8 @@ package org.elasticsearch.rest.action.search; +import org.elasticsearch.compat.FakeCompatRestRequestBuilder; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; @@ -35,7 +35,7 @@ public void setUpAction() { } public void testTypeInPath() { - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.GET) + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(RestRequest.Method.GET) .withPath("/some_index/some_type/_search") .build(); @@ -47,7 +47,7 @@ public void testTypeParameter() { Map params = new HashMap<>(); params.put("type", "some_type"); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.GET) + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(RestRequest.Method.GET) .withPath("/some_index/_search") .withParams(params) .build(); diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7Tests.java index d3501165691a6..4b3439b2514b6 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7Tests.java @@ -18,11 +18,11 @@ */ package org.elasticsearch.script.mustache; +import org.elasticsearch.compat.FakeCompatRestRequestBuilder; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; @@ -39,7 +39,7 @@ public void testTypeInPath() { String content = "{ \"index\": \"some_index\" } \n" + "{\"source\": {\"query\" : {\"match_all\" :{}}}} \n"; BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8)); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.GET) + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(RestRequest.Method.GET) .withPath("/some_index/some_type/_msearch/template") .withContent(bytesContent, XContentType.JSON) .build(); @@ -52,7 +52,7 @@ public void testTypeInBody() { String content = "{ \"index\": \"some_index\", \"type\": \"some_type\" } \n" + "{\"source\": {\"query\" : {\"match_all\" :{}}}} \n"; BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8)); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withPath("/some_index/_msearch/template") + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withPath("/some_index/_msearch/template") .withContent(bytesContent, XContentType.JSON) .build(); diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7Tests.java index f9071ef3a6615..f22e159380be5 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7Tests.java @@ -18,9 +18,9 @@ */ package org.elasticsearch.script.mustache; +import org.elasticsearch.compat.FakeCompatRestRequestBuilder; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.search.RestSearchActionV7; -import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; @@ -35,7 +35,7 @@ public void setUpAction() { } public void testTypeInPath() { - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.GET) + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(RestRequest.Method.GET) .withPath("/some_index/some_type/_search/template") .build(); @@ -47,7 +47,7 @@ public void testTypeParameter() { Map params = new HashMap<>(); params.put("type", "some_type"); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.GET) + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(RestRequest.Method.GET) .withPath("/some_index/_search/template") .withParams(params) .build(); diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/FakeRestRequest.java b/test/framework/src/main/java/org/elasticsearch/test/rest/FakeRestRequest.java index 2f2f5fb76bfe7..cffce629b28e1 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/FakeRestRequest.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/FakeRestRequest.java @@ -182,6 +182,11 @@ public Builder(NamedXContentRegistry xContentRegistry) { this.xContentRegistry = xContentRegistry; } + public Builder addHeaders(Map> headers) { + this.headers.putAll(headers); + return this; + } + public Builder withHeaders(Map> headers) { this.headers = headers; return this; From 484e4aca9c8d11b923fa24a98c45fb9fead89409 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 1 Apr 2020 15:52:26 +0200 Subject: [PATCH 17/38] fixing some tests --- .../elasticsearch/compat/TypeConsumer.java | 15 ++++++--- .../document/RestTermVectorsActionV7.java | 32 +++++++++++++++++-- .../search/RestMultiSearchActionV7.java | 2 +- .../RestMultiSearchTemplateActionV7.java | 2 +- .../termvectors/TermVectorsRequest.java | 8 +++-- 5 files changed, 48 insertions(+), 11 deletions(-) diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java index 2c22b152c9d6b..448a457c3bd18 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java @@ -22,19 +22,23 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.rest.RestRequest; +import java.util.HashSet; +import java.util.Set; import java.util.function.Function; public class TypeConsumer implements Function { - boolean foundTypeInBody = false; - private RestRequest request; + private final RestRequest request; + private final Set fieldNames; + private boolean foundTypeInBody = false; - public TypeConsumer(RestRequest request) { + public TypeConsumer(RestRequest request, String ... fieldNames) { this.request = request; + this.fieldNames = Set.of(fieldNames); } @Override - public Boolean apply(String key) { - if (key.equals("type") || key.equals("types")) { + public Boolean apply(String fieldName) { + if (fieldNames.contains(fieldName)) { foundTypeInBody = true; return true; } @@ -42,6 +46,7 @@ public Boolean apply(String key) { } public boolean hasTypes() { + //TODO can params be types too? or _types? String[] types = Strings.splitStringByCommaToArray(request.param("type")); return types.length > 0 || foundTypeInBody; } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java index 35e4c1456b9f1..1cb914ddd4b0c 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java @@ -21,9 +21,13 @@ import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; +import org.elasticsearch.action.termvectors.TermVectorsRequest; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.logging.DeprecationLogger; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.compat.TypeConsumer; import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.RestToXContentListener; import java.io.IOException; import java.util.List; @@ -55,12 +59,36 @@ public String compatibleWithVersion() { return String.valueOf(Version.V_7_0_0.major); } +// @Override +// public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { +// TypeConsumer typeConsumer = new TypeConsumer(request); +// if (typeConsumer.hasTypes()) { +// request.param("type"); +// deprecationLogger.deprecatedAndMaybeLog("termvectors_with_types", TYPES_DEPRECATION_MESSAGE); +// } +// return super.prepareRequest(request, client); +// } + @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { - if (request.hasParam("type")) { + TypeConsumer typeConsumer = new TypeConsumer(request,"_type"); + + TermVectorsRequest termVectorsRequest = new TermVectorsRequest(request.param("index"), request.param("id")); + + if (request.hasContentOrSourceParam()) { + try (XContentParser parser = request.contentOrSourceParamParser()) { + TermVectorsRequest.parseRequest(termVectorsRequest, parser, typeConsumer); + } + } + readURIParameters(termVectorsRequest, request); + + if (typeConsumer.hasTypes()) { request.param("type"); deprecationLogger.deprecatedAndMaybeLog("termvectors_with_types", TYPES_DEPRECATION_MESSAGE); } - return super.prepareRequest(request, client); + + return channel -> client.termVectors(termVectorsRequest, new RestToXContentListener<>(channel)); } + + } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java index 2a8ce8467831f..8863fe45afa4c 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java @@ -64,7 +64,7 @@ public List routes() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { request.param("type"); - TypeConsumer typeConsumer = new TypeConsumer(request); + TypeConsumer typeConsumer = new TypeConsumer(request, "type", "types"); MultiSearchRequest multiSearchRequest = parseRequest(request, allowExplicitIndex, typeConsumer); if (typeConsumer.hasTypes()) { diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java index 84cce360ea93c..c47d14582087b 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java @@ -75,7 +75,7 @@ public String getName() { public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { request.param("type"); - TypeConsumer typeConsumer = new TypeConsumer(request); + TypeConsumer typeConsumer = new TypeConsumer(request, "type", "types"); MultiSearchTemplateRequest multiRequest = parseRequest(request, allowExplicitIndex, typeConsumer); if (typeConsumer.hasTypes()) { deprecationLogger.deprecatedAndMaybeLog("msearch_with_types", TYPES_DEPRECATION_MESSAGE); diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java index 09f7a15dff795..dc40b7b9b0df6 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java @@ -48,6 +48,7 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Function; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; @@ -528,11 +529,14 @@ public enum Flag { // the ordinal for encoding! Only append to the end! Positions, Offsets, Payloads, FieldStatistics, TermStatistics } + public static void parseRequest(TermVectorsRequest termVectorsRequest, XContentParser parser) throws IOException { + parseRequest(termVectorsRequest, parser, k -> false); + } /** * populates a request object (pre-populated with defaults) based on a parser. */ - public static void parseRequest(TermVectorsRequest termVectorsRequest, XContentParser parser) throws IOException { + public static void parseRequest(TermVectorsRequest termVectorsRequest, XContentParser parser, Function typeConsumer) throws IOException { XContentParser.Token token; String currentFieldName = null; List fields = new ArrayList<>(); @@ -585,7 +589,7 @@ public static void parseRequest(TermVectorsRequest termVectorsRequest, XContentP termVectorsRequest.version = parser.longValue(); } else if (VERSION_TYPE.match(currentFieldName, parser.getDeprecationHandler())) { termVectorsRequest.versionType = VersionType.fromString(parser.text()); - } else { + } else if(typeConsumer.apply(currentFieldName) == false) { throw new ElasticsearchParseException("failed to parse term vectors request. unknown field [{}]", currentFieldName); } } From 6184a9d07d97fb884601af6c0bb05b910b2e04c5 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Thu, 2 Apr 2020 09:05:43 +0200 Subject: [PATCH 18/38] term vector body not finished --- .../document/RestMultiTermVectorsActionV7.java | 17 ++++++++++++++++- .../document/RestTermVectorsActionV7.java | 10 ---------- .../RestMultiTermVectorsActionV7Tests.java | 4 +++- .../termvectors/MultiTermVectorsRequest.java | 7 +++++-- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java index d750ff19d14a5..abd4a0e53d4ae 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java @@ -21,9 +21,14 @@ import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; +import org.elasticsearch.action.termvectors.MultiTermVectorsRequest; +import org.elasticsearch.action.termvectors.TermVectorsRequest; import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.common.Strings; import org.elasticsearch.common.logging.DeprecationLogger; +import org.elasticsearch.compat.TypeConsumer; import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.RestToXContentListener; import java.io.IOException; import java.util.List; @@ -52,10 +57,20 @@ public String compatibleWithVersion() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { + TypeConsumer typeConsumer = new TypeConsumer(request, "_type"); + + MultiTermVectorsRequest multiTermVectorsRequest = new MultiTermVectorsRequest(); + TermVectorsRequest template = new TermVectorsRequest() + .index(request.param("index")); + + RestTermVectorsAction.readURIParameters(template, request); + multiTermVectorsRequest.ids(Strings.commaDelimitedListToStringArray(request.param("ids"))); + request.withContentOrSourceParamParserOrNull(p -> multiTermVectorsRequest.add(template, p, typeConsumer)); + if (request.hasParam("type")) { request.param("type"); deprecationLogger.deprecatedAndMaybeLog("mtermvectors_with_types", TYPES_DEPRECATION_MESSAGE); } - return super.prepareRequest(request, client); + return channel -> client.multiTermVectors(multiTermVectorsRequest, new RestToXContentListener<>(channel)); } } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java index 1cb914ddd4b0c..37d87148a5e70 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java @@ -59,16 +59,6 @@ public String compatibleWithVersion() { return String.valueOf(Version.V_7_0_0.major); } -// @Override -// public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { -// TypeConsumer typeConsumer = new TypeConsumer(request); -// if (typeConsumer.hasTypes()) { -// request.param("type"); -// deprecationLogger.deprecatedAndMaybeLog("termvectors_with_types", TYPES_DEPRECATION_MESSAGE); -// } -// return super.prepareRequest(request, client); -// } - @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { TypeConsumer typeConsumer = new TypeConsumer(request,"_type"); diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java index a48c1f683855b..6a86c789c95bc 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java @@ -79,6 +79,8 @@ public void testTypeInBody() throws IOException { .build(); dispatchRequest(request); - assertWarnings(RestTermVectorsActionV7.TYPES_DEPRECATION_MESSAGE); + //TODO change - now the deprecation warning is from MultiTermVectors.. +// assertWarnings(RestTermVectorsActionV7.TYPES_DEPRECATION_MESSAGE); + assertWarnings(RestMultiTermVectorsActionV7.TYPES_DEPRECATION_MESSAGE); } } diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java b/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java index 056947484a0f5..083e87d3bc4a0 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java @@ -37,6 +37,7 @@ import java.util.Iterator; import java.util.List; import java.util.Set; +import java.util.function.Function; public class MultiTermVectorsRequest extends ActionRequest implements Iterable, CompositeIndicesRequest, RealtimeRequest { @@ -98,8 +99,10 @@ public boolean isEmpty() { public List getRequests() { return requests; } - public void add(TermVectorsRequest template, @Nullable XContentParser parser) throws IOException { + add(template, parser, k->false); + } + public void add(TermVectorsRequest template, @Nullable XContentParser parser, Function typeConsumer) throws IOException { XContentParser.Token token; String currentFieldName = null; if (parser != null) { @@ -113,7 +116,7 @@ public void add(TermVectorsRequest template, @Nullable XContentParser parser) th throw new IllegalArgumentException("docs array element should include an object"); } TermVectorsRequest termVectorsRequest = new TermVectorsRequest(template); - TermVectorsRequest.parseRequest(termVectorsRequest, parser); + TermVectorsRequest.parseRequest(termVectorsRequest, parser, typeConsumer); add(termVectorsRequest); } } else if ("ids".equals(currentFieldName)) { From 1ee448754484179e05ab14815bbaa21ba02dca0a Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Thu, 2 Apr 2020 14:07:12 +0200 Subject: [PATCH 19/38] additional testing and using version --- .../version7/RestCreateIndexActionV7.java | 21 +++-- .../rest/compat/version7/RestGetActionV7.java | 4 +- .../compat/version7/RestIndexActionV7.java | 20 ++--- .../RestCreateIndexActionV7Tests.java | 76 +++++++++++++++++++ .../compat/version7/RestGetActionV7Tests.java | 2 +- .../version7/RestIndexActionV7Tests.java | 2 +- .../main/java/org/elasticsearch/Version.java | 4 + .../rest/AbstractRestChannel.java | 4 +- .../elasticsearch/rest/MethodHandlers.java | 31 +++++--- .../elasticsearch/rest/RestController.java | 18 +---- .../org/elasticsearch/rest/RestHandler.java | 4 +- .../org/elasticsearch/rest/RestRequest.java | 30 ++++---- .../http/DefaultRestChannelTests.java | 7 +- .../rest/RestControllerTests.java | 6 +- .../test/rest/FakeRestRequest.java | 2 +- .../test/rest/RestActionTestCase.java | 2 +- .../security/rest/SecurityRestFilter.java | 3 +- 17 files changed, 159 insertions(+), 77 deletions(-) create mode 100644 modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7Tests.java diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java index 1aa97aee19b0d..fefac2854409a 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java @@ -40,25 +40,29 @@ public class RestCreateIndexActionV7 extends RestCreateIndexAction { /** - * Parameter that controls whether certain REST apis should include type names in their requests or responses. - * Note: Support for this parameter will be removed after the transition period to typeless APIs. + * Parameter that controls whether certain REST apis should include type names in their requests. */ public static final String INCLUDE_TYPE_NAME_PARAMETER = "include_type_name"; - public static final boolean DEFAULT_INCLUDE_TYPE_NAME_POLICY = false; @Override - public String compatibleWithVersion() { - return String.valueOf(Version.V_7_0_0.major); + public Version compatibleWithVersion() { + return Version.V_7_0_0; } @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { + CreateIndexRequest createIndexRequest = prepareV7Request(request); + return channel -> client.admin().indices().create(createIndexRequest, new RestToXContentListener<>(channel)); + } + + // default scope for testing + CreateIndexRequest prepareV7Request(RestRequest request) { CreateIndexRequest createIndexRequest = new CreateIndexRequest(request.param("index")); if (request.hasContent()) { Map sourceAsMap = XContentHelper.convertToMap(request.requiredContent(), false, request.getXContentType()).v2(); - request.param(INCLUDE_TYPE_NAME_PARAMETER);// just consume, it is not replaced with _doc + request.param(INCLUDE_TYPE_NAME_PARAMETER);// just consume, it is always replaced with _doc sourceAsMap = prepareMappingsV7(sourceAsMap, request); createIndexRequest.source(sourceAsMap, LoggingDeprecationHandler.INSTANCE); @@ -67,11 +71,11 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC createIndexRequest.timeout(request.paramAsTime("timeout", createIndexRequest.timeout())); createIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", createIndexRequest.masterNodeTimeout())); createIndexRequest.waitForActiveShards(ActiveShardCount.parseString(request.param("wait_for_active_shards"))); - return channel -> client.admin().indices().create(createIndexRequest, new RestToXContentListener<>(channel)); + return createIndexRequest; } static Map prepareMappingsV7(Map source, RestRequest request) { - final boolean includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, DEFAULT_INCLUDE_TYPE_NAME_POLICY); + final boolean includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, false); @SuppressWarnings("unchecked") Map mappings = (Map) source.get("mappings"); @@ -84,6 +88,7 @@ static Map prepareMappingsV7(Map source, RestReq @SuppressWarnings("unchecked") Map typedMappings = (Map) mappings.get(typeName); + // the internal representation still uses single type `_doc`. newSource.put("mappings", Collections.singletonMap(MapperService.SINGLE_MAPPING_NAME, typedMappings)); return newSource; } else { diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestGetActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestGetActionV7.java index d779ff96ef9b2..c2b0a3ea5a651 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestGetActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestGetActionV7.java @@ -53,7 +53,7 @@ public RestChannelConsumer prepareRequest(RestRequest request, final NodeClient } @Override - public String compatibleWithVersion() { - return String.valueOf(Version.V_7_0_0.major); + public Version compatibleWithVersion() { + return Version.V_7_0_0; } } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7.java index 51d2e3db47e79..96de668823c5d 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7.java @@ -31,9 +31,7 @@ import java.util.List; import java.util.function.Supplier; -import static java.util.Arrays.asList; import static java.util.Collections.singletonList; -import static java.util.Collections.unmodifiableList; import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.rest.RestRequest.Method.PUT; @@ -50,7 +48,7 @@ private static void logDeprecationMessage() { public static class CompatibleRestIndexAction extends RestIndexAction { @Override public List routes() { - assert Version.CURRENT.major == 8 : "REST API compatilbity for version 7 is only supported on version 8"; + assert Version.CURRENT.major == 8 : "REST API compatibility for version 7 is only supported on version 8"; return List.of(new Route(POST, "/{index}/{type}/{id}"), new Route(PUT, "/{index}/{type}/{id}")); } @@ -63,17 +61,15 @@ public RestChannelConsumer prepareRequest(RestRequest request, final NodeClient } @Override - public String compatibleWithVersion() { - return String.valueOf(Version.V_7_0_0.major); + public Version compatibleWithVersion() { + return Version.V_7_0_0; } } public static class CompatibleCreateHandler extends RestIndexAction.CreateHandler { @Override public List routes() { - return unmodifiableList( - asList(new Route(POST, "/{index}/{type}/{id}/_create"), new Route(PUT, "/{index}/{type}/{id}/_create")) - ); + return List.of(new Route(POST, "/{index}/{type}/{id}/_create"), new Route(PUT, "/{index}/{type}/{id}/_create")); } @Override @@ -84,8 +80,8 @@ public RestChannelConsumer prepareRequest(RestRequest request, final NodeClient } @Override - public String compatibleWithVersion() { - return String.valueOf(Version.V_7_0_0.major); + public Version compatibleWithVersion() { + return Version.V_7_0_0; } } @@ -108,8 +104,8 @@ public RestChannelConsumer prepareRequest(RestRequest request, final NodeClient } @Override - public String compatibleWithVersion() { - return String.valueOf(Version.V_7_0_0.major); + public Version compatibleWithVersion() { + return Version.V_7_0_0; } } } diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7Tests.java new file mode 100644 index 0000000000000..c405fe12549c9 --- /dev/null +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7Tests.java @@ -0,0 +1,76 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.rest.compat.version7; + +import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; +import org.elasticsearch.common.bytes.BytesArray; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.test.rest.FakeRestRequest; +import org.elasticsearch.test.rest.RestActionTestCase; +import org.junit.Before; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.hamcrest.Matchers.equalTo; + +public class RestCreateIndexActionV7Tests extends RestActionTestCase { + + String mimeType = "application/vnd.elasticsearch+json;compatible-with=7"; + List contentTypeHeader = Collections.singletonList(mimeType); + + RestCreateIndexActionV7 restHandler = new RestCreateIndexActionV7(); + + @Before + public void setUpAction() { + controller().registerHandler(restHandler); + + } + + public void testTypeInMapping() throws IOException { + String content = "{\n" + + " \"mappings\": {\n" + + " \"some_type\": {\n" + + " \"properties\": {\n" + + " \"field1\": {\n" + + " \"type\": \"text\"\n" + + " }\n" + + " }\n" + + " }\n" + + " }\n" + + "}"; + + Map params = new HashMap<>(); + params.put(RestCreateIndexActionV7.INCLUDE_TYPE_NAME_PARAMETER, "true"); + RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.PUT) + .withHeaders(Map.of("Content-Type", contentTypeHeader, "Accept", contentTypeHeader)) + .withPath("/some_index") + .withParams(params) + .withContent(new BytesArray(content), null) + .build(); + + CreateIndexRequest createIndexRequest = restHandler.prepareV7Request(request); + // some_type is replaced with _doc + assertThat(createIndexRequest.mappings(), equalTo("{\"_doc\":{\"properties\":{\"field1\":{\"type\":\"text\"}}}}")); + } +} diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestGetActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestGetActionV7Tests.java index c84972ad4bb33..124138ea2a142 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestGetActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestGetActionV7Tests.java @@ -29,7 +29,7 @@ import java.util.Map; public class RestGetActionV7Tests extends RestActionTestCase { - final String mimeType = randomFrom("application/vnd.elasticsearch+json;compatible-with=7"); + final String mimeType = "application/vnd.elasticsearch+json;compatible-with=7"; final List contentTypeHeader = Collections.singletonList(mimeType); @Before diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7Tests.java index 59946abdd3d8e..6fb7b2dfac2f2 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/compat/version7/RestIndexActionV7Tests.java @@ -32,7 +32,7 @@ public class RestIndexActionV7Tests extends RestActionTestCase { - final String mimeType = randomFrom("application/vnd.elasticsearch+json;compatible-with=7"); + final String mimeType = "application/vnd.elasticsearch+json;compatible-with=7"; final List contentTypeHeader = Collections.singletonList(mimeType); private final AtomicReference clusterStateSupplier = new AtomicReference<>(); diff --git a/server/src/main/java/org/elasticsearch/Version.java b/server/src/main/java/org/elasticsearch/Version.java index 120adc9faca0e..e1c5d8c59d102 100644 --- a/server/src/main/java/org/elasticsearch/Version.java +++ b/server/src/main/java/org/elasticsearch/Version.java @@ -246,6 +246,10 @@ public static Version fromString(String version) { this.luceneVersion = Objects.requireNonNull(luceneVersion); } + public static Version forCompatibleApiVersion(String compatibleVersion) { + return Version.CURRENT; + } + public boolean after(Version version) { return version.id < id; } diff --git a/server/src/main/java/org/elasticsearch/rest/AbstractRestChannel.java b/server/src/main/java/org/elasticsearch/rest/AbstractRestChannel.java index dc378ab0d4117..7a6abc34d6b60 100644 --- a/server/src/main/java/org/elasticsearch/rest/AbstractRestChannel.java +++ b/server/src/main/java/org/elasticsearch/rest/AbstractRestChannel.java @@ -127,8 +127,8 @@ public XContentBuilder newBuilder(@Nullable XContentType requestContentType, @Nu } builder.humanReadable(human); - String compatibleVersion = request.param(CompatibleConstants.COMPATIBLE_PARAMS_KEY); - builder.setCompatibleMajorVersion(compatibleVersion == null ? -1 : Byte.parseByte(compatibleVersion)); + + builder.setCompatibleMajorVersion(request.getCompatibleApiVersion().major); return builder; } diff --git a/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java b/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java index 483a8e5a556d5..9e46e7686a6fe 100644 --- a/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java +++ b/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java @@ -32,15 +32,14 @@ final class MethodHandlers { private final String path; - //TODO maybe we should aim for having a type for version instead of string/byte - private final Map> methodHandlers; + private final Map> methodHandlers; - MethodHandlers(String path, RestHandler handler, String version, RestRequest.Method... methods) { + MethodHandlers(String path, RestHandler handler, Version version, RestRequest.Method... methods) { this.path = path; this.methodHandlers = new HashMap<>(methods.length); for (RestRequest.Method method : methods) { - methodHandlers.putIfAbsent(method, new HashMap<>()); - methodHandlers.get(method).put(version, handler); + methodHandlers.computeIfAbsent(method, k -> new HashMap<>()) + .put(version, handler); } } @@ -48,10 +47,10 @@ final class MethodHandlers { * Add a handler for an additional array of methods. Note that {@code MethodHandlers} * does not allow replacing the handler for an already existing method. */ - MethodHandlers addMethods(RestHandler handler, String version, RestRequest.Method... methods) { + MethodHandlers addMethods(RestHandler handler, Version version, RestRequest.Method... methods) { for (RestRequest.Method method : methods) { - methodHandlers.putIfAbsent(method, new HashMap<>()); - RestHandler existing = methodHandlers.get(method).put(version, handler); + RestHandler existing = methodHandlers.computeIfAbsent(method, k -> new HashMap<>()) + .put(version, handler); if (existing != null) { throw new IllegalArgumentException("Cannot replace existing handler for [" + path + "] for method: " + method); } @@ -59,13 +58,23 @@ MethodHandlers addMethods(RestHandler handler, String version, RestRequest.Metho return this; } + /** + * Return a handler for a given method and a version + * If a handler for a given version is not found, the handler for Version.CURRENT is returned. + * When using compatible API and compatible-with header, it is possible that a handler is registered under the same path + * and same method twice. For compatible version and CURRENT. + * If a handler was not overridden with compatible version, a request should still be handled with the CURRENT version. + * @param method a REST method under which a handler was registered + * @param version a Version under which a handler was registered + * @return a handler + */ @Nullable - RestHandler getHandler(RestRequest.Method method, String version) { - Map versionToHandlers = methodHandlers.get(method); + RestHandler getHandler(RestRequest.Method method, Version version) { + Map versionToHandlers = methodHandlers.get(method); if (versionToHandlers.containsKey(version)) { return versionToHandlers.get(version); } - return versionToHandlers.get(String.valueOf(Version.CURRENT.major)); + return versionToHandlers.get(Version.CURRENT); } /** diff --git a/server/src/main/java/org/elasticsearch/rest/RestController.java b/server/src/main/java/org/elasticsearch/rest/RestController.java index ed8a964db00e9..fba24649b27c7 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestController.java +++ b/server/src/main/java/org/elasticsearch/rest/RestController.java @@ -33,7 +33,6 @@ import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.path.PathTrie; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.core.internal.io.Streams; @@ -55,7 +54,6 @@ import java.util.stream.Collectors; import static org.elasticsearch.rest.BytesRestResponse.TEXT_CONTENT_TYPE; -import static org.elasticsearch.rest.CompatibleConstants.COMPATIBLE_VERSION; import static org.elasticsearch.rest.RestStatus.BAD_REQUEST; import static org.elasticsearch.rest.RestStatus.INTERNAL_SERVER_ERROR; import static org.elasticsearch.rest.RestStatus.METHOD_NOT_ALLOWED; @@ -150,7 +148,7 @@ protected void registerHandler(RestRequest.Method method, String path, RestHandl if (handler instanceof BaseRestHandler) { usageService.addRestHandler((BaseRestHandler) handler); } - final String version = handler.compatibleWithVersion(); + final Version version = handler.compatibleWithVersion(); final RestHandler maybeWrappedHandler = handlerWrapper.apply(handler); handlers.insertOrUpdate(path, new MethodHandlers(path, maybeWrappedHandler, version, method), (mHandlers, newMHandler) -> mHandlers.addMethods(maybeWrappedHandler, version, method)); @@ -298,11 +296,8 @@ private void tryAllHandlers(final RestRequest request, final RestChannel channel final String rawPath = request.rawPath(); final String uri = request.uri(); - //TODO the problem with string, byte, null .. this should be more consistent - String compatibleWithVersion = request.param(CompatibleConstants.COMPATIBLE_PARAMS_KEY); - if(compatibleWithVersion == null){ - compatibleWithVersion=""+Version.CURRENT.major; - } + Version version = request.getCompatibleApiVersion(); + final RestRequest.Method requestMethod; try { // Resolves the HTTP method and fails if the method is invalid @@ -315,7 +310,7 @@ private void tryAllHandlers(final RestRequest request, final RestChannel channel if (handlers == null) { handler = null; } else { - handler = handlers.getHandler(requestMethod, compatibleWithVersion); + handler = handlers.getHandler(requestMethod, version); } if (handler == null) { if (handleNoHandlerFound(rawPath, requestMethod, uri, channel)) { @@ -334,11 +329,6 @@ private void tryAllHandlers(final RestRequest request, final RestChannel channel handleBadRequest(uri, requestMethod, channel); } - private boolean isCompatible(ToXContent.Params params) { - String param = params.param(CompatibleConstants.COMPATIBLE_PARAMS_KEY); - return COMPATIBLE_VERSION.equals(param); - } - Iterator getAllHandlers(@Nullable Map requestParamsRef, String rawPath) { final Supplier> paramsSupplier; if (requestParamsRef == null) { diff --git a/server/src/main/java/org/elasticsearch/rest/RestHandler.java b/server/src/main/java/org/elasticsearch/rest/RestHandler.java index 2bd2bdc4ead48..45fb6326fad4a 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestHandler.java +++ b/server/src/main/java/org/elasticsearch/rest/RestHandler.java @@ -90,8 +90,8 @@ default List replacedRoutes() { return Collections.emptyList(); } - default String compatibleWithVersion(){ - return ""+ Version.CURRENT.major; + default Version compatibleWithVersion(){ + return Version.CURRENT; } class Route { diff --git a/server/src/main/java/org/elasticsearch/rest/RestRequest.java b/server/src/main/java/org/elasticsearch/rest/RestRequest.java index e252fa92c7c8e..8d66abead73e5 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestRequest.java +++ b/server/src/main/java/org/elasticsearch/rest/RestRequest.java @@ -21,6 +21,7 @@ import org.apache.lucene.util.SetOnce; import org.elasticsearch.ElasticsearchParseException; +import org.elasticsearch.Version; import org.elasticsearch.common.Booleans; import org.elasticsearch.common.CheckedConsumer; import org.elasticsearch.common.Nullable; @@ -74,6 +75,7 @@ public class RestRequest implements ToXContent.Params { private boolean contentConsumed = false; private final long requestId; + private final Version compatibleApiVersion; public boolean isContentConsumed() { return contentConsumed; @@ -102,7 +104,13 @@ private RestRequest(NamedXContentRegistry xContentRegistry, Map this.rawPath = path; this.headers = Collections.unmodifiableMap(headers); this.requestId = requestId; - addCompatibleParameter(); + + if (isRequestCompatible()) { + String compatibleVersion = XContentType.parseVersion(header(CompatibleConstants.COMPATIBLE_HEADER)); + this.compatibleApiVersion = Version.fromString(compatibleVersion + ".0.0"); + }else{ + this.compatibleApiVersion = Version.CURRENT; + } } protected RestRequest(RestRequest restRequest) { @@ -137,13 +145,13 @@ public static RestRequest request(NamedXContentRegistry xContentRegistry, HttpRe return restRequest; } - private void addCompatibleParameter() { - if (isRequestCompatible()) { - String compatibleVersion = XContentType.parseVersion(header(CompatibleConstants.COMPATIBLE_HEADER)); - params().put(CompatibleConstants.COMPATIBLE_PARAMS_KEY, compatibleVersion); - //use it so it won't fail request validation with unused parameter - param(CompatibleConstants.COMPATIBLE_PARAMS_KEY); - } + /** + * An http request can be accompanied with a compatible version indicating with what version a client is using. + * Only a major Versions are supported. Internally we use Versions objects, but only use Version(major,0,0) + * @return a version with what a client is compatible with. + */ + public Version getCompatibleApiVersion() { + return this.compatibleApiVersion; } private boolean isRequestCompatible() { @@ -155,7 +163,6 @@ private boolean isHeaderCompatible(String headerValue) { return CompatibleConstants.COMPATIBLE_VERSION.equals(version); } - private static Map params(final String uri) { final Map params = new HashMap<>(); int index = uri.indexOf('?'); @@ -194,11 +201,6 @@ public static RestRequest requestWithoutParameters(NamedXContentRegistry xConten requestIdGenerator.incrementAndGet()); } - public boolean isCompatible(String compatibleVersion) { - String param = param(CompatibleConstants.COMPATIBLE_PARAMS_KEY); - return compatibleVersion.equals(param); - } - public enum Method { GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH, TRACE, CONNECT } diff --git a/server/src/test/java/org/elasticsearch/http/DefaultRestChannelTests.java b/server/src/test/java/org/elasticsearch/http/DefaultRestChannelTests.java index 8d7a026aee034..d759db5416f53 100644 --- a/server/src/test/java/org/elasticsearch/http/DefaultRestChannelTests.java +++ b/server/src/test/java/org/elasticsearch/http/DefaultRestChannelTests.java @@ -38,7 +38,6 @@ import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.rest.BytesRestResponse; -import org.elasticsearch.rest.CompatibleConstants; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -216,12 +215,12 @@ public void testHeadersSet() { } public void testCompatibleParamIsSet() { - String version = String.valueOf(Version.CURRENT.major-1); + int majorVersion = Version.CURRENT.major - 1; final TestRequest httpRequest = new TestRequest(HttpRequest.HttpVersion.HTTP_1_1, RestRequest.Method.GET, "/"); - httpRequest.getHeaders().put(HttpHeaders.ACCEPT, List.of("application/vnd.elasticsearch+json;compatible-with=" + version)); + httpRequest.getHeaders().put(HttpHeaders.ACCEPT, List.of("application/vnd.elasticsearch+json;compatible-with=" + majorVersion)); final RestRequest request = RestRequest.request(xContentRegistry(), httpRequest, httpChannel); - assertEquals(version, request.param(CompatibleConstants.COMPATIBLE_PARAMS_KEY)); + assertEquals(Version.fromString(majorVersion+"0.0"), request.getCompatibleApiVersion()); } public void testCookiesSet() { diff --git a/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java b/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java index 1a2d585a9ff08..1dbfe2a5c8b58 100644 --- a/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java +++ b/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java @@ -127,7 +127,7 @@ public MethodHandlers next() { assertEquals("true", threadContext.getHeader("header.1")); assertEquals("true", threadContext.getHeader("header.2")); assertNull(threadContext.getHeader("header.3")); - },"" + Version.CURRENT.major, RestRequest.Method.GET); + }, Version.CURRENT, RestRequest.Method.GET); } }); AssertingChannel channel = new AssertingChannel(fakeRequest, false, RestStatus.BAD_REQUEST); @@ -630,8 +630,8 @@ public boolean supportsContentStream() { } @Override - public String compatibleWithVersion() { - return "7"; + public Version compatibleWithVersion() { + return Version.V_7_0_0; } }); diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/FakeRestRequest.java b/test/framework/src/main/java/org/elasticsearch/test/rest/FakeRestRequest.java index 2f2f5fb76bfe7..3501bcbb8e43c 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/FakeRestRequest.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/FakeRestRequest.java @@ -183,7 +183,7 @@ public Builder(NamedXContentRegistry xContentRegistry) { } public Builder withHeaders(Map> headers) { - this.headers = headers; + this.headers.putAll(headers); return this; } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/RestActionTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/rest/RestActionTestCase.java index a5d932a3d1a3d..5aea384de6a56 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/RestActionTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/RestActionTestCase.java @@ -38,7 +38,7 @@ * that can be used to register individual REST actions, and test request handling. */ public abstract class RestActionTestCase extends ESTestCase { - private RestController controller; + protected RestController controller; protected NodeClient nodeClient; @Before diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/SecurityRestFilter.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/SecurityRestFilter.java index ef13c53b47a68..090d13c4547c7 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/SecurityRestFilter.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/SecurityRestFilter.java @@ -9,6 +9,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.logging.log4j.util.Supplier; +import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.util.concurrent.ThreadContext; @@ -129,7 +130,7 @@ private RestRequest maybeWrapRestRequest(RestRequest restRequest) throws IOExcep } @Override - public String compatibleWithVersion() { + public Version compatibleWithVersion() { return restHandler.compatibleWithVersion(); } } From abe1d2864ad79f409f01f301255af6f4ca7f51c6 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Thu, 2 Apr 2020 14:08:45 +0200 Subject: [PATCH 20/38] unused method --- server/src/main/java/org/elasticsearch/Version.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/Version.java b/server/src/main/java/org/elasticsearch/Version.java index e1c5d8c59d102..120adc9faca0e 100644 --- a/server/src/main/java/org/elasticsearch/Version.java +++ b/server/src/main/java/org/elasticsearch/Version.java @@ -246,10 +246,6 @@ public static Version fromString(String version) { this.luceneVersion = Objects.requireNonNull(luceneVersion); } - public static Version forCompatibleApiVersion(String compatibleVersion) { - return Version.CURRENT; - } - public boolean after(Version version) { return version.id < id; } From d8fc2e554bcdd809d471fbb2543bdfe9c6ae423f Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Thu, 2 Apr 2020 15:16:15 +0200 Subject: [PATCH 21/38] method handlers - returning null when no handler under a method was registered --- .../java/org/elasticsearch/rest/MethodHandlers.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java b/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java index 9e46e7686a6fe..d148218afb949 100644 --- a/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java +++ b/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java @@ -60,17 +60,26 @@ MethodHandlers addMethods(RestHandler handler, Version version, RestRequest.Meth /** * Return a handler for a given method and a version - * If a handler for a given version is not found, the handler for Version.CURRENT is returned. + * If a handler for a given version is not found, the handler for Version.CURRENT is returned. todo hmm should this be like this/ * When using compatible API and compatible-with header, it is possible that a handler is registered under the same path * and same method twice. For compatible version and CURRENT. + * //todo this is an example when a request to /foo in v7 would return in 404, but it was added in v8 so /foo would be returned. + * //todo should we allow this? * If a handler was not overridden with compatible version, a request should still be handled with the CURRENT version. + * * @param method a REST method under which a handler was registered * @param version a Version under which a handler was registered * @return a handler + * + * */ @Nullable RestHandler getHandler(RestRequest.Method method, Version version) { Map versionToHandlers = methodHandlers.get(method); + + if(versionToHandlers == null){ + return null; + } if (versionToHandlers.containsKey(version)) { return versionToHandlers.get(version); } From d998555f99189f305bce708946f0a72dcff9c1d0 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Fri, 3 Apr 2020 11:32:05 +0200 Subject: [PATCH 22/38] comments --- .../script/mustache/RestMultiSearchTemplateAction.java | 7 ++++--- .../rest/action/search/RestSearchActionV7.java | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java index 2ce168b39d407..1896cd0eec143 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java @@ -85,9 +85,10 @@ public static MultiSearchTemplateRequest parseRequest(RestRequest restRequest, b /** * Parses a {@link RestRequest} body and returns a {@link MultiSearchTemplateRequest} - * @param typeConsumer - is a function used when parsing a request body. if it contains a types field it will consume it, - * allowing the same parsing logic to work in v7 and v8. - * It takes a string - field name, returns a boolean - if the field was "type or types" + * @param typeConsumer - A function used to validate if a provided xContent key is allowed. + * This is useful for xContent compatibility to determine + * if a key is allowed to be present in version agnostic manner. + * The provided function should return false if the key is not allowed. */ public static MultiSearchTemplateRequest parseRequest(RestRequest restRequest, boolean allowExplicitIndex, diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java index 4587f4f570839..221f575ab1d8e 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java @@ -49,7 +49,7 @@ public List routes() { @Override public RestChannelConsumer prepareRequest(RestRequest request, final NodeClient client) throws IOException { - request.param(INCLUDE_TYPE_NAME_PARAMETER);// just consume, it is not replaced with _doc + request.param(INCLUDE_TYPE_NAME_PARAMETER); if (request.hasParam("type")) { deprecationLogger.deprecatedAndMaybeLog("search_with_types", TYPES_DEPRECATION_MESSAGE); From ec8df43b08348e8edf9556a3cb3844aee18b69cc Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Fri, 3 Apr 2020 13:25:47 +0200 Subject: [PATCH 23/38] remove unused constant --- .../main/java/org/elasticsearch/rest/CompatibleConstants.java | 1 - 1 file changed, 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/rest/CompatibleConstants.java b/server/src/main/java/org/elasticsearch/rest/CompatibleConstants.java index 78b62dac49ba7..61d35460875f1 100644 --- a/server/src/main/java/org/elasticsearch/rest/CompatibleConstants.java +++ b/server/src/main/java/org/elasticsearch/rest/CompatibleConstants.java @@ -27,7 +27,6 @@ public class CompatibleConstants { * TODO revisit when https://github.com/elastic/elasticsearch/issues/52370 is resolved */ public static final String COMPATIBLE_HEADER = "Accept"; - public static final String COMPATIBLE_PARAMS_KEY = "Compatible-With"; public static final String COMPATIBLE_VERSION = "" + (Version.CURRENT.major - 1); } From f3d25e0e8667ab937889205a9006967e161b270a Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Mon, 20 Apr 2020 11:45:47 +0200 Subject: [PATCH 24/38] fix javadoc --- .../elasticsearch/rest/CompatibleConstants.java | 3 --- .../org/elasticsearch/rest/MethodHandlers.java | 14 ++++++-------- .../rest/CompatibleHeaderCombinationTests.java | 5 ++--- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/rest/CompatibleConstants.java b/server/src/main/java/org/elasticsearch/rest/CompatibleConstants.java index 66260a4a498a9..9719383c3a3ed 100644 --- a/server/src/main/java/org/elasticsearch/rest/CompatibleConstants.java +++ b/server/src/main/java/org/elasticsearch/rest/CompatibleConstants.java @@ -19,8 +19,6 @@ package org.elasticsearch.rest; -import org.elasticsearch.Version; - public class CompatibleConstants { /** @@ -28,6 +26,5 @@ public class CompatibleConstants { */ public static final String COMPATIBLE_ACCEPT_HEADER = "Accept"; public static final String COMPATIBLE_CONTENT_TYPE_HEADER = "Content-Type"; - public static final String COMPATIBLE_PARAMS_KEY = "Compatible-With"; } diff --git a/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java b/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java index d148218afb949..2f50cf6835b88 100644 --- a/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java +++ b/server/src/main/java/org/elasticsearch/rest/MethodHandlers.java @@ -60,18 +60,16 @@ MethodHandlers addMethods(RestHandler handler, Version version, RestRequest.Meth /** * Return a handler for a given method and a version - * If a handler for a given version is not found, the handler for Version.CURRENT is returned. todo hmm should this be like this/ - * When using compatible API and compatible-with header, it is possible that a handler is registered under the same path - * and same method twice. For compatible version and CURRENT. - * //todo this is an example when a request to /foo in v7 would return in 404, but it was added in v8 so /foo would be returned. - * //todo should we allow this? - * If a handler was not overridden with compatible version, a request should still be handled with the CURRENT version. + * If a handler for a given version is not found, the handler for Version.CURRENT is returned. + * We only expect Version.CURRENT or Version.CURRENT -1. This is validated. + * + * Handlers can be registered under the same path and method, but will require to have different versions (CURRENT or CURRENT-1) + * + * //todo What if a handler was added in V8 but was not present in V7? * * @param method a REST method under which a handler was registered * @param version a Version under which a handler was registered * @return a handler - * - * */ @Nullable RestHandler getHandler(RestRequest.Method method, Version version) { diff --git a/server/src/test/java/org/elasticsearch/rest/CompatibleHeaderCombinationTests.java b/server/src/test/java/org/elasticsearch/rest/CompatibleHeaderCombinationTests.java index e38b7f9efab38..b43e7d10823b5 100644 --- a/server/src/test/java/org/elasticsearch/rest/CompatibleHeaderCombinationTests.java +++ b/server/src/test/java/org/elasticsearch/rest/CompatibleHeaderCombinationTests.java @@ -175,9 +175,8 @@ private Matcher isCompatible() { } private Matcher requestHasVersion(int version) { - return ElasticsearchMatchers.HasPropertyLambdaMatcher.hasProperty(build -> - build.param(CompatibleConstants.COMPATIBLE_PARAMS_KEY) //TODO to be refactored into getVersion - , equalTo(String.valueOf(version))); + return ElasticsearchMatchers.HasPropertyLambdaMatcher.hasProperty(restRequest -> + restRequest.getCompatibleApiVersion(), equalTo(Version.fromString(version + ".0.0"))); } private String bodyNotPresent() { From 7024913f90f98f9aae7284b406c901545032f0b2 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Mon, 20 Apr 2020 13:45:19 +0200 Subject: [PATCH 25/38] compile --- .../elasticsearch/rest/compat/AbstractCompatRestTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java b/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java index 36bfd8b56c45f..330dd7fd24807 100644 --- a/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java +++ b/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java @@ -22,6 +22,7 @@ import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.elasticsearch.Version; import org.elasticsearch.rest.CompatibleConstants; import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; @@ -82,7 +83,7 @@ private static Consumer updateDoSection() { doSection.setIgnoreWarnings(true); String compatibleHeader = createCompatibleHeader(); - // for cat apis accept headers would break tests which expect txt response + //TODO for cat apis accept headers would break tests which expect txt response if (doSection.getApiCallSection().getApi().startsWith("cat") == false) { doSection.getApiCallSection() .addHeaders( @@ -99,7 +100,7 @@ private static Consumer updateDoSection() { } private static String createCompatibleHeader() { - return "application/vnd.elasticsearch+json;compatible-with=" + CompatibleConstants.COMPATIBLE_VERSION; + return "application/vnd.elasticsearch+json;compatible-with=" + Version.minimumRestCompatibilityVersion().major; } private static Map getLocalCompatibilityTests() throws Exception { From cafee2f346ac70b965f39a06d6c611858d32b650 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Mon, 20 Apr 2020 15:46:31 +0200 Subject: [PATCH 26/38] spotless --- .../main/java/org/elasticsearch/compat/TypeConsumer.java | 5 ++--- .../action/document/RestMultiTermVectorsActionV7.java | 9 +++++---- .../rest/action/document/RestTermVectorsActionV7.java | 3 +-- .../rest/action/search/RestSearchActionV7.java | 4 +++- .../index/reindex/RestDeleteByQueryActionV7Tests.java | 4 +++- .../index/reindex/RestUpdateByQueryActionTests.java | 4 +++- .../document/RestMultiTermVectorsActionV7Tests.java | 4 ++-- .../rest/compat/AbstractCompatRestTest.java | 2 +- 8 files changed, 20 insertions(+), 15 deletions(-) diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java index 448a457c3bd18..83660901fe940 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java @@ -22,7 +22,6 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.rest.RestRequest; -import java.util.HashSet; import java.util.Set; import java.util.function.Function; @@ -31,7 +30,7 @@ public class TypeConsumer implements Function { private final Set fieldNames; private boolean foundTypeInBody = false; - public TypeConsumer(RestRequest request, String ... fieldNames) { + public TypeConsumer(RestRequest request, String... fieldNames) { this.request = request; this.fieldNames = Set.of(fieldNames); } @@ -46,7 +45,7 @@ public Boolean apply(String fieldName) { } public boolean hasTypes() { - //TODO can params be types too? or _types? + // TODO can params be types too? or _types? String[] types = Strings.splitStringByCommaToArray(request.param("type")); return types.length > 0 || foundTypeInBody; } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java index abd4a0e53d4ae..5c9010d93c206 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java @@ -42,12 +42,14 @@ public class RestMultiTermVectorsActionV7 extends RestMultiTermVectorsAction { @Override public List routes() { - return List.of(new Route(GET, "/_mtermvectors"), + return List.of( + new Route(GET, "/_mtermvectors"), new Route(POST, "/_mtermvectors"), new Route(GET, "/{index}/_mtermvectors"), new Route(POST, "/{index}/_mtermvectors"), new Route(GET, "/{index}/{type}/_mtermvectors"), - new Route(POST, "/{index}/{type}/_mtermvectors")); + new Route(POST, "/{index}/{type}/_mtermvectors") + ); } @Override @@ -60,8 +62,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC TypeConsumer typeConsumer = new TypeConsumer(request, "_type"); MultiTermVectorsRequest multiTermVectorsRequest = new MultiTermVectorsRequest(); - TermVectorsRequest template = new TermVectorsRequest() - .index(request.param("index")); + TermVectorsRequest template = new TermVectorsRequest().index(request.param("index")); RestTermVectorsAction.readURIParameters(template, request); multiTermVectorsRequest.ids(Strings.commaDelimitedListToStringArray(request.param("ids"))); diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java index 37d87148a5e70..02c298be19d88 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java @@ -61,7 +61,7 @@ public String compatibleWithVersion() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { - TypeConsumer typeConsumer = new TypeConsumer(request,"_type"); + TypeConsumer typeConsumer = new TypeConsumer(request, "_type"); TermVectorsRequest termVectorsRequest = new TermVectorsRequest(request.param("index"), request.param("id")); @@ -80,5 +80,4 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC return channel -> client.termVectors(termVectorsRequest, new RestToXContentListener<>(channel)); } - } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java index 221f575ab1d8e..f6036f8b5ac3b 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java @@ -44,7 +44,9 @@ public List routes() { new Route(POST, "/_search"), new Route(GET, "/{index}/_search"), new Route(POST, "/{index}/_search"), - new Route(GET, "/{index}/{type}/_search"), new Route(POST, "/{index}/{type}/_search")); + new Route(GET, "/{index}/{type}/_search"), + new Route(POST, "/{index}/{type}/_search") + ); } @Override diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java index e41c089467139..7722a1a9dcc97 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7Tests.java @@ -56,7 +56,9 @@ public void testTypeInPath() throws IOException { } public void testParseEmpty() throws IOException { - DeleteByQueryRequest request = action.buildRequest(new FakeCompatRestRequestBuilder(new NamedXContentRegistry(emptyList())).build()); + DeleteByQueryRequest request = action.buildRequest( + new FakeCompatRestRequestBuilder(new NamedXContentRegistry(emptyList())).build() + ); // assertEquals(AbstractBulkByScrollRequest.SIZE_ALL_MATCHES, request.getSize()); assertEquals(AbstractBulkByScrollRequest.DEFAULT_SCROLL_SIZE, request.getSearchRequest().source().size()); } diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java index f8dbd7eefcf2c..10763b90b891d 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java @@ -57,7 +57,9 @@ public void testTypeInPath() throws IOException { } public void testParseEmpty() throws IOException { - UpdateByQueryRequest request = action.buildRequest(new FakeCompatRestRequestBuilder(new NamedXContentRegistry(emptyList())).build()); + UpdateByQueryRequest request = action.buildRequest( + new FakeCompatRestRequestBuilder(new NamedXContentRegistry(emptyList())).build() + ); // assertEquals(AbstractBulkByScrollRequest.SIZE_ALL_MATCHES, request.getSize()); assertEquals(AbstractBulkByScrollRequest.DEFAULT_SCROLL_SIZE, request.getSearchRequest().source().size()); } diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java index 6a86c789c95bc..67623ebff8e0e 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7Tests.java @@ -79,8 +79,8 @@ public void testTypeInBody() throws IOException { .build(); dispatchRequest(request); - //TODO change - now the deprecation warning is from MultiTermVectors.. -// assertWarnings(RestTermVectorsActionV7.TYPES_DEPRECATION_MESSAGE); + // TODO change - now the deprecation warning is from MultiTermVectors.. + // assertWarnings(RestTermVectorsActionV7.TYPES_DEPRECATION_MESSAGE); assertWarnings(RestMultiTermVectorsActionV7.TYPES_DEPRECATION_MESSAGE); } } diff --git a/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java b/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java index 330dd7fd24807..a770139c44aa3 100644 --- a/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java +++ b/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java @@ -83,7 +83,7 @@ private static Consumer updateDoSection() { doSection.setIgnoreWarnings(true); String compatibleHeader = createCompatibleHeader(); - //TODO for cat apis accept headers would break tests which expect txt response + // TODO for cat apis accept headers would break tests which expect txt response if (doSection.getApiCallSection().getApi().startsWith("cat") == false) { doSection.getApiCallSection() .addHeaders( From f52dbc1de09ac72c4cb6ca3c5f69e10bcc6ff24c Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Mon, 20 Apr 2020 15:56:59 +0200 Subject: [PATCH 27/38] spotless --- .../org/elasticsearch/rest/compat/AbstractCompatRestTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java b/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java index 330dd7fd24807..a770139c44aa3 100644 --- a/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java +++ b/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java @@ -83,7 +83,7 @@ private static Consumer updateDoSection() { doSection.setIgnoreWarnings(true); String compatibleHeader = createCompatibleHeader(); - //TODO for cat apis accept headers would break tests which expect txt response + // TODO for cat apis accept headers would break tests which expect txt response if (doSection.getApiCallSection().getApi().startsWith("cat") == false) { doSection.getApiCallSection() .addHeaders( From 813579444254bced0082b7994642124ee27b4cc1 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 22 Apr 2020 11:22:28 +0200 Subject: [PATCH 28/38] v7 name --- .../rest/compat/version7/RestCreateIndexActionV7.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java index fefac2854409a..eb393e5398f74 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java @@ -44,6 +44,11 @@ public class RestCreateIndexActionV7 extends RestCreateIndexAction { */ public static final String INCLUDE_TYPE_NAME_PARAMETER = "include_type_name"; + @Override + public String getName() { + return "create_index_action_v7"; + } + @Override public Version compatibleWithVersion() { return Version.V_7_0_0; From 7e7ed6315a1f1ef65e361eea50da8f72fa40332f Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 22 Apr 2020 11:55:20 +0200 Subject: [PATCH 29/38] versions and names --- .../org/elasticsearch/compat/TypeConsumer.java | 1 + .../index/reindex/RestDeleteByQueryActionV7.java | 10 ++++++++-- .../index/reindex/RestUpdateByQueryActionV7.java | 10 ++++++++-- .../admin/indices/RestCreateIndexActionV7.java | 2 +- .../rest/action/document/RestGetActionV7.java | 2 +- .../rest/action/document/RestIndexActionV7.java | 2 +- .../document/RestMultiTermVectorsActionV7.java | 9 +++++++-- .../action/document/RestTermVectorsActionV7.java | 9 +++++++-- .../action/search/RestMultiSearchActionV7.java | 15 ++++++++++----- .../rest/action/search/RestSearchActionV7.java | 15 ++++++++++----- .../mustache/RestMultiSearchTemplateActionV7.java | 12 ++++++------ .../mustache/RestSearchTemplateActionV7.java | 9 +++++++-- 12 files changed, 67 insertions(+), 29 deletions(-) diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java index 83660901fe940..f7c0e9b9e9283 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/compat/TypeConsumer.java @@ -26,6 +26,7 @@ import java.util.function.Function; public class TypeConsumer implements Function { + private final RestRequest request; private final Set fieldNames; private boolean foundTypeInBody = false; diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java index b0f7abbfb8010..a67b3a784ddad 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java @@ -29,14 +29,20 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; public class RestDeleteByQueryActionV7 extends RestDeleteByQueryAction { + @Override public List routes() { return List.of(new Route(POST, "/{index}/{type}/_delete_by_query")); } @Override - public String compatibleWithVersion() { - return String.valueOf(Version.V_7_0_0.major); + public String getName() { + return super.getName() + "_v7"; + } + + @Override + public Version compatibleWithVersion() { + return Version.V_7_0_0; } @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java index 98986fd14b4c6..f955306f035f2 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java @@ -29,14 +29,20 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; public class RestUpdateByQueryActionV7 extends RestUpdateByQueryAction { + @Override public List routes() { return List.of(new Route(POST, "/{index}/{type}/_update_by_query")); } @Override - public String compatibleWithVersion() { - return String.valueOf(Version.V_7_0_0.major); + public String getName() { + return super.getName() + "_v7"; + } + + @Override + public Version compatibleWithVersion() { + return Version.V_7_0_0; } @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7.java index b7dfbfd624ff1..f30eb42651715 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7.java @@ -45,7 +45,7 @@ public class RestCreateIndexActionV7 extends RestCreateIndexAction { @Override public String getName() { - return "create_index_action_v7"; + return super.getName() + "_v7"; } @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestGetActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestGetActionV7.java index 728b196e4fcd4..4d15f658f913a 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestGetActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestGetActionV7.java @@ -39,7 +39,7 @@ public class RestGetActionV7 extends RestGetAction { @Override public String getName() { - return "document_get_action_v7"; + return super.getName() + "_v7"; } @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestIndexActionV7.java index ed5bbe78f9c54..534c834dec715 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestIndexActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestIndexActionV7.java @@ -47,7 +47,7 @@ private static void logDeprecationMessage() { public static class CompatibleRestIndexAction extends RestIndexAction { @Override public String getName() { - return "document_index_action_v7"; + return super.getName() + "_v7"; } @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java index 5c9010d93c206..9fbc0ff08d963 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java @@ -53,8 +53,13 @@ public List routes() { } @Override - public String compatibleWithVersion() { - return String.valueOf(Version.V_7_0_0.major); + public String getName() { + return super.getName() + "_v7"; + } + + @Override + public Version compatibleWithVersion() { + return Version.V_7_0_0; } @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java index 02c298be19d88..552adf8dada81 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java @@ -55,8 +55,13 @@ public List routes() { } @Override - public String compatibleWithVersion() { - return String.valueOf(Version.V_7_0_0.major); + public String getName() { + return super.getName() + "_v7"; + } + + @Override + public Version compatibleWithVersion() { + return Version.V_7_0_0; } @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java index 8863fe45afa4c..2dfee8948166b 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java @@ -43,11 +43,6 @@ public RestMultiSearchActionV7(Settings settings) { super(settings); } - @Override - public String compatibleWithVersion() { - return String.valueOf(Version.V_7_0_0.major); - } - @Override public List routes() { return List.of( @@ -61,6 +56,16 @@ public List routes() { ); } + @Override + public String getName() { + return super.getName() + "_v7"; + } + + @Override + public Version compatibleWithVersion() { + return Version.V_7_0_0; + } + @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { request.param("type"); diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java index f6036f8b5ac3b..89f341f292734 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java @@ -49,6 +49,16 @@ public List routes() { ); } + @Override + public String getName() { + return super.getName() + "_v7"; + } + + @Override + public Version compatibleWithVersion() { + return Version.V_7_0_0; + } + @Override public RestChannelConsumer prepareRequest(RestRequest request, final NodeClient client) throws IOException { request.param(INCLUDE_TYPE_NAME_PARAMETER); @@ -59,9 +69,4 @@ public RestChannelConsumer prepareRequest(RestRequest request, final NodeClient return super.prepareRequest(request, client); } - - @Override - public String compatibleWithVersion() { - return String.valueOf(Version.V_7_0_0.major); - } } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java index c47d14582087b..1268dba506c93 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java @@ -47,11 +47,6 @@ public RestMultiSearchTemplateActionV7(Settings settings) { super(settings); } - @Override - public String compatibleWithVersion() { - return String.valueOf(Version.V_7_0_0.major); - } - @Override public List routes() { return List.of( @@ -68,7 +63,12 @@ public List routes() { @Override public String getName() { - return "multi_search_template_action"; + return super.getName() + "_v7"; + } + + @Override + public Version compatibleWithVersion() { + return Version.V_7_0_0; } @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java index 65d15f71febec..1c96b6b795287 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java @@ -45,8 +45,13 @@ public List routes() { } @Override - public String compatibleWithVersion() { - return String.valueOf(Version.V_7_0_0.major); + public String getName() { + return super.getName() + "_v7"; + } + + @Override + public Version compatibleWithVersion() { + return Version.V_7_0_0; } @Override From 81a62fe38400672c0d2ed278555c0774778b05a0 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 22 Apr 2020 12:26:38 +0200 Subject: [PATCH 30/38] spotless --- .../indices}/RestCreateIndexActionV7Tests.java | 2 +- .../rest/action/document/RestGetActionV7Tests.java | 5 +++++ .../rest/action/document/RestIndexActionV7Tests.java | 2 ++ .../action/termvectors/MultiTermVectorsRequest.java | 3 ++- .../elasticsearch/action/termvectors/TermVectorsRequest.java | 4 +++- 5 files changed, 13 insertions(+), 3 deletions(-) rename modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/{document => admin/indices}/RestCreateIndexActionV7Tests.java (98%) diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestCreateIndexActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7Tests.java similarity index 98% rename from modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestCreateIndexActionV7Tests.java rename to modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7Tests.java index c405fe12549c9..f5f2e338975f7 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestCreateIndexActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7Tests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.rest.compat.version7; +package org.elasticsearch.rest.action.admin.indices; import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; import org.elasticsearch.common.bytes.BytesArray; diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestGetActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestGetActionV7Tests.java index 3717717913d97..f174e337f6ad7 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestGetActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestGetActionV7Tests.java @@ -25,6 +25,10 @@ import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; +import java.util.Collections; +import java.util.List; +import java.util.Map; + public class RestGetActionV7Tests extends RestActionTestCase { final String mimeType = "application/vnd.elasticsearch+json;compatible-with=7"; final List contentTypeHeader = Collections.singletonList(mimeType); @@ -36,6 +40,7 @@ public void setUpAction() { public void testTypeInPathWithGet() { FakeRestRequest deprecatedRequest = new FakeCompatRestRequestBuilder(xContentRegistry()).withPath("/some_index/some_type/some_id") + .withHeaders(Map.of("Content-Type", contentTypeHeader, "Accept", contentTypeHeader)) .withMethod(RestRequest.Method.GET) .build(); dispatchRequest(deprecatedRequest); diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionV7Tests.java index e6098d571dff0..69812d67333a0 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionV7Tests.java @@ -25,6 +25,8 @@ import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; +import java.util.Collections; +import java.util.List; import java.util.concurrent.atomic.AtomicReference; public class RestIndexActionV7Tests extends RestActionTestCase { diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java b/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java index 083e87d3bc4a0..16e558ec8d9aa 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java @@ -102,7 +102,8 @@ public List getRequests() { public void add(TermVectorsRequest template, @Nullable XContentParser parser) throws IOException { add(template, parser, k->false); } - public void add(TermVectorsRequest template, @Nullable XContentParser parser, Function typeConsumer) throws IOException { + public void add(TermVectorsRequest template, @Nullable XContentParser parser, Function typeConsumer) + throws IOException { XContentParser.Token token; String currentFieldName = null; if (parser != null) { diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java index dc40b7b9b0df6..0bc7259206b91 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java @@ -536,7 +536,9 @@ public static void parseRequest(TermVectorsRequest termVectorsRequest, XContentP /** * populates a request object (pre-populated with defaults) based on a parser. */ - public static void parseRequest(TermVectorsRequest termVectorsRequest, XContentParser parser, Function typeConsumer) throws IOException { + public static void parseRequest(TermVectorsRequest termVectorsRequest, + XContentParser parser, + Function typeConsumer) throws IOException { XContentParser.Token token; String currentFieldName = null; List fields = new ArrayList<>(); From d65a4a26d09dde9e9d82f6f486f62d264651d531 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 22 Apr 2020 13:40:19 +0200 Subject: [PATCH 31/38] import fix --- .../rest/action/admin/indices/RestCreateIndexActionV7Tests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7Tests.java index f5f2e338975f7..7a612755db01e 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7Tests.java @@ -7,7 +7,7 @@ * not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an From adb1a1e6d6de18804910e6a6ca1d69f367b2e546 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 22 Apr 2020 15:33:28 +0200 Subject: [PATCH 32/38] fix tests --- .../index/reindex/RestDeleteByQueryActionV7.java | 9 ++++++++- .../index/reindex/RestUpdateByQueryActionV7.java | 10 +++++++++- .../action/document/RestMultiTermVectorsActionV7.java | 4 ++-- .../script/mustache/RestSearchTemplateActionV7.java | 11 ++++++++++- .../index/reindex/RestUpdateByQueryActionTests.java | 2 +- .../admin/indices/RestCreateIndexActionV7Tests.java | 11 ++--------- .../rest/action/document/RestGetActionV7Tests.java | 7 ------- 7 files changed, 32 insertions(+), 22 deletions(-) diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java index a67b3a784ddad..8cb71153b5161 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java @@ -19,9 +19,12 @@ package org.elasticsearch.index.reindex; +import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.search.RestSearchActionV7; import java.io.IOException; import java.util.List; @@ -29,6 +32,7 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; public class RestDeleteByQueryActionV7 extends RestDeleteByQueryAction { + private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestDeleteByQueryActionV7.class)); @Override public List routes() { @@ -47,7 +51,10 @@ public Version compatibleWithVersion() { @Override public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { - request.param("type"); + if (request.hasParam("type")) { + deprecationLogger.deprecatedAndMaybeLog("search_with_types", RestSearchActionV7.TYPES_DEPRECATION_MESSAGE); + request.param("type"); + } return super.prepareRequest(request, client); } } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java index f955306f035f2..7cb5569a4ec58 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java @@ -19,9 +19,12 @@ package org.elasticsearch.index.reindex; +import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.search.RestSearchActionV7; import java.io.IOException; import java.util.List; @@ -30,6 +33,8 @@ public class RestUpdateByQueryActionV7 extends RestUpdateByQueryAction { + private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestUpdateByQueryActionV7.class)); + @Override public List routes() { return List.of(new Route(POST, "/{index}/{type}/_update_by_query")); @@ -47,7 +52,10 @@ public Version compatibleWithVersion() { @Override public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { - request.param("type"); + if (request.hasParam("type")) { + deprecationLogger.deprecatedAndMaybeLog("search_with_types", RestSearchActionV7.TYPES_DEPRECATION_MESSAGE); + request.param("type"); + } return super.prepareRequest(request, client); } } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java index 9fbc0ff08d963..2fbdcd58b9491 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java @@ -73,9 +73,9 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC multiTermVectorsRequest.ids(Strings.commaDelimitedListToStringArray(request.param("ids"))); request.withContentOrSourceParamParserOrNull(p -> multiTermVectorsRequest.add(template, p, typeConsumer)); - if (request.hasParam("type")) { + if (typeConsumer.hasTypes()) { request.param("type"); - deprecationLogger.deprecatedAndMaybeLog("mtermvectors_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.deprecatedAndMaybeLog("termvectors_with_types", TYPES_DEPRECATION_MESSAGE); } return channel -> client.multiTermVectors(multiTermVectorsRequest, new RestToXContentListener<>(channel)); } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java index 1c96b6b795287..7b84612c6c30a 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java @@ -19,9 +19,12 @@ package org.elasticsearch.script.mustache; +import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.search.RestSearchActionV7; import java.io.IOException; import java.util.List; @@ -30,6 +33,9 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; public class RestSearchTemplateActionV7 extends RestSearchTemplateAction { + private static final DeprecationLogger deprecationLogger = new DeprecationLogger( + LogManager.getLogger(RestSearchTemplateActionV7.class) + ); @Override public List routes() { @@ -56,7 +62,10 @@ public Version compatibleWithVersion() { @Override public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { - request.param("type"); + if (request.hasParam("type")) { + deprecationLogger.deprecatedAndMaybeLog("search_with_types", RestSearchActionV7.TYPES_DEPRECATION_MESSAGE); + request.param("type"); + } return super.prepareRequest(request, client); } } diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java index 10763b90b891d..4f97bbdaa9585 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java @@ -36,7 +36,7 @@ public class RestUpdateByQueryActionTests extends RestActionTestCase { @Before public void setUpAction() { - action = new RestUpdateByQueryAction(); + action = new RestUpdateByQueryActionV7(); controller().registerHandler(action); } diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7Tests.java index 7a612755db01e..35140a22b1479 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionV7Tests.java @@ -21,30 +21,24 @@ import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; import org.elasticsearch.common.bytes.BytesArray; +import org.elasticsearch.compat.FakeCompatRestRequestBuilder; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; import java.io.IOException; -import java.util.Collections; import java.util.HashMap; -import java.util.List; import java.util.Map; import static org.hamcrest.Matchers.equalTo; public class RestCreateIndexActionV7Tests extends RestActionTestCase { - String mimeType = "application/vnd.elasticsearch+json;compatible-with=7"; - List contentTypeHeader = Collections.singletonList(mimeType); - RestCreateIndexActionV7 restHandler = new RestCreateIndexActionV7(); @Before public void setUpAction() { controller().registerHandler(restHandler); - } public void testTypeInMapping() throws IOException { @@ -62,8 +56,7 @@ public void testTypeInMapping() throws IOException { Map params = new HashMap<>(); params.put(RestCreateIndexActionV7.INCLUDE_TYPE_NAME_PARAMETER, "true"); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.PUT) - .withHeaders(Map.of("Content-Type", contentTypeHeader, "Accept", contentTypeHeader)) + RestRequest request = new FakeCompatRestRequestBuilder(xContentRegistry()).withMethod(RestRequest.Method.PUT) .withPath("/some_index") .withParams(params) .withContent(new BytesArray(content), null) diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestGetActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestGetActionV7Tests.java index f174e337f6ad7..725e414fae95a 100644 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestGetActionV7Tests.java +++ b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestGetActionV7Tests.java @@ -25,13 +25,7 @@ import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; -import java.util.Collections; -import java.util.List; -import java.util.Map; - public class RestGetActionV7Tests extends RestActionTestCase { - final String mimeType = "application/vnd.elasticsearch+json;compatible-with=7"; - final List contentTypeHeader = Collections.singletonList(mimeType); @Before public void setUpAction() { @@ -40,7 +34,6 @@ public void setUpAction() { public void testTypeInPathWithGet() { FakeRestRequest deprecatedRequest = new FakeCompatRestRequestBuilder(xContentRegistry()).withPath("/some_index/some_type/some_id") - .withHeaders(Map.of("Content-Type", contentTypeHeader, "Accept", contentTypeHeader)) .withMethod(RestRequest.Method.GET) .build(); dispatchRequest(deprecatedRequest); From f8193132a056cb9ebdf0b587f52a6096fa2d5967 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 22 Apr 2020 15:35:36 +0200 Subject: [PATCH 33/38] fix test --- .../java/org/elasticsearch/http/DefaultRestChannelTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/test/java/org/elasticsearch/http/DefaultRestChannelTests.java b/server/src/test/java/org/elasticsearch/http/DefaultRestChannelTests.java index d759db5416f53..c3373cfc5840a 100644 --- a/server/src/test/java/org/elasticsearch/http/DefaultRestChannelTests.java +++ b/server/src/test/java/org/elasticsearch/http/DefaultRestChannelTests.java @@ -220,7 +220,7 @@ public void testCompatibleParamIsSet() { httpRequest.getHeaders().put(HttpHeaders.ACCEPT, List.of("application/vnd.elasticsearch+json;compatible-with=" + majorVersion)); final RestRequest request = RestRequest.request(xContentRegistry(), httpRequest, httpChannel); - assertEquals(Version.fromString(majorVersion+"0.0"), request.getCompatibleApiVersion()); + assertEquals(Version.fromString(majorVersion+".0.0"), request.getCompatibleApiVersion()); } public void testCookiesSet() { From 6e28d245c7e79681c5a092f45db50188e6d33e6d Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 22 Apr 2020 16:34:10 +0200 Subject: [PATCH 34/38] javadoc --- .../rest/compat/version7/RestCreateIndexActionV7.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java index eb393e5398f74..2bba43f02c34d 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/compat/version7/RestCreateIndexActionV7.java @@ -86,14 +86,13 @@ static Map prepareMappingsV7(Map source, RestReq Map mappings = (Map) source.get("mappings"); if (includeTypeName && mappings.size() == 1) { - // no matter what the type was, replace it with _doc Map newSource = new HashMap<>(); String typeName = mappings.keySet().iterator().next(); @SuppressWarnings("unchecked") Map typedMappings = (Map) mappings.get(typeName); - // the internal representation still uses single type `_doc`. + // no matter what the type was, replace it with _doc, because the internal representation still uses single type `_doc`. newSource.put("mappings", Collections.singletonMap(MapperService.SINGLE_MAPPING_NAME, typedMappings)); return newSource; } else { From 42b40ecd6cb6ebf8b661bf44be2df8fe8b56af95 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Wed, 29 Apr 2020 10:49:19 +0200 Subject: [PATCH 35/38] fix merge problem --- .../document/RestCreateIndexActionV7.java | 119 ------------------ .../RestCreateIndexActionV7Tests.java | 75 ----------- 2 files changed, 194 deletions(-) delete mode 100644 modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestCreateIndexActionV7.java delete mode 100644 modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestCreateIndexActionV7Tests.java diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestCreateIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestCreateIndexActionV7.java deleted file mode 100644 index 6f5d3d1fe272f..0000000000000 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestCreateIndexActionV7.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.elasticsearch.rest.compat.version7; - -import org.elasticsearch.Version; -import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; -import org.elasticsearch.action.support.ActiveShardCount; -import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.rest.action.RestToXContentListener; -import org.elasticsearch.rest.action.admin.indices.RestCreateIndexAction; - -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import static java.util.Collections.singletonMap; - -public class RestCreateIndexActionV7 extends RestCreateIndexAction { - - /** - * Parameter that controls whether certain REST apis should include type names in their requests. - */ - public static final String INCLUDE_TYPE_NAME_PARAMETER = "include_type_name"; - - @Override - public String getName() { - return "create_index_action_v7"; - } - - @Override - public Version compatibleWithVersion() { - return Version.V_7_0_0; - } - - @Override - public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { - CreateIndexRequest createIndexRequest = prepareRequest(request); - return channel -> client.admin().indices().create(createIndexRequest, new RestToXContentListener<>(channel)); - } - - // default scope for testing - CreateIndexRequest prepareRequest(RestRequest request) { - CreateIndexRequest createIndexRequest = new CreateIndexRequest(request.param("index")); - - if (request.hasContent()) { - Map sourceAsMap = XContentHelper.convertToMap(request.requiredContent(), false, request.getXContentType()).v2(); - - request.param(INCLUDE_TYPE_NAME_PARAMETER);// just consume, it is always replaced with _doc - sourceAsMap = prepareMappings(sourceAsMap, request); - - createIndexRequest.source(sourceAsMap, LoggingDeprecationHandler.INSTANCE); - } - - createIndexRequest.timeout(request.paramAsTime("timeout", createIndexRequest.timeout())); - createIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", createIndexRequest.masterNodeTimeout())); - createIndexRequest.waitForActiveShards(ActiveShardCount.parseString(request.param("wait_for_active_shards"))); - return createIndexRequest; - } - - static Map prepareMappings(Map source, RestRequest request) { - final boolean includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, false); - - @SuppressWarnings("unchecked") - Map mappings = (Map) source.get("mappings"); - - if (includeTypeName && mappings.size() == 1) { - Map newSource = new HashMap<>(); - - String typeName = mappings.keySet().iterator().next(); - @SuppressWarnings("unchecked") - Map typedMappings = (Map) mappings.get(typeName); - - // no matter what the type was, replace it with _doc, because the internal representation still uses single type `_doc`. - newSource.put("mappings", Collections.singletonMap(MapperService.SINGLE_MAPPING_NAME, typedMappings)); - return newSource; - } else { - return prepareMappings(source); - } - } - - static Map prepareMappings(Map source) { - if (source.containsKey("mappings") == false || (source.get("mappings") instanceof Map) == false) { - return source; - } - - Map newSource = new HashMap<>(source); - - @SuppressWarnings("unchecked") - Map mappings = (Map) source.get("mappings"); - if (MapperService.isMappingSourceTyped(MapperService.SINGLE_MAPPING_NAME, mappings)) { - throw new IllegalArgumentException("The mapping definition cannot be nested under a type"); - } - - newSource.put("mappings", singletonMap(MapperService.SINGLE_MAPPING_NAME, mappings)); - return newSource; - } -} diff --git a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestCreateIndexActionV7Tests.java b/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestCreateIndexActionV7Tests.java deleted file mode 100644 index 781ed2e12e3cc..0000000000000 --- a/modules/rest-compatibility/src/test/java/org/elasticsearch/rest/action/document/RestCreateIndexActionV7Tests.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.elasticsearch.rest.compat.version7; - -import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.test.rest.FakeRestRequest; -import org.elasticsearch.test.rest.RestActionTestCase; -import org.junit.Before; - -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static org.hamcrest.Matchers.equalTo; - -public class RestCreateIndexActionV7Tests extends RestActionTestCase { - - String mimeType = "application/vnd.elasticsearch+json;compatible-with=7"; - List contentTypeHeader = Collections.singletonList(mimeType); - - RestCreateIndexActionV7 restHandler = new RestCreateIndexActionV7(); - - @Before - public void setUpAction() { - controller().registerHandler(restHandler); - } - - public void testTypeInMapping() throws IOException { - String content = "{\n" - + " \"mappings\": {\n" - + " \"some_type\": {\n" - + " \"properties\": {\n" - + " \"field1\": {\n" - + " \"type\": \"text\"\n" - + " }\n" - + " }\n" - + " }\n" - + " }\n" - + "}"; - - Map params = new HashMap<>(); - params.put(RestCreateIndexActionV7.INCLUDE_TYPE_NAME_PARAMETER, "true"); - RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.PUT) - .withHeaders(Map.of("Content-Type", contentTypeHeader, "Accept", contentTypeHeader)) - .withPath("/some_index") - .withParams(params) - .withContent(new BytesArray(content), null) - .build(); - - CreateIndexRequest createIndexRequest = restHandler.prepareRequest(request); - // some_type is replaced with _doc - assertThat(createIndexRequest.mappings(), equalTo("{\"_doc\":{\"properties\":{\"field1\":{\"type\":\"text\"}}}}")); - } -} From 5f3158ce9725bc79e081505d7cc4ec67b8a53bb7 Mon Sep 17 00:00:00 2001 From: pgomulka Date: Wed, 17 Jun 2020 12:21:30 +0200 Subject: [PATCH 36/38] compile fix for deprecate method rename --- .../elasticsearch/index/reindex/RestDeleteByQueryActionV7.java | 2 +- .../elasticsearch/index/reindex/RestUpdateByQueryActionV7.java | 2 +- .../rest/action/document/RestMultiTermVectorsActionV7.java | 2 +- .../rest/action/document/RestTermVectorsActionV7.java | 2 +- .../rest/action/search/RestMultiSearchActionV7.java | 2 +- .../elasticsearch/rest/action/search/RestSearchActionV7.java | 2 +- .../script/mustache/RestMultiSearchTemplateActionV7.java | 2 +- .../script/mustache/RestSearchTemplateActionV7.java | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java index 8cb71153b5161..b1f33a8b551e5 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java @@ -52,7 +52,7 @@ public Version compatibleWithVersion() { @Override public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { if (request.hasParam("type")) { - deprecationLogger.deprecatedAndMaybeLog("search_with_types", RestSearchActionV7.TYPES_DEPRECATION_MESSAGE); + deprecationLogger.deprecate("search_with_types", RestSearchActionV7.TYPES_DEPRECATION_MESSAGE); request.param("type"); } return super.prepareRequest(request, client); diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java index 7cb5569a4ec58..17f2185613d54 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java @@ -53,7 +53,7 @@ public Version compatibleWithVersion() { @Override public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { if (request.hasParam("type")) { - deprecationLogger.deprecatedAndMaybeLog("search_with_types", RestSearchActionV7.TYPES_DEPRECATION_MESSAGE); + deprecationLogger.deprecate("search_with_types", RestSearchActionV7.TYPES_DEPRECATION_MESSAGE); request.param("type"); } return super.prepareRequest(request, client); diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java index 2fbdcd58b9491..ffde6729c1b98 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java @@ -75,7 +75,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC if (typeConsumer.hasTypes()) { request.param("type"); - deprecationLogger.deprecatedAndMaybeLog("termvectors_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.deprecate("termvectors_with_types", TYPES_DEPRECATION_MESSAGE); } return channel -> client.multiTermVectors(multiTermVectorsRequest, new RestToXContentListener<>(channel)); } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java index 552adf8dada81..7ec4a425cde27 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java @@ -79,7 +79,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC if (typeConsumer.hasTypes()) { request.param("type"); - deprecationLogger.deprecatedAndMaybeLog("termvectors_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.deprecate("termvectors_with_types", TYPES_DEPRECATION_MESSAGE); } return channel -> client.termVectors(termVectorsRequest, new RestToXContentListener<>(channel)); diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java index 2dfee8948166b..4bc6fc34aef4f 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java @@ -73,7 +73,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC MultiSearchRequest multiSearchRequest = parseRequest(request, allowExplicitIndex, typeConsumer); if (typeConsumer.hasTypes()) { - deprecationLogger.deprecatedAndMaybeLog("msearch_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.deprecate("msearch_with_types", TYPES_DEPRECATION_MESSAGE); } return channel -> client.multiSearch(multiSearchRequest, new RestToXContentListener<>(channel)); } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java index 89f341f292734..7d3373ff9ee9a 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java @@ -64,7 +64,7 @@ public RestChannelConsumer prepareRequest(RestRequest request, final NodeClient request.param(INCLUDE_TYPE_NAME_PARAMETER); if (request.hasParam("type")) { - deprecationLogger.deprecatedAndMaybeLog("search_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.deprecate("search_with_types", TYPES_DEPRECATION_MESSAGE); } return super.prepareRequest(request, client); diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java index 1268dba506c93..7500e6e400275 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java @@ -78,7 +78,7 @@ public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client TypeConsumer typeConsumer = new TypeConsumer(request, "type", "types"); MultiSearchTemplateRequest multiRequest = parseRequest(request, allowExplicitIndex, typeConsumer); if (typeConsumer.hasTypes()) { - deprecationLogger.deprecatedAndMaybeLog("msearch_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.deprecate("msearch_with_types", TYPES_DEPRECATION_MESSAGE); } return channel -> client.execute(MultiSearchTemplateAction.INSTANCE, multiRequest, new RestToXContentListener<>(channel)); } diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java index 7b84612c6c30a..22033f40ead7d 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java @@ -63,7 +63,7 @@ public Version compatibleWithVersion() { @Override public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { if (request.hasParam("type")) { - deprecationLogger.deprecatedAndMaybeLog("search_with_types", RestSearchActionV7.TYPES_DEPRECATION_MESSAGE); + deprecationLogger.deprecate("search_with_types", RestSearchActionV7.TYPES_DEPRECATION_MESSAGE); request.param("type"); } return super.prepareRequest(request, client); From 83afde4684d46f39209a9b3ac870eaf8fd29c553 Mon Sep 17 00:00:00 2001 From: pgomulka Date: Tue, 7 Jul 2020 13:55:53 +0200 Subject: [PATCH 37/38] fix after merge master --- modules/rest-compatibility/build.gradle | 4 ++-- .../index/reindex/RestDeleteByQueryActionV7.java | 3 +-- .../index/reindex/RestUpdateByQueryActionV7.java | 3 +-- .../rest/action/document/RestMultiTermVectorsActionV7.java | 3 +-- .../rest/action/document/RestTermVectorsActionV7.java | 3 +-- .../rest/action/search/RestMultiSearchActionV7.java | 5 ++--- .../rest/action/search/RestSearchActionV7.java | 3 +-- .../script/mustache/RestMultiSearchTemplateActionV7.java | 7 +++---- .../script/mustache/RestSearchTemplateActionV7.java | 6 ++---- 9 files changed, 14 insertions(+), 23 deletions(-) diff --git a/modules/rest-compatibility/build.gradle b/modules/rest-compatibility/build.gradle index 505238da590a4..a4b9b20d046a5 100644 --- a/modules/rest-compatibility/build.gradle +++ b/modules/rest-compatibility/build.gradle @@ -23,8 +23,8 @@ esplugin { } dependencies { - compile project(':modules:lang-mustache') - compile project(':modules:reindex') + implementation project(':modules:lang-mustache') + implementation project(':modules:reindex') } integTest.enabled = false diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java index b1f33a8b551e5..9fdba5d9edbc0 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionV7.java @@ -19,7 +19,6 @@ package org.elasticsearch.index.reindex; -import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.logging.DeprecationLogger; @@ -32,7 +31,7 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; public class RestDeleteByQueryActionV7 extends RestDeleteByQueryAction { - private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestDeleteByQueryActionV7.class)); + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteByQueryActionV7.class); @Override public List routes() { diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java index 17f2185613d54..29486286597c5 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionV7.java @@ -19,7 +19,6 @@ package org.elasticsearch.index.reindex; -import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.logging.DeprecationLogger; @@ -33,7 +32,7 @@ public class RestUpdateByQueryActionV7 extends RestUpdateByQueryAction { - private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestUpdateByQueryActionV7.class)); + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestUpdateByQueryActionV7.class); @Override public List routes() { diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java index ffde6729c1b98..d4df9c2a9baab 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionV7.java @@ -19,7 +19,6 @@ package org.elasticsearch.rest.action.document; -import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; import org.elasticsearch.action.termvectors.MultiTermVectorsRequest; import org.elasticsearch.action.termvectors.TermVectorsRequest; @@ -37,7 +36,7 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; public class RestMultiTermVectorsActionV7 extends RestMultiTermVectorsAction { - private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestTermVectorsAction.class)); + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestMultiTermVectorsActionV7.class); static final String TYPES_DEPRECATION_MESSAGE = "[types removal] " + "Specifying types in multi term vector requests is deprecated."; @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java index 7ec4a425cde27..3d083e066432a 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsActionV7.java @@ -19,7 +19,6 @@ package org.elasticsearch.rest.action.document; -import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; import org.elasticsearch.action.termvectors.TermVectorsRequest; import org.elasticsearch.client.node.NodeClient; @@ -36,7 +35,7 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; public class RestTermVectorsActionV7 extends RestTermVectorsAction { - private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestTermVectorsAction.class)); + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestTermVectorsActionV7.class); public static final String TYPES_DEPRECATION_MESSAGE = "[types removal] " + "Specifying types in term vector requests is deprecated."; @Override diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java index 4bc6fc34aef4f..e440925dc2250 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchActionV7.java @@ -19,13 +19,12 @@ package org.elasticsearch.rest.action.search; -import org.apache.logging.log4j.LogManager; -import org.elasticsearch.compat.TypeConsumer; import org.elasticsearch.Version; import org.elasticsearch.action.search.MultiSearchRequest; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.compat.TypeConsumer; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; @@ -36,7 +35,7 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; public class RestMultiSearchActionV7 extends RestMultiSearchAction { - private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestMultiSearchAction.class)); + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestMultiSearchActionV7.class); static final String TYPES_DEPRECATION_MESSAGE = "[types removal]" + " Specifying types in multi search requests is deprecated."; public RestMultiSearchActionV7(Settings settings) { diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java index 7d3373ff9ee9a..7d64c854d9e36 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/search/RestSearchActionV7.java @@ -19,7 +19,6 @@ package org.elasticsearch.rest.action.search; -import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.logging.DeprecationLogger; @@ -35,7 +34,7 @@ public class RestSearchActionV7 extends RestSearchAction { public static final String INCLUDE_TYPE_NAME_PARAMETER = "include_type_name"; public static final String TYPES_DEPRECATION_MESSAGE = "[types removal]" + " Specifying types in search requests is deprecated."; - private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSearchAction.class)); + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestSearchActionV7.class); @Override public List routes() { diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java index 7500e6e400275..b44106f103329 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java @@ -19,7 +19,6 @@ package org.elasticsearch.script.mustache; -import org.apache.logging.log4j.LogManager; import org.elasticsearch.compat.TypeConsumer; import org.elasticsearch.Version; import org.elasticsearch.client.node.NodeClient; @@ -29,6 +28,7 @@ import org.elasticsearch.rest.action.RestToXContentListener; import org.elasticsearch.rest.action.search.RestMultiSearchAction; import org.elasticsearch.rest.action.search.RestSearchAction; +import org.elasticsearch.rest.action.search.RestSearchActionV7; import java.io.IOException; import java.util.List; @@ -37,9 +37,8 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; public class RestMultiSearchTemplateActionV7 extends RestMultiSearchTemplateAction { - private static final DeprecationLogger deprecationLogger = new DeprecationLogger( - LogManager.getLogger(RestMultiSearchTemplateAction.class) - ); + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestMultiSearchTemplateActionV7.class); + static final String TYPES_DEPRECATION_MESSAGE = "[types removal]" + " Specifying types in multi search template requests is deprecated."; diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java index 22033f40ead7d..f92711d265a9c 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java @@ -19,7 +19,6 @@ package org.elasticsearch.script.mustache; -import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.logging.DeprecationLogger; @@ -33,9 +32,8 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; public class RestSearchTemplateActionV7 extends RestSearchTemplateAction { - private static final DeprecationLogger deprecationLogger = new DeprecationLogger( - LogManager.getLogger(RestSearchTemplateActionV7.class) - ); + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestSearchTemplateActionV7.class); + @Override public List routes() { From 660f0868ce5b0ca2a63b1dda6336fba84e99ff83 Mon Sep 17 00:00:00 2001 From: pgomulka Date: Tue, 7 Jul 2020 14:10:24 +0200 Subject: [PATCH 38/38] spotless --- .../elasticsearch/rest/action/document/RestIndexActionV7.java | 1 - .../script/mustache/RestMultiSearchTemplateActionV7.java | 1 - .../script/mustache/RestSearchTemplateActionV7.java | 1 - 3 files changed, 3 deletions(-) diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestIndexActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestIndexActionV7.java index c40def0a19f16..134deea9ff9db 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestIndexActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/rest/action/document/RestIndexActionV7.java @@ -19,7 +19,6 @@ package org.elasticsearch.rest.action.document; -import org.apache.logging.log4j.LogManager; import org.elasticsearch.Version; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.cluster.node.DiscoveryNodes; diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java index b44106f103329..87c65cd2d4e59 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionV7.java @@ -28,7 +28,6 @@ import org.elasticsearch.rest.action.RestToXContentListener; import org.elasticsearch.rest.action.search.RestMultiSearchAction; import org.elasticsearch.rest.action.search.RestSearchAction; -import org.elasticsearch.rest.action.search.RestSearchActionV7; import java.io.IOException; import java.util.List; diff --git a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java index f92711d265a9c..8eefa2708d447 100644 --- a/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java +++ b/modules/rest-compatibility/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateActionV7.java @@ -34,7 +34,6 @@ public class RestSearchTemplateActionV7 extends RestSearchTemplateAction { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestSearchTemplateActionV7.class); - @Override public List routes() { return List.of(