diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/110_constant_keyword.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/110_constant_keyword.yml index 38d447b6427af..b5a87862f562c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/110_constant_keyword.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/index/110_constant_keyword.yml @@ -1,12 +1,8 @@ +# The test setup includes two parts: +# part1: test mapping and indexing +# part2: test query --- -# The test setup includes: -# - Create two indices with constant_keyword field type -# - Index documents -# - Check mapping -# - Verify document count -# - Search rangeQuery and regexpQuery -# - Delete indices when connection is teardown -setup: +"Mappings and Indexing": - skip: version: " - 2.15.99" reason: "fixed in 2.16.0" @@ -22,16 +18,6 @@ setup: type: "constant_keyword" value: "1" - - do: - indices.create: - index: test1 - body: - mappings: - properties: - genre: - type: "constant_keyword" - value: "d3efault" - # Index documents to test integer and string are both ok. - do: index: @@ -49,35 +35,10 @@ setup: "genre": 1 } - # Index documents to test query. - - do: - index: - index: test1 - id: 1 - body: { - "genre": "d3efault" - } - + # Refresh - do: indices.refresh: - index: [test, test1] - ---- -# Delete Index when connection is teardown -teardown: - - skip: - version: " - 2.15.99" - reason: "fixed in 2.16.0" - - - do: - indices.delete: - index: test,test1 - ---- -"Mappings": - - skip: - version: " - 2.15.99" - reason: "fixed in 2.16.0" + index: test # Check mapping - do: @@ -101,17 +62,10 @@ teardown: - match: { hits.hits.0._source.genre: "1" } - match: { hits.hits.1._source.genre: 1 } + # Delete Index when connection is teardown - do: - search: - index: test1 - body: { - query: { - match_all: {} - } - } - - - length: { hits.hits: 1 } - - match: { hits.hits.0._source.genre: "d3efault" } + indices.delete: + index: test --- "Queries": @@ -119,6 +73,30 @@ teardown: version: " - 2.16.99" reason: "fixed in 2.17.0" + - do: + indices.create: + index: test1 + body: + mappings: + properties: + genre: + type: "constant_keyword" + value: "d3efault" + + # Index documents to test query. + - do: + index: + index: test1 + id: 1 + body: { + "genre": "d3efault" + } + + # Refresh + - do: + indices.refresh: + index: test1 + # Test rangeQuery - do: search: @@ -335,3 +313,20 @@ teardown: } - length: { hits.hits: 0 } + + - do: + search: + index: test1 + body: { + query: { + match_all: {} + } + } + + - length: { hits.hits: 1 } + - match: { hits.hits.0._source.genre: "d3efault" } + + # Delete Index when connection is teardown + - do: + indices.delete: + index: test1