|
@@ -0,0 +1,473 @@
|
|
|
+setup:
|
|
|
+ - skip:
|
|
|
+ version: " - 8.14.99"
|
|
|
+ reason: synthetic source support added in 8.15
|
|
|
+
|
|
|
+ - do:
|
|
|
+ indices.create:
|
|
|
+ index: synthetic_source_test
|
|
|
+ body:
|
|
|
+ mappings:
|
|
|
+ "_source":
|
|
|
+ "mode": "synthetic"
|
|
|
+ "properties":
|
|
|
+ "integer_range":
|
|
|
+ "type" : "integer_range"
|
|
|
+ "long_range":
|
|
|
+ "type" : "long_range"
|
|
|
+ "float_range":
|
|
|
+ "type" : "float_range"
|
|
|
+ "double_range":
|
|
|
+ "type" : "double_range"
|
|
|
+ "date_range":
|
|
|
+ "type" : "date_range"
|
|
|
+ "ip_range":
|
|
|
+ "type" : "ip_range"
|
|
|
+
|
|
|
+---
|
|
|
+"Integer range":
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "1"
|
|
|
+ body: { "integer_range" : { "gte": 1, "lte": 5 } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "2"
|
|
|
+ body: { "integer_range" : { "gt": 1, "lte": 3 } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "3"
|
|
|
+ body: { "integer_range" : [ { "gte": 4, "lt": 5 } ] }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "4"
|
|
|
+ body: { "integer_range" : [ { "gt": 4, "lt": 8 }, { "gt": 4, "lt": 7 } ] }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "5"
|
|
|
+ body: { "integer_range" : null }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "6"
|
|
|
+ body: { "integer_range": { "gte": null, "lte": 10 } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "7"
|
|
|
+ body: { "integer_range": { "gte": 1 } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ indices.refresh: {}
|
|
|
+
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ index: synthetic_source_test
|
|
|
+ - match: { hits.total.value: 7 }
|
|
|
+ - match:
|
|
|
+ hits.hits.0._source:
|
|
|
+ integer_range: { "gte": 1, "lte": 5 }
|
|
|
+ - match:
|
|
|
+ hits.hits.1._source:
|
|
|
+ integer_range: { "gte": 2, "lte": 3 }
|
|
|
+ - match:
|
|
|
+ hits.hits.2._source:
|
|
|
+ integer_range: { "gte": 4, "lte": 4 }
|
|
|
+ - match:
|
|
|
+ hits.hits.3._source:
|
|
|
+ integer_range: [ { "gte": 5, "lte": 6 }, { "gte": 5, "lte": 7 } ]
|
|
|
+ - match:
|
|
|
+ hits.hits.4._source: {}
|
|
|
+ - match:
|
|
|
+ hits.hits.5._source:
|
|
|
+ integer_range: { "gte": -2147483648, "lte": 10 }
|
|
|
+ - match:
|
|
|
+ hits.hits.6._source:
|
|
|
+ integer_range: { "gte": 1, "lte": 2147483647 }
|
|
|
+
|
|
|
+---
|
|
|
+"Long range":
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "1"
|
|
|
+ body: { "long_range" : { "gte": 1, "lte": 5 } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "2"
|
|
|
+ body: { "long_range" : { "gt": 1, "lte": 3 } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "3"
|
|
|
+ body: { "long_range" : [ { "gte": 4, "lt": 5 } ] }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "4"
|
|
|
+ body: { "long_range" : [ { "gt": 4, "lt": 8 }, { "gt": 4, "lt": 7 } ] }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "5"
|
|
|
+ body: { "long_range" : null }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "6"
|
|
|
+ body: { "long_range": { "gte": null, "lte": 10 } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "7"
|
|
|
+ body: { "long_range": { "gte": 1 } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ indices.refresh: {}
|
|
|
+
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ index: synthetic_source_test
|
|
|
+ - match: { hits.total.value: 7 }
|
|
|
+ - match:
|
|
|
+ hits.hits.0._source:
|
|
|
+ long_range: { "gte": 1, "lte": 5 }
|
|
|
+ - match:
|
|
|
+ hits.hits.1._source:
|
|
|
+ long_range: { "gte": 2, "lte": 3 }
|
|
|
+ - match:
|
|
|
+ hits.hits.2._source:
|
|
|
+ long_range: { "gte": 4, "lte": 4 }
|
|
|
+ - match:
|
|
|
+ hits.hits.3._source:
|
|
|
+ long_range: [ { "gte": 5, "lte": 6 }, { "gte": 5, "lte": 7 } ]
|
|
|
+ - match:
|
|
|
+ hits.hits.4._source: {}
|
|
|
+ - match:
|
|
|
+ hits.hits.5._source:
|
|
|
+ long_range: { "gte": -9223372036854775808, "lte": 10 }
|
|
|
+ - match:
|
|
|
+ hits.hits.6._source:
|
|
|
+ long_range: { "gte": 1, "lte": 9223372036854775807 }
|
|
|
+
|
|
|
+---
|
|
|
+"Float range":
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "1"
|
|
|
+ body: { "float_range" : { "gte": 1, "lte": 5 } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "2"
|
|
|
+ body: { "float_range" : [ { "gte": 4.0, "lte": 5.0 } ] }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "3"
|
|
|
+ body: { "float_range" : [ { "gte": 4, "lte": 8 }, { "gte": 4, "lte": 7 } ] }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "4"
|
|
|
+ body: { "float_range" : null }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "5"
|
|
|
+ body: { "float_range": { "gte": null, "lte": 10 } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "6"
|
|
|
+ body: { "float_range": { "gte": 1 } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ indices.refresh: {}
|
|
|
+
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ index: synthetic_source_test
|
|
|
+ - match: { hits.total.value: 6 }
|
|
|
+ - match:
|
|
|
+ hits.hits.0._source:
|
|
|
+ float_range: { "gte": 1.0, "lte": 5.0 }
|
|
|
+ - match:
|
|
|
+ hits.hits.1._source:
|
|
|
+ float_range: { "gte": 4.0, "lte": 5.0 }
|
|
|
+ - match:
|
|
|
+ hits.hits.2._source:
|
|
|
+ float_range: [ { "gte": 4.0, "lte": 7.0 }, { "gte": 4.0, "lte": 8.0 } ]
|
|
|
+ - match:
|
|
|
+ hits.hits.3._source: {}
|
|
|
+ - match:
|
|
|
+ hits.hits.4._source:
|
|
|
+ float_range: { "gte": "-Infinity", "lte": 10.0 }
|
|
|
+ - match:
|
|
|
+ hits.hits.5._source:
|
|
|
+ float_range: { "gte": 1.0, "lte": "Infinity" }
|
|
|
+
|
|
|
+---
|
|
|
+"Double range":
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "1"
|
|
|
+ body: { "double_range" : { "gte": 1, "lte": 5 } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "2"
|
|
|
+ body: { "double_range" : [ { "gte": 4.0, "lte": 5.0 } ] }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "3"
|
|
|
+ body: { "double_range" : [ { "gte": 4, "lte": 8 }, { "gte": 4, "lte": 7 } ] }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "4"
|
|
|
+ body: { "double_range" : null }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "5"
|
|
|
+ body: { "double_range": { "gte": null, "lte": 10 } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "6"
|
|
|
+ body: { "double_range": { "gte": 1 } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ indices.refresh: {}
|
|
|
+
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ index: synthetic_source_test
|
|
|
+ - match: { hits.total.value: 6 }
|
|
|
+ - match:
|
|
|
+ hits.hits.0._source:
|
|
|
+ double_range: { "gte": 1.0, "lte": 5.0 }
|
|
|
+ - match:
|
|
|
+ hits.hits.1._source:
|
|
|
+ double_range: { "gte": 4.0, "lte": 5.0 }
|
|
|
+ - match:
|
|
|
+ hits.hits.2._source:
|
|
|
+ double_range: [ { "gte": 4.0, "lte": 7.0 }, { "gte": 4.0, "lte": 8.0 } ]
|
|
|
+ - match:
|
|
|
+ hits.hits.3._source: {}
|
|
|
+ - match:
|
|
|
+ hits.hits.4._source:
|
|
|
+ double_range: { "gte": "-Infinity", "lte": 10.0 }
|
|
|
+ - match:
|
|
|
+ hits.hits.5._source:
|
|
|
+ double_range: { "gte": 1.0, "lte": "Infinity" }
|
|
|
+
|
|
|
+---
|
|
|
+"IP range":
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "1"
|
|
|
+ body: { "ip_range" : { "gte": "192.168.0.1", "lte": "192.168.0.5" } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "2"
|
|
|
+ body: { "ip_range" : { "gt": "192.168.0.1", "lte": "192.168.0.3" } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "3"
|
|
|
+ body: { "ip_range" : [ { "gte": "192.168.0.4", "lt": "192.168.0.5" } ] }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "4"
|
|
|
+ body: { "ip_range" : { "gt": "2001:db8::", "lt": "200a:100::" } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "5"
|
|
|
+ body: { "ip_range" : "74.125.227.0/25" }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "6"
|
|
|
+ body: { "ip_range" : null }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "7"
|
|
|
+ body: { "ip_range": { "gte": null, "lte": "10.10.10.10" } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "8"
|
|
|
+ body: { "ip_range": { "gte": "2001:db8::" } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ indices.refresh: {}
|
|
|
+
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ index: synthetic_source_test
|
|
|
+ - match: { hits.total.value: 8 }
|
|
|
+ - match:
|
|
|
+ hits.hits.0._source:
|
|
|
+ ip_range: { "gte": "192.168.0.1", "lte": "192.168.0.5" }
|
|
|
+ - match:
|
|
|
+ hits.hits.1._source:
|
|
|
+ ip_range: { "gte": "192.168.0.2", "lte": "192.168.0.3" }
|
|
|
+ - match:
|
|
|
+ hits.hits.2._source:
|
|
|
+ ip_range: { "gte": "192.168.0.4", "lte": "192.168.0.4" }
|
|
|
+ - match:
|
|
|
+ hits.hits.3._source:
|
|
|
+ ip_range: { "gte": "2001:db8::1", "lte": "200a:ff:ffff:ffff:ffff:ffff:ffff:ffff" }
|
|
|
+ - match:
|
|
|
+ hits.hits.4._source:
|
|
|
+ ip_range: { "gte": "74.125.227.0", "lte": "74.125.227.127" }
|
|
|
+ - match:
|
|
|
+ hits.hits.5._source: {}
|
|
|
+ - match:
|
|
|
+ hits.hits.6._source:
|
|
|
+ ip_range: { "gte": "0.0.0.0", "lte": "10.10.10.10" }
|
|
|
+ - match:
|
|
|
+ hits.hits.7._source:
|
|
|
+ ip_range: { "gte": "2001:db8::", "lte": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" }
|
|
|
+
|
|
|
+---
|
|
|
+"Date range":
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "1"
|
|
|
+ body: { "date_range" : { "gte": "2017-09-01", "lte": "2017-09-05" } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "2"
|
|
|
+ body: { "date_range" : { "gt": "2017-09-01", "lte": "2017-09-03" } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "3"
|
|
|
+ body: { "date_range" : [ { "gte": "2017-09-04", "lt": "2017-09-05" } ] }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "4"
|
|
|
+ body: { "date_range" : [ { "gt": "2017-09-04", "lt": "2017-09-08" }, { "gt": "2017-09-04", "lt": "2017-09-07" } ] }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "5"
|
|
|
+ body: { "date_range" : { "gte": 1504224000000, "lte": 1504569600000 } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "6"
|
|
|
+ body: { "date_range" : { "gte": "2017-09-01T10:20:30.123Z", "lte": "2017-09-05T03:04:05.789Z" } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "7"
|
|
|
+ body: { "date_range" : null }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "8"
|
|
|
+ body: { "date_range": { "gte": null, "lte": "2017-09-05" } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ index:
|
|
|
+ index: synthetic_source_test
|
|
|
+ id: "9"
|
|
|
+ body: { "date_range": { "gte": "2017-09-05" } }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ indices.refresh: {}
|
|
|
+
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ index: synthetic_source_test
|
|
|
+ - match: { hits.total.value: 9 }
|
|
|
+ - match:
|
|
|
+ hits.hits.0._source:
|
|
|
+ date_range: { "gte": "2017-09-01T00:00:00.000Z", "lte": "2017-09-05T00:00:00.000Z" }
|
|
|
+ - match:
|
|
|
+ hits.hits.1._source:
|
|
|
+ date_range: { "gte": "2017-09-01T00:00:00.001Z", "lte": "2017-09-03T00:00:00.000Z" }
|
|
|
+ - match:
|
|
|
+ hits.hits.2._source:
|
|
|
+ date_range: { "gte": "2017-09-04T00:00:00.000Z", "lte": "2017-09-04T23:59:59.999Z" }
|
|
|
+ - match:
|
|
|
+ hits.hits.3._source:
|
|
|
+ date_range: [ { "gte": "2017-09-04T00:00:00.001Z", "lte": "2017-09-06T23:59:59.999Z" }, { "gte": "2017-09-04T00:00:00.001Z", "lte": "2017-09-07T23:59:59.999Z" } ]
|
|
|
+ - match:
|
|
|
+ hits.hits.4._source:
|
|
|
+ date_range: { "gte": "2017-09-01T00:00:00.000Z", "lte": "2017-09-05T00:00:00.000Z" }
|
|
|
+ - match:
|
|
|
+ hits.hits.5._source:
|
|
|
+ date_range: { "gte": "2017-09-01T10:20:30.123Z", "lte": "2017-09-05T03:04:05.789Z" }
|
|
|
+ - match:
|
|
|
+ hits.hits.6._source: {}
|
|
|
+ - match:
|
|
|
+ hits.hits.7._source:
|
|
|
+ date_range: { "gte": "-292275055-05-16T16:47:04.192Z", "lte": "2017-09-05T00:00:00.000Z" }
|
|
|
+ - match:
|
|
|
+ hits.hits.8._source:
|
|
|
+ date_range: { "gte": "2017-09-05T00:00:00.000Z", "lte": "+292278994-08-17T07:12:55.807Z" }
|
|
|
+
|