string has been split into text and keyword.

Original commit: elastic/x-pack-elasticsearch@b98100f8b5
This commit is contained in:
Adrien Grand 2016-03-03 09:17:20 +01:00
parent ba21e6f3d7
commit c16ca2c779
16 changed files with 182 additions and 294 deletions

View File

@ -15,8 +15,7 @@
"date_detection": false, "date_detection": false,
"properties": { "properties": {
"cluster_uuid": { "cluster_uuid": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"timestamp": { "timestamp": {
"type": "date", "type": "date",
@ -25,24 +24,19 @@
"source_node": { "source_node": {
"properties": { "properties": {
"uuid": { "uuid": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"host": { "host": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"transport_address": { "transport_address": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"ip": { "ip": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"name": { "name": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"attributes": { "attributes": {
"dynamic": true, "dynamic": true,
@ -101,8 +95,7 @@
"index_stats": { "index_stats": {
"properties": { "properties": {
"index": { "index": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"primaries": { "primaries": {
"properties": { "properties": {
@ -274,16 +267,13 @@
"type": "long" "type": "long"
}, },
"master_node": { "master_node": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"state_uuid": { "state_uuid": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"status": { "status": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"nodes": { "nodes": {
"enabled": false "enabled": false
@ -298,14 +288,12 @@
"node": { "node": {
"properties": { "properties": {
"state_uuid": { "state_uuid": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"node": { "node": {
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
} }
} }
} }
@ -316,8 +304,7 @@
"node_stats": { "node_stats": {
"properties": { "properties": {
"node_id": { "node_id": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"node_master": { "node_master": {
"type": "boolean" "type": "boolean"
@ -363,32 +350,27 @@
"shards": { "shards": {
"properties": { "properties": {
"state_uuid": { "state_uuid": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"shard": { "shard": {
"properties": { "properties": {
"state": { "state": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"primary": { "primary": {
"type": "boolean" "type": "boolean"
}, },
"index": { "index": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"relocating_node": { "relocating_node": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"shard": { "shard": {
"type": "long" "type": "long"
}, },
"node": { "node": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
} }
} }
} }

View File

@ -187,8 +187,7 @@ public abstract class AbstractExporterTemplateTestCase extends MarvelIntegTestCa
.field("date_detection", false) .field("date_detection", false)
.startObject("properties") .startObject("properties")
.startObject("cluster_uuid") .startObject("cluster_uuid")
.field("type", "string") .field("type", "keyword")
.field("index", "not_analyzed")
.endObject() .endObject()
.startObject("timestamp") .startObject("timestamp")
.field("type", "date") .field("type", "date")

View File

@ -35,24 +35,21 @@
"dynamic" : "strict", "dynamic" : "strict",
"properties" : { "properties" : {
"username" : { "username" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"roles" : { "roles" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"password" : { "password" : {
"type" : "string", "type" : "keyword",
"index" : "no" "index" : false,
"doc_values": false
}, },
"full_name" : { "full_name" : {
"type" : "string", "type" : "text"
"index" : "analyzed"
}, },
"email" : { "email" : {
"type" : "string", "type" : "text",
"index" : "analyzed",
"analyzer" : "email" "analyzer" : "email"
}, },
"metadata" : { "metadata" : {
@ -65,37 +62,30 @@
"dynamic" : "strict", "dynamic" : "strict",
"properties" : { "properties" : {
"cluster" : { "cluster" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"indices" : { "indices" : {
"type" : "object", "type" : "object",
"properties" : { "properties" : {
"fields" : { "fields" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"names" : { "names" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"privileges" : { "privileges" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"query" : { "query" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
} }
} }
}, },
"name" : { "name" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"run_as" : { "run_as" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
} }
} }
} }

View File

@ -17,93 +17,60 @@
"doc_values": true "doc_values": true
}, },
"node_name": { "node_name": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"node_host_name": { "node_host_name": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"node_host_address": { "node_host_address": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"layer": { "layer": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"event_type": { "event_type": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"origin_address": { "origin_address": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"origin_type": { "origin_type": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"principal": { "principal": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"run_by_principal": { "run_by_principal": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"run_as_principal": { "run_as_principal": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"action": { "action": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"indices": { "indices": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"request": { "request": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"request_body": { "request_body": {
"type": "string", "type": "keyword",
"index": "no" "index": false,
"doc_values": false
}, },
"uri": { "uri": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"realm": { "realm": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"transport_profile": { "transport_profile": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
}, },
"rule": { "rule": {
"type": "string", "type": "keyword"
"index": "not_analyzed",
"doc_values": true
} }
} }
} }

View File

@ -84,7 +84,7 @@ public class DocumentAndFieldLevelSecurityTests extends ShieldIntegTestCase {
public void testSimpleQuery() throws Exception { public void testSimpleQuery() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1") client().prepareIndex("test", "type1", "1").setSource("field1", "value1")
.setRefresh(true) .setRefresh(true)
@ -123,7 +123,7 @@ public class DocumentAndFieldLevelSecurityTests extends ShieldIntegTestCase {
public void testQueryCache() throws Exception { public void testQueryCache() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.setSettings(Settings.builder().put(IndexModule.INDEX_QUERY_CACHE_EVERYTHING_SETTING.getKey(), true)) .setSettings(Settings.builder().put(IndexModule.INDEX_QUERY_CACHE_EVERYTHING_SETTING.getKey(), true))
.addMapping("type1", "field1", "type=string", "field2", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1") client().prepareIndex("test", "type1", "1").setSource("field1", "value1")
.setRefresh(true) .setRefresh(true)

View File

@ -81,7 +81,7 @@ public class DocumentLevelSecurityRandomTests extends ShieldIntegTestCase {
public void testDuelWithAliasFilters() throws Exception { public void testDuelWithAliasFilters() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text")
); );
List<IndexRequestBuilder> requests = new ArrayList<>(numberOfRoles); List<IndexRequestBuilder> requests = new ArrayList<>(numberOfRoles);

View File

@ -97,7 +97,7 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase {
public void testSimpleQuery() throws Exception { public void testSimpleQuery() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string", "field3", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text", "field3", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1") client().prepareIndex("test", "type1", "1").setSource("field1", "value1")
.setRefresh(true) .setRefresh(true)
@ -138,7 +138,7 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase {
public void testGetApi() throws Exception { public void testGetApi() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string", "field3", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text", "field3", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1").get(); client().prepareIndex("test", "type1", "1").setSource("field1", "value1").get();
@ -203,7 +203,7 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase {
public void testMGetApi() throws Exception { public void testMGetApi() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string", "field3", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text", "field3", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1").get(); client().prepareIndex("test", "type1", "1").setSource("field1", "value1").get();
@ -276,9 +276,9 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase {
public void testTVApi() throws Exception { public void testTVApi() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string,term_vector=with_positions_offsets_payloads", .addMapping("type1", "field1", "type=text,term_vector=with_positions_offsets_payloads",
"field2", "type=string,term_vector=with_positions_offsets_payloads", "field2", "type=text,term_vector=with_positions_offsets_payloads",
"field3", "type=string,term_vector=with_positions_offsets_payloads") "field3", "type=text,term_vector=with_positions_offsets_payloads")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1") client().prepareIndex("test", "type1", "1").setSource("field1", "value1")
.setRefresh(true) .setRefresh(true)
@ -341,9 +341,9 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase {
public void testMTVApi() throws Exception { public void testMTVApi() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string,term_vector=with_positions_offsets_payloads", .addMapping("type1", "field1", "type=text,term_vector=with_positions_offsets_payloads",
"field2", "type=string,term_vector=with_positions_offsets_payloads", "field2", "type=text,term_vector=with_positions_offsets_payloads",
"field3", "type=string,term_vector=with_positions_offsets_payloads") "field3", "type=text,term_vector=with_positions_offsets_payloads")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1") client().prepareIndex("test", "type1", "1").setSource("field1", "value1")
.setRefresh(true) .setRefresh(true)
@ -408,7 +408,7 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase {
public void testGlobalAggregation() throws Exception { public void testGlobalAggregation() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string", "field3", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text", "field3", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1") client().prepareIndex("test", "type1", "1").setSource("field1", "value1")
.setRefresh(true) .setRefresh(true)
@ -471,8 +471,8 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase {
public void testChildrenAggregation() throws Exception { public void testChildrenAggregation() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text")
.addMapping("type2", "_parent", "type=type1", "field3", "type=string") .addMapping("type2", "_parent", "type=type1", "field3", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1") client().prepareIndex("test", "type1", "1").setSource("field1", "value1")
.setRefresh(true) .setRefresh(true)
@ -528,7 +528,7 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase {
public void testParentChild() { public void testParentChild() {
assertAcked(prepareCreate("test") assertAcked(prepareCreate("test")
.addMapping("parent") .addMapping("parent")
.addMapping("child", "_parent", "type=parent", "field1", "type=string", "field2", "type=string", "field3", "type=string")); .addMapping("child", "_parent", "type=parent", "field1", "type=text", "field2", "type=text", "field3", "type=text"));
ensureGreen(); ensureGreen();
// index simple data // index simple data
@ -597,7 +597,7 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase {
public void testPercolateApi() { public void testPercolateApi() {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping(".percolator", "field1", "type=string", "field2", "type=string", "field3", "type=string") .addMapping(".percolator", "field1", "type=text", "field2", "type=text", "field3", "type=text")
); );
client().prepareIndex("test", ".percolator", "1") client().prepareIndex("test", ".percolator", "1")
.setSource("{\"query\" : { \"match_all\" : {} }, \"field1\" : \"value1\"}") .setSource("{\"query\" : { \"match_all\" : {} }, \"field1\" : \"value1\"}")
@ -678,7 +678,7 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase {
public void testRequestCache() throws Exception { public void testRequestCache() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.setSettings(Settings.builder().put(IndicesRequestCache.INDEX_CACHE_REQUEST_ENABLED_SETTING.getKey(), true)) .setSettings(Settings.builder().put(IndicesRequestCache.INDEX_CACHE_REQUEST_ENABLED_SETTING.getKey(), true))
.addMapping("type1", "field1", "type=string", "field2", "type=string", "field3", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text", "field3", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1") client().prepareIndex("test", "type1", "1").setSource("field1", "value1")
.get(); .get();
@ -721,7 +721,7 @@ public class DocumentLevelSecurityTests extends ShieldIntegTestCase {
public void testUpdateApiIsBlocked() throws Exception { public void testUpdateApiIsBlocked() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type", "field1", "type=string", "field2", "type=string") .addMapping("type", "field1", "type=text", "field2", "type=text")
); );
client().prepareIndex("test", "type", "1").setSource("field1", "value1") client().prepareIndex("test", "type", "1").setSource("field1", "value1")
.setRefresh(true) .setRefresh(true)

View File

@ -122,12 +122,12 @@ public class FieldLevelSecurityRandomTests extends ShieldIntegTestCase {
String[] fieldMappers = new String[(allowedFields.size() + disAllowedFields.size()) * 2]; String[] fieldMappers = new String[(allowedFields.size() + disAllowedFields.size()) * 2];
for (String field : allowedFields) { for (String field : allowedFields) {
fieldMappers[j++] = field; fieldMappers[j++] = field;
fieldMappers[j++] = "type=string"; fieldMappers[j++] = "type=text";
doc.put(field, "value"); doc.put(field, "value");
} }
for (String field : disAllowedFields) { for (String field : disAllowedFields) {
fieldMappers[j++] = field; fieldMappers[j++] = field;
fieldMappers[j++] = "type=string"; fieldMappers[j++] = "type=text";
doc.put(field, "value"); doc.put(field, "value");
} }
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
@ -157,7 +157,7 @@ public class FieldLevelSecurityRandomTests extends ShieldIntegTestCase {
public void testDuel() throws Exception { public void testDuel() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string", "field3", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text", "field3", "type=text")
); );
int numDocs = scaledRandomIntBetween(32, 128); int numDocs = scaledRandomIntBetween(32, 128);

View File

@ -126,7 +126,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase {
public void testQuery() throws Exception { public void testQuery() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string", "field3", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text", "field3", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3") client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3")
.setRefresh(true) .setRefresh(true)
@ -266,7 +266,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase {
public void testGetApi() throws Exception { public void testGetApi() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string", "field3", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text", "field3", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3") client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3")
@ -364,7 +364,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase {
public void testMGetApi() throws Exception { public void testMGetApi() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string", "field3", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text", "field3", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3").get(); client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3").get();
@ -476,7 +476,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase {
public void testFieldStatsApi() throws Exception { public void testFieldStatsApi() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string", "field3", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text", "field3", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3") client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3")
.setRefresh(true) .setRefresh(true)
@ -558,7 +558,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase {
public void testQueryCache() throws Exception { public void testQueryCache() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.setSettings(Settings.builder().put(IndexModule.INDEX_QUERY_CACHE_EVERYTHING_SETTING.getKey(), true)) .setSettings(Settings.builder().put(IndexModule.INDEX_QUERY_CACHE_EVERYTHING_SETTING.getKey(), true))
.addMapping("type1", "field1", "type=string", "field2", "type=string", "field3", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text", "field3", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3") client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3")
.setRefresh(true) .setRefresh(true)
@ -596,7 +596,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase {
public void testRequestCache() throws Exception { public void testRequestCache() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.setSettings(Settings.builder().put(IndicesRequestCache.INDEX_CACHE_REQUEST_ENABLED_SETTING.getKey(), true)) .setSettings(Settings.builder().put(IndicesRequestCache.INDEX_CACHE_REQUEST_ENABLED_SETTING.getKey(), true))
.addMapping("type1", "field1", "type=string", "field2", "type=string", "field3", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text", "field3", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2") client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2")
.setRefresh(true) .setRefresh(true)
@ -637,8 +637,8 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase {
public void testFields() throws Exception { public void testFields() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string,store=true", "field2", "type=string,store=true", .addMapping("type1", "field1", "type=text,store=true", "field2", "type=text,store=true",
"field3", "type=string,store=true") "field3", "type=text,store=true")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3") client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3")
.setRefresh(true) .setRefresh(true)
@ -735,7 +735,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase {
public void testSource() throws Exception { public void testSource() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string", "field3", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text", "field3", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3") client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3")
.setRefresh(true) .setRefresh(true)
@ -847,7 +847,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase {
public void testAggs() throws Exception { public void testAggs() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2") client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2")
.setRefresh(true) .setRefresh(true)
@ -885,9 +885,9 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase {
public void testTVApi() throws Exception { public void testTVApi() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string,term_vector=with_positions_offsets_payloads", .addMapping("type1", "field1", "type=text,term_vector=with_positions_offsets_payloads",
"field2", "type=string,term_vector=with_positions_offsets_payloads", "field2", "type=text,term_vector=with_positions_offsets_payloads",
"field3", "type=string,term_vector=with_positions_offsets_payloads") "field3", "type=text,term_vector=with_positions_offsets_payloads")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3") client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3")
.setRefresh(true) .setRefresh(true)
@ -969,9 +969,9 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase {
public void testMTVApi() throws Exception { public void testMTVApi() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string,term_vector=with_positions_offsets_payloads", .addMapping("type1", "field1", "type=text,term_vector=with_positions_offsets_payloads",
"field2", "type=string,term_vector=with_positions_offsets_payloads", "field2", "type=text,term_vector=with_positions_offsets_payloads",
"field3", "type=string,term_vector=with_positions_offsets_payloads") "field3", "type=text,term_vector=with_positions_offsets_payloads")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3") client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2", "field3", "value3")
.setRefresh(true) .setRefresh(true)
@ -1061,7 +1061,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase {
public void testPercolateApi() { public void testPercolateApi() {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping(".percolator", "field1", "type=string", "field2", "type=string") .addMapping(".percolator", "field1", "type=text", "field2", "type=text")
); );
client().prepareIndex("test", ".percolator", "1") client().prepareIndex("test", ".percolator", "1")
.setSource("{\"query\" : { \"match_all\" : {} }, \"field1\" : \"value1\"}") .setSource("{\"query\" : { \"match_all\" : {} }, \"field1\" : \"value1\"}")
@ -1133,7 +1133,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase {
public void testUpdateApiIsBlocked() throws Exception { public void testUpdateApiIsBlocked() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type", "field1", "type=string", "field2", "type=string") .addMapping("type", "field1", "type=text", "field2", "type=text")
); );
client().prepareIndex("test", "type", "1") client().prepareIndex("test", "type", "1")
.setSource("field1", "value1", "field2", "value1") .setSource("field1", "value1", "field2", "value1")
@ -1179,7 +1179,7 @@ public class FieldLevelSecurityTests extends ShieldIntegTestCase {
public void testQuery_withRoleWithFieldWildcards() throws Exception { public void testQuery_withRoleWithFieldWildcards() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text")
); );
client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2") client().prepareIndex("test", "type1", "1").setSource("field1", "value1", "field2", "value2")
.setRefresh(true) .setRefresh(true)

View File

@ -67,7 +67,7 @@ public class IndicesPermissionsWithAliasesWildcardsAndRegexsTests extends Shield
public void testResolveWildcardsRegexs() throws Exception { public void testResolveWildcardsRegexs() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test") assertAcked(client().admin().indices().prepareCreate("test")
.addMapping("type1", "field1", "type=string", "field2", "type=string") .addMapping("type1", "field1", "type=text", "field2", "type=text")
.addAlias(new Alias("my_alias")) .addAlias(new Alias("my_alias"))
.addAlias(new Alias("an_alias")) .addAlias(new Alias("an_alias"))
); );

View File

@ -153,12 +153,12 @@ public class ShieldIndexSearcherWrapperUnitTests extends ESTestCase {
public void testWildcards() throws Exception { public void testWildcards() throws Exception {
XContentBuilder mappingSource = jsonBuilder().startObject().startObject("type").startObject("properties") XContentBuilder mappingSource = jsonBuilder().startObject().startObject("type").startObject("properties")
.startObject("field1_a").field("type", "string").endObject() .startObject("field1_a").field("type", "text").endObject()
.startObject("field1_b").field("type", "string").endObject() .startObject("field1_b").field("type", "text").endObject()
.startObject("field1_c").field("type", "string").endObject() .startObject("field1_c").field("type", "text").endObject()
.startObject("field2_a").field("type", "string").endObject() .startObject("field2_a").field("type", "text").endObject()
.startObject("field2_b").field("type", "string").endObject() .startObject("field2_b").field("type", "text").endObject()
.startObject("field2_c").field("type", "string").endObject() .startObject("field2_c").field("type", "text").endObject()
.endObject().endObject().endObject(); .endObject().endObject().endObject();
mapperService.merge("type", new CompressedXContent(mappingSource.string()), MapperService.MergeReason.MAPPING_UPDATE, false); mapperService.merge("type", new CompressedXContent(mappingSource.string()), MapperService.MergeReason.MAPPING_UPDATE, false);
@ -171,22 +171,22 @@ public class ShieldIndexSearcherWrapperUnitTests extends ESTestCase {
.startObject("foo") .startObject("foo")
.field("type", "object") .field("type", "object")
.startObject("properties") .startObject("properties")
.startObject("bar").field("type", "string").endObject() .startObject("bar").field("type", "text").endObject()
.startObject("baz").field("type", "string").endObject() .startObject("baz").field("type", "text").endObject()
.endObject() .endObject()
.endObject() .endObject()
.startObject("bar") .startObject("bar")
.field("type", "object") .field("type", "object")
.startObject("properties") .startObject("properties")
.startObject("foo").field("type", "string").endObject() .startObject("foo").field("type", "text").endObject()
.startObject("baz").field("type", "string").endObject() .startObject("baz").field("type", "text").endObject()
.endObject() .endObject()
.endObject() .endObject()
.startObject("baz") .startObject("baz")
.field("type", "object") .field("type", "object")
.startObject("properties") .startObject("properties")
.startObject("bar").field("type", "string").endObject() .startObject("bar").field("type", "text").endObject()
.startObject("foo").field("type", "string").endObject() .startObject("foo").field("type", "text").endObject()
.endObject() .endObject()
.endObject() .endObject()
.endObject().endObject().endObject(); .endObject().endObject().endObject();
@ -201,13 +201,13 @@ public class ShieldIndexSearcherWrapperUnitTests extends ESTestCase {
public void testParentChild() throws Exception { public void testParentChild() throws Exception {
XContentBuilder mappingSource = jsonBuilder().startObject().startObject("parent1") XContentBuilder mappingSource = jsonBuilder().startObject().startObject("parent1")
.startObject("properties") .startObject("properties")
.startObject("field").field("type", "string").endObject() .startObject("field").field("type", "text").endObject()
.endObject() .endObject()
.endObject().endObject(); .endObject().endObject();
mapperService.merge("parent1", new CompressedXContent(mappingSource.string()), MapperService.MergeReason.MAPPING_UPDATE, false); mapperService.merge("parent1", new CompressedXContent(mappingSource.string()), MapperService.MergeReason.MAPPING_UPDATE, false);
mappingSource = jsonBuilder().startObject().startObject("child1") mappingSource = jsonBuilder().startObject().startObject("child1")
.startObject("properties") .startObject("properties")
.startObject("field").field("type", "string").endObject() .startObject("field").field("type", "text").endObject()
.endObject() .endObject()
.startObject("_parent") .startObject("_parent")
.field("type", "parent1") .field("type", "parent1")
@ -216,7 +216,7 @@ public class ShieldIndexSearcherWrapperUnitTests extends ESTestCase {
mapperService.merge("child1", new CompressedXContent(mappingSource.string()), MapperService.MergeReason.MAPPING_UPDATE, false); mapperService.merge("child1", new CompressedXContent(mappingSource.string()), MapperService.MergeReason.MAPPING_UPDATE, false);
mappingSource = jsonBuilder().startObject().startObject("child2") mappingSource = jsonBuilder().startObject().startObject("child2")
.startObject("properties") .startObject("properties")
.startObject("field").field("type", "string").endObject() .startObject("field").field("type", "text").endObject()
.endObject() .endObject()
.startObject("_parent") .startObject("_parent")
.field("type", "parent1") .field("type", "parent1")
@ -225,13 +225,13 @@ public class ShieldIndexSearcherWrapperUnitTests extends ESTestCase {
mapperService.merge("child2", new CompressedXContent(mappingSource.string()), MapperService.MergeReason.MAPPING_UPDATE, false); mapperService.merge("child2", new CompressedXContent(mappingSource.string()), MapperService.MergeReason.MAPPING_UPDATE, false);
mappingSource = jsonBuilder().startObject().startObject("parent2") mappingSource = jsonBuilder().startObject().startObject("parent2")
.startObject("properties") .startObject("properties")
.startObject("field").field("type", "string").endObject() .startObject("field").field("type", "text").endObject()
.endObject() .endObject()
.endObject().endObject(); .endObject().endObject();
mapperService.merge("parent2", new CompressedXContent(mappingSource.string()), MapperService.MergeReason.MAPPING_UPDATE, false); mapperService.merge("parent2", new CompressedXContent(mappingSource.string()), MapperService.MergeReason.MAPPING_UPDATE, false);
mappingSource = jsonBuilder().startObject().startObject("child3") mappingSource = jsonBuilder().startObject().startObject("child3")
.startObject("properties") .startObject("properties")
.startObject("field").field("type", "string").endObject() .startObject("field").field("type", "text").endObject()
.endObject() .endObject()
.startObject("_parent") .startObject("_parent")
.field("type", "parent2") .field("type", "parent2")

View File

@ -33,8 +33,7 @@
} }
}, },
"state": { "state": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
} }
} }
} }

View File

@ -37,16 +37,14 @@
}, },
"properties": { "properties": {
"watch_id": { "watch_id": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"trigger_event": { "trigger_event": {
"type": "object", "type": "object",
"dynamic": true, "dynamic": true,
"properties": { "properties": {
"type" : { "type" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"triggered_time": { "triggered_time": {
"type": "date" "type": "date"
@ -90,11 +88,10 @@
"enabled": false "enabled": false
}, },
"state": { "state": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"messages": { "messages": {
"type": "string" "type": "text"
}, },
"result": { "result": {
"type": "object", "type": "object",
@ -111,12 +108,10 @@
"dynamic": true, "dynamic": true,
"properties": { "properties": {
"type" : { "type" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"status" : { "status" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"payload" : { "payload" : {
"type" : "object", "type" : "object",
@ -131,16 +126,13 @@
"dynamic": true, "dynamic": true,
"properties": { "properties": {
"search_type": { "search_type": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"indices": { "indices": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"types": { "types": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
} }
} }
} }
@ -155,12 +147,10 @@
"dynamic": true, "dynamic": true,
"properties": { "properties": {
"path": { "path": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"host": { "host": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
} }
} }
} }
@ -173,12 +163,10 @@
"dynamic" : true, "dynamic" : true,
"properties" : { "properties" : {
"type" : { "type" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"status" : { "status" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"met" : { "met" : {
"type" : "boolean" "type" : "boolean"
@ -202,8 +190,7 @@
"dynamic" : true, "dynamic" : true,
"properties" : { "properties" : {
"type" : { "type" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"search" : { "search" : {
"type" : "object", "type" : "object",
@ -214,12 +201,10 @@
"dynamic" : true, "dynamic" : true,
"properties" : { "properties" : {
"indices" : { "indices" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"types" : { "types" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
} }
} }
} }
@ -233,20 +218,16 @@
"dynamic": true, "dynamic": true,
"properties": { "properties": {
"id" : { "id" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"type" : { "type" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"status" : { "status" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"reason" : { "reason" : {
"type" : "string", "type" : "keyword"
"index" : "analyzed"
}, },
"email": { "email": {
"type": "object", "type": "object",
@ -257,28 +238,22 @@
"dynamic": true, "dynamic": true,
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"from": { "from": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"reply_to": { "reply_to": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"to": { "to": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"cc": { "cc": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"bcc": { "bcc": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
} }
} }
} }
@ -293,12 +268,10 @@
"dynamic": true, "dynamic": true,
"properties": { "properties": {
"path": { "path": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"host": { "host": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
} }
} }
} }
@ -313,16 +286,13 @@
"dynamic": true, "dynamic": true,
"properties": { "properties": {
"index": { "index": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"type": { "type": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"id": { "id": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
} }
} }
} }
@ -333,8 +303,7 @@
"dynamic": true, "dynamic": true,
"properties": { "properties": {
"account": { "account": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"sent_messages": { "sent_messages": {
"type": "nested", "type": "nested",
@ -342,11 +311,10 @@
"dynamic": true, "dynamic": true,
"properties": { "properties": {
"status": { "status": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"reason": { "reason": {
"type": "string" "type": "text"
}, },
"request" : { "request" : {
"type" : "object", "type" : "object",
@ -357,33 +325,29 @@
"enabled" : false "enabled" : false
}, },
"room" : { "room" : {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"user" : { "user" : {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"message" : { "message" : {
"type" : "object", "type" : "object",
"dynamic" : true, "dynamic" : true,
"properties" : { "properties" : {
"message_format" : { "message_format" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"color" : { "color" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"notify" : { "notify" : {
"type" : "boolean" "type" : "boolean"
}, },
"message" : { "message" : {
"type" : "string" "type" : "text"
}, },
"from" : { "from" : {
"type" : "string" "type" : "text"
} }
} }
} }
@ -396,8 +360,7 @@
"dynamic": true, "dynamic": true,
"properties": { "properties": {
"account": { "account": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"sent_messages": { "sent_messages": {
"type": "nested", "type": "nested",
@ -405,11 +368,10 @@
"dynamic": true, "dynamic": true,
"properties": { "properties": {
"status": { "status": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"reason": { "reason": {
"type": "string" "type": "text"
}, },
"request" : { "request" : {
"type" : "object", "type" : "object",
@ -420,22 +382,20 @@
"enabled" : false "enabled" : false
}, },
"to" : { "to" : {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"message" : { "message" : {
"type" : "object", "type" : "object",
"dynamic" : true, "dynamic" : true,
"properties" : { "properties" : {
"from" : { "from" : {
"type" : "string" "type" : "text"
}, },
"icon" : { "icon" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"text" : { "text" : {
"type" : "string" "type" : "text"
}, },
"attachments" : { "attachments" : {
"type" : "nested", "type" : "nested",
@ -443,8 +403,7 @@
"dynamic" : true, "dynamic" : true,
"properties" : { "properties" : {
"color" : { "color" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
} }
} }
} }
@ -459,8 +418,7 @@
"dynamic": true, "dynamic": true,
"properties": { "properties": {
"account": { "account": {
"type": "string", "type": "keyword"
"index": "not_analyzed"
}, },
"sent_event": { "sent_event": {
"type": "nested", "type": "nested",
@ -468,7 +426,7 @@
"dynamic": true, "dynamic": true,
"properties": { "properties": {
"reason": { "reason": {
"type": "string" "type": "text"
}, },
"request" : { "request" : {
"type" : "object", "type" : "object",
@ -483,29 +441,25 @@
"dynamic" : true, "dynamic" : true,
"properties" : { "properties" : {
"type" : { "type" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"client" : { "client" : {
"type" : "string" "type" : "text"
}, },
"client_url" : { "client_url" : {
"index" : "not_analyzed", "type" : "keyword"
"type" : "string"
}, },
"account" : { "account" : {
"index" : "not_analyzed", "type" : "keyword"
"type" : "string"
}, },
"attach_payload" : { "attach_payload" : {
"type" : "boolean" "type" : "boolean"
}, },
"incident_key" : { "incident_key" : {
"index" : "not_analyzed", "type" : "keyword"
"type" : "string"
}, },
"description" : { "description" : {
"type" : "string" "type" : "text"
}, },
"context" : { "context" : {
"type" : "nested", "type" : "nested",
@ -513,19 +467,16 @@
"dynamic" : true, "dynamic" : true,
"properties" : { "properties" : {
"type" : { "type" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"href" : { "href" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"src" : { "src" : {
"type" : "string", "type" : "keyword"
"index" : "not_analyzed"
}, },
"alt" : { "alt" : {
"type" : "string" "type" : "text"
} }
} }
} }

View File

@ -33,8 +33,9 @@
"dynamic" : true "dynamic" : true
}, },
"throttle_period": { "throttle_period": {
"type": "string", "type" : "keyword",
"index" : "no" "index" : false,
"doc_values" : false
}, },
"transform": { "transform": {
"type" : "object", "type" : "object",

View File

@ -71,8 +71,7 @@ public class HistoryTemplateTimeMappingsTests extends AbstractWatcherIntegration
try { try {
Map<String, Object> source = metadata.getSourceAsMap(); Map<String, Object> source = metadata.getSourceAsMap();
logger.info("checking index [{}] with metadata:\n[{}]", metadatas.key, metadata.source().toString()); logger.info("checking index [{}] with metadata:\n[{}]", metadatas.key, metadata.source().toString());
assertThat(extractValue("properties.trigger_event.properties.type.type", source), is((Object) "string")); assertThat(extractValue("properties.trigger_event.properties.type.type", source), is((Object) "keyword"));
assertThat(extractValue("properties.trigger_event.properties.type.index", source), is((Object) "not_analyzed"));
assertThat(extractValue("properties.trigger_event.properties.triggered_time.type", source), is((Object) "date")); assertThat(extractValue("properties.trigger_event.properties.triggered_time.type", source), is((Object) "date"));
assertThat(extractValue("properties.trigger_event.properties.schedule.properties.scheduled_time.type", source), assertThat(extractValue("properties.trigger_event.properties.schedule.properties.scheduled_time.type", source),
is((Object) "date")); is((Object) "date"));

View File

@ -385,7 +385,7 @@ public class BasicWatcherTests extends AbstractWatcherIntegrationTestCase {
timeWarp().clock().setTime(SystemClock.INSTANCE.nowUTC()); timeWarp().clock().setTime(SystemClock.INSTANCE.nowUTC());
String watchName = "_name"; String watchName = "_name";
assertAcked(prepareCreate("events").addMapping("event", "_timestamp", "enabled=true", "level", "type=string")); assertAcked(prepareCreate("events").addMapping("event", "_timestamp", "enabled=true", "level", "type=text"));
watcherClient().preparePutWatch(watchName) watcherClient().preparePutWatch(watchName)
.setSource(watchBuilder() .setSource(watchBuilder()