Skip to content

Commit 0780015

Browse files
committed
test: add case with elasticsearch query
1 parent 3d554ed commit 0780015

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/cases.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,4 +257,22 @@ export const cases: Record<string, Case | Case[]> = {
257257
encoded:
258258
"metadata=null&user={name:John's+%26+Jane's,preferences:{notifications:true,theme:dark},scores:(100,95)}",
259259
},
260+
'elasticsearch query': {
261+
decoded: {
262+
query: {
263+
bool: {
264+
must: [
265+
{ match: { title: 'Search' } },
266+
{ match: { content: 'Elasticsearch' } },
267+
],
268+
filter: [
269+
{ term: { status: 'published' } },
270+
{ range: { publish_date: { gte: '2015-01-01' } } },
271+
],
272+
},
273+
},
274+
},
275+
encoded:
276+
'query={bool:{filter:({term:{status:published}},{range:{publish_date:{gte:\\2015-01-01}}}),must:({match:{title:Search}},{match:{content:Elasticsearch}})}}',
277+
},
260278
}

0 commit comments

Comments
 (0)