Skip to content

Commit a71bc21

Browse files
committed
Adding tests for boolean fields
Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
1 parent 01dabaf commit a71bc21

File tree

1 file changed

+54
-9
lines changed

1 file changed

+54
-9
lines changed

rest-api-spec/src/main/resources/rest-api-spec/test/search/340_doc_values_field.yml

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,22 @@ setup:
4747
type: unsigned_long
4848
index: true
4949
doc_values: true
50+
boolean:
51+
type: boolean
52+
index: true
53+
doc_values: true
5054

5155
- do:
5256
bulk:
5357
index: test-iodvq
5458
refresh: true
5559
body:
5660
- '{"index": {"_index": "test-iodvq", "_id": "1" }}'
57-
- '{ "some_keyword": "ingesting some random keyword data", "byte": 120, "double": 100.0, "float": "800.0", "half_float": "400.0", "integer": 1290, "long": 13456, "short": 150, "unsigned_long": 10223372036854775800 }'
61+
- '{ "some_keyword": "ingesting some random keyword data", "byte": 120, "double": 100.0, "float": "800.0", "half_float": "400.0", "integer": 1290, "long": 13456, "short": 150, "unsigned_long": 10223372036854775800, "boolean": true }'
5862
- '{ "index": { "_index": "test-iodvq", "_id": "2" }}'
59-
- '{ "some_keyword": "400", "byte": 121, "double": 101.0, "float": "801.0", "half_float": "401.0", "integer": 1291, "long": 13457, "short": 151, "unsigned_long": 10223372036854775801 }'
63+
- '{ "some_keyword": "400", "byte": 121, "double": 101.0, "float": "801.0", "half_float": "401.0", "integer": 1291, "long": 13457, "short": 151, "unsigned_long": 10223372036854775801, "boolean": true }'
6064
- '{ "index": { "_index": "test-iodvq", "_id": "3" } }'
61-
- '{ "some_keyword": "5", "byte": 122, "double": 102.0, "float": "802.0", "half_float": "402.0", "integer": 1292, "long": 13458, "short": 152, "unsigned_long": 10223372036854775802 }'
65+
- '{ "some_keyword": "5", "byte": 122, "double": 102.0, "float": "802.0", "half_float": "402.0", "integer": 1292, "long": 13458, "short": 152, "unsigned_long": 10223372036854775802, "boolean": false }'
6266

6367
- do:
6468
search:
@@ -175,6 +179,17 @@ setup:
175179
- match: { hits.total: 1 }
176180

177181

182+
- do:
183+
search:
184+
rest_total_hits_as_int: true
185+
index: test-iodvq
186+
body:
187+
query:
188+
term:
189+
boolean: true
190+
191+
- match: { hits.total: 2 }
192+
178193
- do:
179194
search:
180195
rest_total_hits_as_int: true
@@ -428,18 +443,22 @@ setup:
428443
type: unsigned_long
429444
index: true
430445
doc_values: false
446+
boolean:
447+
type: boolean
448+
index: true
449+
doc_values: false
431450

