Updated examples

This commit is contained in:
delvedor
2020-09-07 10:00:28 +02:00
parent 96110ea948
commit 471d0a5563
4 changed files with 7 additions and 7 deletions

View File

@ -90,8 +90,8 @@ import { Q, F } from '../'
// outside of your hot code path. // outside of your hot code path.
const query = F() const query = F()
.match('description', Q.param('description')) .match('description', Q.param('description'))
.filter(f => f .filter(
.term('author.name', Q.param('author')) F().term('author.name', Q.param('author'))
) )
.size(10) .size(10)

View File

@ -90,8 +90,8 @@ import { Q, F } from '../'
// outside of your hot code path. // outside of your hot code path.
const query = F() const query = F()
.match('description', Q.param('description')) .match('description', Q.param('description'))
.filter(f => f .filter(
.term('author.name', Q.param('author')) F().term('author.name', Q.param('author'))
) )
.size(10) .size(10)

View File

@ -52,8 +52,8 @@ async function run2 () {
body: F() body: F()
// You can avoid to call `.must`, as any query will be // You can avoid to call `.must`, as any query will be
// sent inside a `must` block unless specified otherwise // sent inside a `must` block unless specified otherwise
.must(f => f.match('description', 'fix')) .match('description', 'fix')
.mustNot(f => f.term('files', 'test')) .mustNot(F().term('files', 'test'))
}) })
console.log(body.hits.hits) console.log(body.hits.hits)

View File

@ -93,7 +93,7 @@ async function run2 () {
index: 'git', index: 'git',
body: F() body: F()
// we want to know the top month for 'delvedor' // we want to know the top month for 'delvedor'
.filter(f => f.term('author', 'delvedor')) .filter(F().term('author', 'delvedor'))
.size(0) .size(0)
.aggs(commitsPerMonth, topCommittersPerMonthGlobal) .aggs(commitsPerMonth, topCommittersPerMonthGlobal)
}) })