Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding tests for boolean fields
Browse files Browse the repository at this point in the history
Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
harshavamsi committed Jan 19, 2024
1 parent 01dabaf commit a71bc21
Showing 1 changed file with 54 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -47,18 +47,22 @@ setup:
type: unsigned_long
index: true
doc_values: true
boolean:
type: boolean
index: true
doc_values: true

- do:
bulk:
index: test-iodvq
refresh: true
body:
- '{"index": {"_index": "test-iodvq", "_id": "1" }}'
- '{ "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 }'
- '{ "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 }'
- '{ "index": { "_index": "test-iodvq", "_id": "2" }}'
- '{ "some_keyword": "400", "byte": 121, "double": 101.0, "float": "801.0", "half_float": "401.0", "integer": 1291, "long": 13457, "short": 151, "unsigned_long": 10223372036854775801 }'
- '{ "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 }'
- '{ "index": { "_index": "test-iodvq", "_id": "3" } }'
- '{ "some_keyword": "5", "byte": 122, "double": 102.0, "float": "802.0", "half_float": "402.0", "integer": 1292, "long": 13458, "short": 152, "unsigned_long": 10223372036854775802 }'
- '{ "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 }'

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


- do:
search:
rest_total_hits_as_int: true
index: test-iodvq
body:
query:
term:
boolean: true

- match: { hits.total: 2 }

- do:
search:
rest_total_hits_as_int: true
@@ -428,18 +443,22 @@ setup:
type: unsigned_long
index: true
doc_values: false
boolean:
type: boolean
index: true
doc_values: false

- do:
bulk:
index: test-index
refresh: true
body:
- '{"index": {"_index": "test-index", "_id": "1" }}'
- '{ "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 }'
- '{ "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 }'
- '{ "index": { "_index": "test-index", "_id": "2" }}'
- '{ "some_keyword": "400", "byte": 121, "double": 101.0, "float": "801.0", "half_float": "401.0", "integer": 1291, "long": 13457, "short": 151, "unsigned_long": 10223372036854775801 }'
- '{ "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 }'
- '{ "index": { "_index": "test-index", "_id": "3" } }'
- '{ "some_keyword": "5", "byte": 122, "double": 102.0, "float": "802.0", "half_float": "402.0", "integer": 1292, "long": 13458, "short": 152, "unsigned_long": 10223372036854775802 }'
- '{ "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 }'

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

- match: { hits.total: 1 }

- do:
search:
rest_total_hits_as_int: true
index: test-index
body:
query:
term:
boolean: true

- match: { hits.total: 2 }


- do:
search:
@@ -809,18 +839,22 @@ setup:
type: unsigned_long
index: false
doc_values: true
boolean:
type: boolean
index: false
doc_values: true

- do:
bulk:
index: test-doc-values
refresh: true
body:
- '{"index": {"_index": "test-doc-values", "_id": "1" }}'
- '{ "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 }'
- '{ "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 }'
- '{ "index": { "_index": "test-doc-values", "_id": "2" }}'
- '{ "some_keyword": "400", "byte": 121, "double": 101.0, "float": "801.0", "half_float": "401.0", "integer": 1291, "long": 13457, "short": 151, "unsigned_long": 10223372036854775801 }'
- '{ "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 }'
- '{ "index": { "_index": "test-doc-values", "_id": "3" } }'
- '{ "some_keyword": "5", "byte": 122, "double": 102.0, "float": "802.0", "half_float": "402.0", "integer": 1292, "long": 13458, "short": 152, "unsigned_long": 10223372036854775802 }'
- '{ "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 }'

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

- match: { hits.total: 1 }

- do:
search:
rest_total_hits_as_int: true
index: test-doc-values
body:
query:
term:
boolean: false

- match: { hits.total: 1 }


- do:
search:

0 comments on commit a71bc21

Please sign in to comment.