432451
- do:
433452
bulk:
434453
index: test-index
435454
refresh: true
436455
body:
437456
- '{"index": {"_index": "test-index", "_id": "1" }}'
438-
- '{ "some_keyword": "ingesting some random keyword data", "byte": 120, "double": 100.0, "float": "800.0", "half_float": "400.0", "integer": 1290, "long": 13456, "short": 150, "unsigned_long": 10223372036854775800 }'
457+
- '{ "some_keyword": "ingesting some random keyword data", "byte": 120, "double": 100.0, "float": "800.0", "half_float": "400.0", "integer": 1290, "long": 13456, "short": 150, "unsigned_long": 10223372036854775800, "boolean": true }'
439458
- '{ "index": { "_index": "test-index", "_id": "2" }}'
440-
- '{ "some_keyword": "400", "byte": 121, "double": 101.0, "float": "801.0", "half_float": "401.0", "integer": 1291, "long": 13457, "short": 151, "unsigned_long": 10223372036854775801 }'
459+
- '{ "some_keyword": "400", "byte": 121, "double": 101.0, "float": "801.0", "half_float": "401.0", "integer": 1291, "long": 13457, "short": 151, "unsigned_long": 10223372036854775801, "boolean": true }'
441460
- '{ "index": { "_index": "test-index", "_id": "3" } }'
442-
- '{ "some_keyword": "5", "byte": 122, "double": 102.0, "float": "802.0", "half_float": "402.0", "integer": 1292, "long": 13458, "short": 152, "unsigned_long": 10223372036854775802 }'
461+
- '{ "some_keyword": "5", "byte": 122, "double": 102.0, "float": "802.0", "half_float": "402.0", "integer": 1292, "long": 13458, "short": 152, "unsigned_long": 10223372036854775802, "boolean": false }'
443462

444463
- do:
445464
search:
@@ -555,6 +574,17 @@ setup:
555574

556575
- match: { hits.total: 1 }
557576

577+
- do:
578+
search:
579+
rest_total_hits_as_int: true
580+
index: test-index
581+
body:
582+
query:
583+
term:
584+
boolean: true
585+
586+
- match: { hits.total: 2 }
587+
558588

559589
- do:
560590
search:
@@ -809,18 +839,22 @@ setup:
809839
type: unsigned_long
810840
index: false
811841
doc_values: true
842+
boolean:
843+
type: boolean
844+
index: false
845+
doc_values: true
812846

813847
- do:
814848
bulk:
815849
index: test-doc-values
816850
refresh: true
817851
body:
818852
- '{"index": {"_index": "test-doc-values", "_id": "1" }}'
819-
- '{ "some_keyword": "ingesting some random keyword data", "byte": 120, "double": 100.0, "float": "800.0", "half_float": "400.0", "integer": 1290, "long": 13456, "short": 150, "unsigned_long": 10223372036854775800 }'
853+
- '{ "some_keyword": "ingesting some random keyword data", "byte": 120, "double": 100.0, "float": "800.0", "half_float": "400.0", "integer": 1290, "long": 13456, "short": 150, "unsigned_long": 10223372036854775800, "boolean": true }'
820854
- '{ "index": { "_index": "test-doc-values", "_id": "2" }}'
821-
- '{ "some_keyword": "400", "byte": 121, "double": 101.0, "float": "801.0", "half_float": "401.0", "integer": 1291, "long": 13457, "short": 151, "unsigned_long": 10223372036854775801 }'
855+
- '{ "some_keyword": "400", "byte": 121, "double": 101.0, "float": "801.0", "half_float": "401.0", "integer": 1291, "long": 13457, "short": 151, "unsigned_long": 10223372036854775801, "boolean": true }'
822856
- '{ "index": { "_index": "test-doc-values", "_id": "3" } }'
823-
- '{ "some_keyword": "5", "byte": 122, "double": 102.0, "float": "802.0", "half_float": "402.0", "integer": 1292, "long": 13458, "short": 152, "unsigned_long": 10223372036854775802 }'
857+
- '{ "some_keyword": "5", "byte": 122, "double": 102.0, "float": "802.0", "half_float": "402.0", "integer": 1292, "long": 13458, "short": 152, "unsigned_long": 10223372036854775802, "boolean": false }'
824858

825859
- do:
826860
search:
@@ -936,6 +970,17 @@ setup:
936970

937971
- match: { hits.total: 1 }
938972

973+
- do:
974+
search:
975+
rest_total_hits_as_int: true
976+
index: test-doc-values
977+
body:
978+
query:
979+
term:
980+
boolean: false
981+
982+
- match: { hits.total: 1 }
983+
939984

940985
- do:
941986
search:

0 commit comments

Comments
 (0)