Remove type mapping from document index API (#2026)
* Remove doc type specific indexing APIs and relevant changes Signed-off-by: Suraj Singh <surajrider@gmail.com> * Remove type param from yml and integ test files Signed-off-by: Suraj Singh <surajrider@gmail.com>
This commit is contained in:
parent
f0984eb409
commit
892801a074
|
@ -70,11 +70,7 @@ import org.opensearch.index.VersionType;
|
|||
import org.opensearch.index.get.GetResult;
|
||||
import org.opensearch.rest.RestStatus;
|
||||
import org.opensearch.rest.action.document.RestBulkAction;
|
||||
import org.opensearch.rest.action.document.RestDeleteAction;
|
||||
import org.opensearch.rest.action.document.RestGetAction;
|
||||
import org.opensearch.rest.action.document.RestIndexAction;
|
||||
import org.opensearch.rest.action.document.RestMultiGetAction;
|
||||
import org.opensearch.rest.action.document.RestUpdateAction;
|
||||
import org.opensearch.script.Script;
|
||||
import org.opensearch.script.ScriptType;
|
||||
import org.opensearch.search.fetch.subphase.FetchSourceContext;
|
||||
|
@ -206,31 +202,6 @@ public class CrudIT extends OpenSearchRestHighLevelClientTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
public void testDeleteWithTypes() throws IOException {
|
||||
String docId = "id";
|
||||
IndexRequest indexRequest = new IndexRequest("index", "type", docId);
|
||||
indexRequest.source(Collections.singletonMap("foo", "bar"));
|
||||
execute(
|
||||
indexRequest,
|
||||
highLevelClient()::index,
|
||||
highLevelClient()::indexAsync,
|
||||
expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE)
|
||||
);
|
||||
|
||||
DeleteRequest deleteRequest = new DeleteRequest("index", "type", docId);
|
||||
DeleteResponse deleteResponse = execute(
|
||||
deleteRequest,
|
||||
highLevelClient()::delete,
|
||||
highLevelClient()::deleteAsync,
|
||||
expectWarningsOnce(RestDeleteAction.TYPES_DEPRECATION_MESSAGE)
|
||||
);
|
||||
|
||||
assertEquals("index", deleteResponse.getIndex());
|
||||
assertEquals("type", deleteResponse.getType());
|
||||
assertEquals(docId, deleteResponse.getId());
|
||||
assertEquals(DocWriteResponse.Result.DELETED, deleteResponse.getResult());
|
||||
}
|
||||
|
||||
public void testExists() throws IOException {
|
||||
{
|
||||
GetRequest getRequest = new GetRequest("index", "id");
|
||||
|
@ -416,36 +387,6 @@ public class CrudIT extends OpenSearchRestHighLevelClientTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
public void testGetWithTypes() throws IOException {
|
||||
String document = "{\"field\":\"value\"}";
|
||||
IndexRequest indexRequest = new IndexRequest("index", "type", "id");
|
||||
indexRequest.source(document, XContentType.JSON);
|
||||
indexRequest.setRefreshPolicy(RefreshPolicy.IMMEDIATE);
|
||||
execute(
|
||||
indexRequest,
|
||||
highLevelClient()::index,
|
||||
highLevelClient()::indexAsync,
|
||||
expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE)
|
||||
);
|
||||
|
||||
GetRequest getRequest = new GetRequest("index", "type", "id");
|
||||
GetResponse getResponse = execute(
|
||||
getRequest,
|
||||
highLevelClient()::get,
|
||||
highLevelClient()::getAsync,
|
||||
expectWarningsOnce(RestGetAction.TYPES_DEPRECATION_MESSAGE)
|
||||
);
|
||||
|
||||
assertEquals("index", getResponse.getIndex());
|
||||
assertEquals("type", getResponse.getType());
|
||||
assertEquals("id", getResponse.getId());
|
||||
|
||||
assertTrue(getResponse.isExists());
|
||||
assertFalse(getResponse.isSourceEmpty());
|
||||
assertEquals(1L, getResponse.getVersion());
|
||||
assertEquals(document, getResponse.getSourceAsString());
|
||||
}
|
||||
|
||||
public void testMultiGet() throws IOException {
|
||||
{
|
||||
MultiGetRequest multiGetRequest = new MultiGetRequest();
|
||||
|
@ -739,22 +680,6 @@ public class CrudIT extends OpenSearchRestHighLevelClientTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
public void testIndexWithTypes() throws IOException {
|
||||
final XContentType xContentType = randomFrom(XContentType.values());
|
||||
IndexRequest indexRequest = new IndexRequest("index", "some_type", "some_id");
|
||||
indexRequest.source(XContentBuilder.builder(xContentType.xContent()).startObject().field("test", "test").endObject());
|
||||
IndexResponse indexResponse = execute(
|
||||
indexRequest,
|
||||
highLevelClient()::index,
|
||||
highLevelClient()::indexAsync,
|
||||
expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE)
|
||||
);
|
||||
assertEquals(RestStatus.CREATED, indexResponse.status());
|
||||
assertEquals("index", indexResponse.getIndex());
|
||||
assertEquals("some_type", indexResponse.getType());
|
||||
assertEquals("some_id", indexResponse.getId());
|
||||
}
|
||||
|
||||
public void testUpdate() throws IOException {
|
||||
{
|
||||
UpdateRequest updateRequest = new UpdateRequest("index", "does_not_exist");
|
||||
|
@ -955,29 +880,6 @@ public class CrudIT extends OpenSearchRestHighLevelClientTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
public void testUpdateWithTypes() throws IOException {
|
||||
IndexRequest indexRequest = new IndexRequest("index", "type", "id");
|
||||
indexRequest.source(singletonMap("field", "value"));
|
||||
IndexResponse indexResponse = execute(
|
||||
indexRequest,
|
||||
highLevelClient()::index,
|
||||
highLevelClient()::indexAsync,
|
||||
expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE)
|
||||
);
|
||||
|
||||
UpdateRequest updateRequest = new UpdateRequest("index", "type", "id");
|
||||
updateRequest.doc(singletonMap("field", "updated"), randomFrom(XContentType.values()));
|
||||
UpdateResponse updateResponse = execute(
|
||||
updateRequest,
|
||||
highLevelClient()::update,
|
||||
highLevelClient()::updateAsync,
|
||||
expectWarningsOnce(RestUpdateAction.TYPES_DEPRECATION_MESSAGE)
|
||||
);
|
||||
|
||||
assertEquals(RestStatus.OK, updateResponse.status());
|
||||
assertEquals(indexResponse.getVersion() + 1, updateResponse.getVersion());
|
||||
}
|
||||
|
||||
public void testBulk() throws IOException {
|
||||
int nbItems = randomIntBetween(10, 100);
|
||||
boolean[] errors = new boolean[nbItems];
|
||||
|
|
|
@ -64,7 +64,6 @@ import org.opensearch.index.query.TermsQueryBuilder;
|
|||
import org.opensearch.join.aggregations.Children;
|
||||
import org.opensearch.join.aggregations.ChildrenAggregationBuilder;
|
||||
import org.opensearch.rest.RestStatus;
|
||||
import org.opensearch.rest.action.document.RestIndexAction;
|
||||
import org.opensearch.script.Script;
|
||||
import org.opensearch.script.ScriptType;
|
||||
import org.opensearch.script.mustache.MultiSearchTemplateRequest;
|
||||
|
@ -125,24 +124,19 @@ public class SearchIT extends OpenSearchRestHighLevelClientTestCase {
|
|||
@Before
|
||||
public void indexDocuments() throws IOException {
|
||||
{
|
||||
Request doc1 = new Request(HttpPut.METHOD_NAME, "/index/type/1");
|
||||
doc1.setOptions(expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
|
||||
Request doc1 = new Request(HttpPut.METHOD_NAME, "/index/_doc/1");
|
||||
doc1.setJsonEntity("{\"type\":\"type1\", \"id\":1, \"num\":10, \"num2\":50}");
|
||||
client().performRequest(doc1);
|
||||
Request doc2 = new Request(HttpPut.METHOD_NAME, "/index/type/2");
|
||||
doc2.setOptions(expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
|
||||
Request doc2 = new Request(HttpPut.METHOD_NAME, "/index/_doc/2");
|
||||
doc2.setJsonEntity("{\"type\":\"type1\", \"id\":2, \"num\":20, \"num2\":40}");
|
||||
client().performRequest(doc2);
|
||||
Request doc3 = new Request(HttpPut.METHOD_NAME, "/index/type/3");
|
||||
doc3.setOptions(expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
|
||||
Request doc3 = new Request(HttpPut.METHOD_NAME, "/index/_doc/3");
|
||||
doc3.setJsonEntity("{\"type\":\"type1\", \"id\":3, \"num\":50, \"num2\":35}");
|
||||
client().performRequest(doc3);
|
||||
Request doc4 = new Request(HttpPut.METHOD_NAME, "/index/type/4");
|
||||
doc4.setOptions(expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
|
||||
Request doc4 = new Request(HttpPut.METHOD_NAME, "/index/_doc/4");
|
||||
doc4.setJsonEntity("{\"type\":\"type2\", \"id\":4, \"num\":100, \"num2\":10}");
|
||||
client().performRequest(doc4);
|
||||
Request doc5 = new Request(HttpPut.METHOD_NAME, "/index/type/5");
|
||||
doc5.setOptions(expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
|
||||
Request doc5 = new Request(HttpPut.METHOD_NAME, "/index/_doc/5");
|
||||
doc5.setJsonEntity("{\"type\":\"type2\", \"id\":5, \"num\":100, \"num2\":10}");
|
||||
client().performRequest(doc5);
|
||||
}
|
||||
|
@ -241,13 +235,11 @@ public class SearchIT extends OpenSearchRestHighLevelClientTestCase {
|
|||
assertEquals(5, searchResponse.getHits().getHits().length);
|
||||
for (SearchHit searchHit : searchResponse.getHits().getHits()) {
|
||||
assertEquals("index", searchHit.getIndex());
|
||||
assertEquals("type", searchHit.getType());
|
||||
assertThat(Integer.valueOf(searchHit.getId()), both(greaterThan(0)).and(lessThan(6)));
|
||||
assertEquals(1.0f, searchHit.getScore(), 0);
|
||||
assertEquals(-1L, searchHit.getVersion());
|
||||
assertNotNull(searchHit.getSourceAsMap());
|
||||
assertEquals(4, searchHit.getSourceAsMap().size());
|
||||
assertTrue(searchHit.getSourceAsMap().containsKey("type"));
|
||||
assertTrue(searchHit.getSourceAsMap().containsKey("num"));
|
||||
assertTrue(searchHit.getSourceAsMap().containsKey("num2"));
|
||||
}
|
||||
|
@ -266,7 +258,6 @@ public class SearchIT extends OpenSearchRestHighLevelClientTestCase {
|
|||
assertThat(searchResponse.getHits().getMaxScore(), greaterThan(0f));
|
||||
SearchHit searchHit = searchResponse.getHits().getHits()[0];
|
||||
assertEquals("index", searchHit.getIndex());
|
||||
assertEquals("type", searchHit.getType());
|
||||
assertEquals("1", searchHit.getId());
|
||||
assertThat(searchHit.getScore(), greaterThan(0f));
|
||||
assertEquals(-1L, searchHit.getVersion());
|
||||
|
|
|
@ -43,7 +43,7 @@ public class RequestsWithoutContentIT extends OpenSearchRestTestCase {
|
|||
|
||||
public void testIndexMissingBody() throws IOException {
|
||||
ResponseException responseException = expectThrows(ResponseException.class, () ->
|
||||
client().performRequest(new Request(randomBoolean() ? "POST" : "PUT", "/idx/type/123")));
|
||||
client().performRequest(new Request(randomBoolean() ? "POST" : "PUT", "/idx/_doc/123")));
|
||||
assertResponseException(responseException, "request body is required");
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,6 @@ teardown:
|
|||
catch: '/Unable to find match for dissect pattern: \%\{a\},\%\{b\},\%\{c\} against source: foo bar baz/'
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 2
|
||||
pipeline: "my_pipeline"
|
||||
body: {message: "foo bar baz"}
|
||||
|
|
|
@ -31,7 +31,6 @@ teardown:
|
|||
- do:
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
pipeline: "my_pipeline"
|
||||
body: >
|
||||
|
@ -42,7 +41,6 @@ teardown:
|
|||
- do:
|
||||
get:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
- match: { _source.values: ["FOO", "BAR", "BAZ"] }
|
||||
|
||||
|
|
|
@ -50,7 +50,6 @@ import org.opensearch.common.xcontent.json.JsonXContent;
|
|||
import org.opensearch.common.xcontent.support.XContentMapValues;
|
||||
import org.opensearch.index.IndexSettings;
|
||||
import org.opensearch.rest.action.document.RestBulkAction;
|
||||
import org.opensearch.rest.action.document.RestIndexAction;
|
||||
import org.opensearch.rest.action.document.RestUpdateAction;
|
||||
import org.opensearch.rest.action.search.RestExplainAction;
|
||||
import org.opensearch.test.NotEqualMessageBuilder;
|
||||
|
@ -989,9 +988,6 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
|
|||
for (int i = 0; i < numDocs; i++) {
|
||||
String doc = Strings.toString(JsonXContent.contentBuilder().startObject().field("field", "v1").endObject());
|
||||
Request request = new Request("POST", "/" + index + "/" + type + "/" + i);
|
||||
if (isRunningAgainstAncientCluster() == false) {
|
||||
request.setOptions(expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
|
||||
}
|
||||
request.setJsonEntity(doc);
|
||||
client().performRequest(request);
|
||||
refresh();
|
||||
|
@ -1258,9 +1254,6 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
|
|||
Request request = new Request("PUT", "/info/" + this.type + "/" + index + "_" + type);
|
||||
request.addParameter("op_type", "create");
|
||||
request.setJsonEntity(Strings.toString(infoDoc));
|
||||
if (isRunningAgainstAncientCluster() == false) {
|
||||
request.setOptions(expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
|
||||
}
|
||||
client().performRequest(request);
|
||||
}
|
||||
|
||||
|
@ -1516,11 +1509,7 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
|
|||
|
||||
Request bulk = new Request("POST", "/_bulk");
|
||||
bulk.addParameter("refresh", "true");
|
||||
bulk.setJsonEntity("{\"index\": {\"_index\": \"test_index_old\", \"_type\" : \"" + type + "\"}}\n" +
|
||||
"{\"f1\": \"v1\", \"f2\": \"v2\"}\n");
|
||||
if (isRunningAgainstAncientCluster() == false) {
|
||||
bulk.setOptions(expectWarnings(RestBulkAction.TYPES_DEPRECATION_MESSAGE));
|
||||
}
|
||||
bulk.setJsonEntity("{\"index\": {\"_index\": \"test_index_old\"}}\n" + "{\"f1\": \"v1\", \"f2\": \"v2\"}\n");
|
||||
client().performRequest(bulk);
|
||||
|
||||
// start a async reindex job
|
||||
|
|
|
@ -67,9 +67,8 @@ public class IndexingIT extends OpenSearchRestTestCase {
|
|||
private int indexDocs(String index, final int idStart, final int numDocs) throws IOException {
|
||||
for (int i = 0; i < numDocs; i++) {
|
||||
final int id = idStart + i;
|
||||
Request request = new Request("PUT", index + "/doc/" + id);
|
||||
Request request = new Request("PUT", index + "/_doc/" + id);
|
||||
request.setJsonEntity("{\"test\": \"test_" + randomAlphaOfLength(2) + "\"}");
|
||||
request.setOptions(expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
|
||||
assertOK(client().performRequest(request));
|
||||
}
|
||||
return numDocs;
|
||||
|
@ -364,7 +363,7 @@ public class IndexingIT extends OpenSearchRestTestCase {
|
|||
}
|
||||
|
||||
private void assertVersion(final String index, final int docId, final String preference, final int expectedVersion) throws IOException {
|
||||
Request request = new Request("GET", index + "/doc/" + docId);
|
||||
Request request = new Request("GET", index + "/_doc/" + docId);
|
||||
request.addParameter("preference", preference);
|
||||
request.setOptions(expectWarnings(RestGetAction.TYPES_DEPRECATION_MESSAGE));
|
||||
|
||||
|
|
|
@ -123,9 +123,8 @@ public class RecoveryIT extends AbstractRollingTestCase {
|
|||
private int indexDocs(String index, final int idStart, final int numDocs) throws IOException {
|
||||
for (int i = 0; i < numDocs; i++) {
|
||||
final int id = idStart + i;
|
||||
Request indexDoc = new Request("PUT", index + "/test/" + id);
|
||||
Request indexDoc = new Request("PUT", index + "/_doc/" + id);
|
||||
indexDoc.setJsonEntity("{\"test\": \"test_" + randomAsciiOfLength(2) + "\"}");
|
||||
indexDoc.setOptions(expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
|
||||
client().performRequest(indexDoc);
|
||||
}
|
||||
return numDocs;
|
||||
|
@ -659,7 +658,7 @@ public class RecoveryIT extends AbstractRollingTestCase {
|
|||
final int times = randomIntBetween(0, 2);
|
||||
for (int i = 0; i < times; i++) {
|
||||
long value = randomNonNegativeLong();
|
||||
Request update = new Request("POST", index + "/test/" + docId + "/_update");
|
||||
Request update = new Request("POST", index + "/_update/" + docId);
|
||||
update.setOptions(expectWarnings(RestUpdateAction.TYPES_DEPRECATION_MESSAGE));
|
||||
update.setJsonEntity("{\"doc\": {\"updated_field\": " + value + "}}");
|
||||
client().performRequest(update);
|
||||
|
@ -668,7 +667,7 @@ public class RecoveryIT extends AbstractRollingTestCase {
|
|||
}
|
||||
client().performRequest(new Request("POST", index + "/_refresh"));
|
||||
for (int docId : updates.keySet()) {
|
||||
Request get = new Request("GET", index + "/test/" + docId);
|
||||
Request get = new Request("GET", index + "/_doc/" + docId);
|
||||
get.setOptions(expectWarnings(RestGetAction.TYPES_DEPRECATION_MESSAGE));
|
||||
Map<String, Object> doc = entityAsMap(client().performRequest(get));
|
||||
assertThat(XContentMapValues.extractValue("_source.updated_field", doc), equalTo(updates.get(docId)));
|
||||
|
|
|
@ -74,7 +74,6 @@
|
|||
catch: /There are no ingest nodes in this cluster, unable to forward request to an ingest node./
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
pipeline: "my_pipeline_1"
|
||||
body: {
|
||||
|
@ -92,12 +91,10 @@
|
|||
body:
|
||||
- index:
|
||||
_index: test_index
|
||||
_type: test_type
|
||||
_id: test_id
|
||||
- f1: v1
|
||||
- index:
|
||||
_index: test_index
|
||||
_type: test_type
|
||||
_id: test_id2
|
||||
- f1: v2
|
||||
|
||||
|
@ -109,12 +106,10 @@
|
|||
body:
|
||||
- index:
|
||||
_index: test_index
|
||||
_type: test_type
|
||||
_id: test_id
|
||||
- f1: v1
|
||||
- index:
|
||||
_index: test_index
|
||||
_type: test_type
|
||||
_id: test_id2
|
||||
pipeline: my_pipeline_1
|
||||
- f1: v2
|
||||
|
|
|
@ -14,13 +14,13 @@
|
|||
{
|
||||
"set" : {
|
||||
"field" : "index_type_id",
|
||||
"value": "{{_index}}/{{_type}}/{{_id}}"
|
||||
"value": "{{_index}}/{{_id}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"append" : {
|
||||
"field" : "metadata",
|
||||
"value": ["{{_index}}", "{{_type}}", "{{_id}}"]
|
||||
"value": ["{{_index}}", "{{_id}}"]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -30,7 +30,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
pipeline: "my_pipeline_1"
|
||||
body: {}
|
||||
|
@ -38,11 +37,10 @@
|
|||
- do:
|
||||
get:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
- length: { _source: 2 }
|
||||
- match: { _source.index_type_id: "test/test/1" }
|
||||
- match: { _source.metadata: ["test", "test", "1"] }
|
||||
- match: { _source.index_type_id: "test/1" }
|
||||
- match: { _source.metadata: ["test", "1"] }
|
||||
|
||||
---
|
||||
"Test templating":
|
||||
|
@ -110,7 +108,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
pipeline: "my_pipeline_1"
|
||||
body: {
|
||||
|
@ -123,7 +120,6 @@
|
|||
- do:
|
||||
get:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
- length: { _source: 5 }
|
||||
- match: { _source.field1: "1" }
|
||||
|
@ -135,7 +131,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
pipeline: "my_pipeline_2"
|
||||
body: {
|
||||
|
@ -145,7 +140,6 @@
|
|||
- do:
|
||||
get:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
- length: { _source: 2 }
|
||||
- match: { _source.field1: "field2" }
|
||||
|
@ -154,7 +148,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
pipeline: "my_pipeline_3"
|
||||
body: {
|
||||
|
@ -165,7 +158,6 @@
|
|||
- do:
|
||||
get:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
- length: { _source: 1 }
|
||||
- match: { _source.field_to_remove: "field2" }
|
||||
|
@ -204,7 +196,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
pipeline: "my_handled_pipeline"
|
||||
body: {
|
||||
|
@ -214,7 +205,6 @@
|
|||
- do:
|
||||
get:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
- length: { _source: 2 }
|
||||
- match: { _source.do_nothing: "foo" }
|
||||
|
@ -246,7 +236,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
pipeline: "_id"
|
||||
body: {
|
||||
|
@ -268,7 +257,6 @@
|
|||
- do:
|
||||
get:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
- length: { _source: 2 }
|
||||
- match: { _source.values_flat: ["foo_bar", "foo_baz"] }
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
pipeline: "_id"
|
||||
body: {
|
||||
|
@ -58,7 +57,6 @@
|
|||
- do:
|
||||
get:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
- length: { _source: 13 }
|
||||
- match: { _source.request: "/presentations/logstash-scale11x/images/ahhh___rage_face_by_samusmmx-d5g5zap.png" }
|
||||
|
@ -137,7 +135,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
pipeline: "_id"
|
||||
body: {
|
||||
|
@ -178,7 +175,6 @@
|
|||
- do:
|
||||
get:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
- length: { _source: 11 }
|
||||
- is_false: _source.friends.0.id
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: twitter
|
||||
type: tweet
|
||||
id: 1
|
||||
body: { "user": "foobar" }
|
||||
- do:
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
pipeline: "my_pipeline"
|
||||
body: { bytes_in: 1234, bytes_out: 4321 }
|
||||
|
@ -30,7 +29,6 @@
|
|||
- do:
|
||||
get:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
- match: { _source.bytes_in: 1234 }
|
||||
- match: { _source.bytes_out: 4321 }
|
||||
|
@ -72,7 +70,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
pipeline: "my_pipeline"
|
||||
body: { bytes_in: 1234, bytes_out: 4321 }
|
||||
|
@ -80,7 +77,6 @@
|
|||
- do:
|
||||
get:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
- match: { _source.bytes_in: 1234 }
|
||||
- match: { _source.bytes_out: 4321 }
|
||||
|
|
|
@ -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
|
||||
|
|
@ -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 }
|
|
@ -5,7 +5,6 @@ setup:
|
|||
- do:
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
body: { foo: bar }
|
||||
|
||||
|
@ -18,7 +17,6 @@ setup:
|
|||
- do:
|
||||
count:
|
||||
index: test
|
||||
type: test
|
||||
body:
|
||||
query:
|
||||
match:
|
||||
|
@ -42,7 +40,6 @@ setup:
|
|||
- do:
|
||||
count:
|
||||
index: test
|
||||
type: test
|
||||
body: { }
|
||||
|
||||
- match: {count : 1}
|
||||
|
@ -50,7 +47,6 @@ setup:
|
|||
- do:
|
||||
count:
|
||||
index: test
|
||||
type: test
|
||||
|
||||
- match: {count : 1}
|
||||
|
||||
|
@ -60,7 +56,6 @@ setup:
|
|||
catch: bad_request
|
||||
count:
|
||||
index: test
|
||||
type: test
|
||||
body:
|
||||
match:
|
||||
foo: bar
|
||||
|
|
|
@ -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 }
|
|
@ -1,8 +0,0 @@
|
|||
---
|
||||
"Create without ID":
|
||||
- do:
|
||||
catch: param
|
||||
create:
|
||||
index: test_1
|
||||
type: test
|
||||
body: { foo: bar }
|
|
@ -5,7 +5,6 @@
|
|||
catch: bad_request
|
||||
create:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
body: { foo: bar }
|
||||
version_type: external
|
||||
|
@ -19,7 +18,6 @@
|
|||
catch: bad_request
|
||||
create:
|
||||
index: test
|
||||
type: test
|
||||
id: 2
|
||||
body: { foo: bar }
|
||||
version_type: external
|
||||
|
|
|
@ -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
|
||||
|
|
@ -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 }
|
|
@ -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" } ]
|
|
@ -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 }
|
|
@ -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
|
|
@ -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 }
|
|
@ -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 }
|
|
@ -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}
|
|
@ -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}
|
|
@ -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
|
||||
|
|
@ -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 }
|
|
@ -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
|
|
@ -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}
|
|
@ -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: ''
|
|
@ -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: ''
|
|
@ -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: ''
|
|
@ -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: ''
|
|
@ -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: {}
|
||||
|
|
@ -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
|
|
@ -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
|
|
@ -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 }
|
|
@ -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 }}
|
|
@ -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: 中文" } }
|
|
@ -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" } }
|
||||
|
|
@ -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 }
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -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 }}
|
|
@ -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
|
|
@ -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 }
|
|
@ -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
|
|
@ -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
|
||||
|
|
@ -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 } }
|
|
@ -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 } }
|
|
@ -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
|
||||
|
|
@ -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}}
|
||||
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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 }
|
|
@ -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 }
|
|
@ -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 }}
|
|
@ -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 }
|
|
@ -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}
|
|
@ -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}
|
|
@ -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
|
||||
|
|
@ -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 }
|
|
@ -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
|
|
@ -1,149 +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
|
||||
features: allowed_warnings
|
||||
|
||||
- do:
|
||||
indices.put_template:
|
||||
include_type_name: true
|
||||
name: test_template
|
||||
body:
|
||||
index_patterns: test-*
|
||||
mappings:
|
||||
my_type:
|
||||
properties:
|
||||
foo:
|
||||
type: keyword
|
||||
|
||||
- do:
|
||||
allowed_warnings:
|
||||
- "index [test-1] matches multiple legacy templates [global, test_template], composable templates will only match a single template"
|
||||
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
|
||||
features: allowed_warnings
|
||||
|
||||
- do:
|
||||
indices.put_template:
|
||||
include_type_name: false
|
||||
name: test_template
|
||||
body:
|
||||
index_patterns: test-*
|
||||
mappings:
|
||||
properties:
|
||||
foo:
|
||||
type: keyword
|
||||
|
||||
- do:
|
||||
allowed_warnings:
|
||||
- "index [test-1] matches multiple legacy templates [global, test_template], composable templates will only match a single template"
|
||||
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
|
||||
features: allowed_warnings
|
||||
|
||||
- do:
|
||||
indices.put_template:
|
||||
include_type_name: true
|
||||
name: test_template
|
||||
body:
|
||||
index_patterns: test-*
|
||||
mappings:
|
||||
my_type:
|
||||
properties:
|
||||
foo:
|
||||
type: keyword
|
||||
|
||||
- do:
|
||||
allowed_warnings:
|
||||
- "index [test-1] matches multiple legacy templates [global, test_template], composable templates will only match a single template"
|
||||
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
|
|
@ -20,7 +20,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: test
|
||||
type: doc
|
||||
id: 1
|
||||
body: { "message": "a long message to make a periodic flush happen after this index operation" }
|
||||
- do:
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: logs-1
|
||||
type: test
|
||||
id: "1"
|
||||
body: { "foo": "hello world" }
|
||||
# make this doc visible in index stats
|
||||
|
@ -25,11 +24,9 @@
|
|||
- do:
|
||||
get:
|
||||
index: logs_search
|
||||
type: test
|
||||
id: "1"
|
||||
|
||||
- match: { _index: logs-1 }
|
||||
- match: { _type: test }
|
||||
- match: { _id: "1" }
|
||||
- match: { _source: { foo: "hello world" } }
|
||||
|
||||
|
@ -59,7 +56,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: logs-000002
|
||||
type: test
|
||||
id: "2"
|
||||
body: { "foo": "hello world" }
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: logs-1
|
||||
type: test
|
||||
id: "1"
|
||||
body: { "foo": "hello world" }
|
||||
refresh: true
|
||||
|
@ -38,7 +37,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: logs-1
|
||||
type: test
|
||||
id: "2"
|
||||
body: { "foo": "hello world" }
|
||||
refresh: true
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: logs-1
|
||||
type: doc
|
||||
id: "1"
|
||||
body: { "foo": "hello world" }
|
||||
refresh: true
|
||||
|
|
|
@ -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 }
|
|
@ -25,7 +25,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: index1
|
||||
type: type
|
||||
body: { foo: bar }
|
||||
refresh: true
|
||||
|
||||
|
@ -53,7 +52,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: index1
|
||||
type: type
|
||||
body: { foo: bar }
|
||||
refresh: true
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: index1
|
||||
type: type
|
||||
body: { foo: bar }
|
||||
refresh: true
|
||||
|
||||
|
@ -59,13 +58,11 @@
|
|||
- do:
|
||||
index:
|
||||
index: index1
|
||||
type: type
|
||||
body: { foo: bar }
|
||||
refresh: true
|
||||
- do:
|
||||
index:
|
||||
index: index2
|
||||
type: type
|
||||
body: { foo: bar }
|
||||
refresh: true
|
||||
- do:
|
||||
|
|
|
@ -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
|
|
@ -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 }}
|
|
@ -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 }}
|
|
@ -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" }
|
|
@ -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 }}
|
|
@ -1,45 +0,0 @@
|
|||
---
|
||||
"Multi Get with alias that resolves to multiple indices":
|
||||
- skip:
|
||||
version: " - 7.8.99"
|
||||
reason: "message was changed to fix grammar in 7.9"
|
||||
|
||||
- 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: "/[aA]lias.\\[test_two_and_three\\].has.more.than.one.index.associated.with.it.\\[test_[23]{1},.test_[23]{1}\\],.can't.execute.a.single.index.op/" }
|
|
@ -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: {}
|
|
@ -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 }}
|
||||
|
|
@ -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" }
|
|
@ -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
|
|
@ -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 } } }
|
|
@ -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 }
|
|
@ -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 }
|
|
@ -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}
|
|
@ -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"
|
|
@ -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
|
|
@ -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}
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -6,7 +6,6 @@
|
|||
- do:
|
||||
index:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
body: { foo: bar }
|
||||
|
||||
|
@ -18,7 +17,6 @@
|
|||
- do:
|
||||
update:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
body:
|
||||
doc: { foo: bar }
|
||||
|
@ -31,7 +29,6 @@
|
|||
- do:
|
||||
update:
|
||||
index: test_1
|
||||
type: test
|
||||
id: 1
|
||||
body:
|
||||
doc: { foo: bar }
|
||||
|
|
|
@ -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 }
|
|
@ -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 }
|
|
@ -38,9 +38,7 @@ import org.opensearch.action.index.IndexRequest;
|
|||
import org.opensearch.action.support.ActiveShardCount;
|
||||
import org.opensearch.client.node.NodeClient;
|
||||
import org.opensearch.cluster.node.DiscoveryNodes;
|
||||
import org.opensearch.common.logging.DeprecationLogger;
|
||||
import org.opensearch.index.VersionType;
|
||||
import org.opensearch.index.mapper.MapperService;
|
||||
import org.opensearch.rest.BaseRestHandler;
|
||||
import org.opensearch.rest.RestRequest;
|
||||
import org.opensearch.rest.action.RestActions;
|
||||
|
@ -57,21 +55,10 @@ import static org.opensearch.rest.RestRequest.Method.POST;
|
|||
import static org.opensearch.rest.RestRequest.Method.PUT;
|
||||
|
||||
public class RestIndexAction extends BaseRestHandler {
|
||||
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteAction.class);
|
||||
public static final String TYPES_DEPRECATION_MESSAGE = "[types removal] Specifying types in document "
|
||||
+ "index requests is deprecated, use the typeless endpoints instead (/{index}/_doc/{id}, /{index}/_doc, "
|
||||
+ "or /{index}/_create/{id}).";
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return unmodifiableList(
|
||||
asList(
|
||||
new Route(POST, "/{index}/_doc/{id}"),
|
||||
new Route(PUT, "/{index}/_doc/{id}"),
|
||||
new Route(POST, "/{index}/{type}/{id}"),
|
||||
new Route(PUT, "/{index}/{type}/{id}")
|
||||
)
|
||||
);
|
||||
return unmodifiableList(asList(new Route(POST, "/{index}/_doc/{id}"), new Route(PUT, "/{index}/_doc/{id}")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -88,14 +75,7 @@ public class RestIndexAction extends BaseRestHandler {
|
|||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return unmodifiableList(
|
||||
asList(
|
||||
new Route(POST, "/{index}/_create/{id}"),
|
||||
new Route(PUT, "/{index}/_create/{id}"),
|
||||
new Route(POST, "/{index}/{type}/{id}/_create"),
|
||||
new Route(PUT, "/{index}/{type}/{id}/_create")
|
||||
)
|
||||
);
|
||||
return unmodifiableList(asList(new Route(POST, "/{index}/_create/{id}"), new Route(PUT, "/{index}/_create/{id}")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -127,7 +107,7 @@ public class RestIndexAction extends BaseRestHandler {
|
|||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return unmodifiableList(asList(new Route(POST, "/{index}/_doc"), new Route(POST, "/{index}/{type}")));
|
||||
return unmodifiableList(asList(new Route(POST, "/{index}/_doc")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -145,13 +125,8 @@ public class RestIndexAction extends BaseRestHandler {
|
|||
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
|
||||
IndexRequest indexRequest;
|
||||
final String type = request.param("type");
|
||||
if (type != null && type.equals(MapperService.SINGLE_MAPPING_NAME) == false) {
|
||||
deprecationLogger.deprecate("index_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
indexRequest = new IndexRequest(request.param("index"), type, request.param("id"));
|
||||
} else {
|
||||
indexRequest = new IndexRequest(request.param("index"));
|
||||
indexRequest.id(request.param("id"));
|
||||
}
|
||||
indexRequest = new IndexRequest(request.param("index"));
|
||||
indexRequest.id(request.param("id"));
|
||||
indexRequest.routing(request.param("routing"));
|
||||
indexRequest.setPipeline(request.param("pipeline"));
|
||||
indexRequest.source(request.requiredContent(), request.getXContentType());
|
||||
|
|
|
@ -67,26 +67,14 @@ public class RestIndexActionTests extends RestActionTestCase {
|
|||
controller().registerHandler(new AutoIdHandler(() -> clusterStateSupplier.get().nodes()));
|
||||
}
|
||||
|
||||
public void testTypeInPath() {
|
||||
RestRequest deprecatedRequest = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.PUT)
|
||||
.withPath("/some_index/some_type/some_id")
|
||||
.build();
|
||||
dispatchRequest(deprecatedRequest);
|
||||
assertWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE);
|
||||
|
||||
public void testPath() {
|
||||
RestRequest validRequest = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.PUT)
|
||||
.withPath("/some_index/_doc/some_id")
|
||||
.build();
|
||||
dispatchRequest(validRequest);
|
||||
}
|
||||
|
||||
public void testCreateWithTypeInPath() {
|
||||
RestRequest deprecatedRequest = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.PUT)
|
||||
.withPath("/some_index/some_type/some_id/_create")
|
||||
.build();
|
||||
dispatchRequest(deprecatedRequest);
|
||||
assertWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE);
|
||||
|
||||
public void testCreatePath() {
|
||||
RestRequest validRequest = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.PUT)
|
||||
.withPath("/some_index/_create/some_id")
|
||||
.build();
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue