Skip to content

Commit

Permalink
terms query test (#41)
Browse files Browse the repository at this point in the history
terms query test
  • Loading branch information
m-Bilal authored Jan 1, 2025
2 parents de37e0d + e553973 commit 87882bd
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
4 changes: 4 additions & 0 deletions connector/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ var tests = []test{
group: "payments",
name: "simple_or_clause",
},
{
group: "payments",
name: "simple_terms_clause",
},
}

func TestPrepareElasticsearchQuery(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"arguments": {},
"collection": "customers",
"collection_relationships": {},
"query": {
"fields": {
"customerId": {
"column": "customer_id",
"type": "column"
},
"email": {
"column": "email",
"type": "column"
},
"name": {
"column": "name",
"type": "column"
}
},
"predicate": {
"column": {
"type": "column",
"name": "customer_id"
},
"operator": "terms",
"type": "binary_comparison_operator",
"value": {
"type": "scalar",
"value": [
"CUST001",
"CUST002"
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
query MyQuery {
customers(where: {customerId: {terms: [ "CUST001", "CUST002" ]}}) {
email
customerId
name
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"_source": [
"customer_id",
"email",
"name"
],
"query": {
"terms": {
"customer_id": [
"CUST001",
"CUST002"
]
}
},
"size": 10000
}

0 comments on commit 87882bd

Please sign in to comment.