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.
const query = F()
.match('description', Q.param('description'))
.filter(f => f
.term('author.name', Q.param('author'))
.filter(
F().term('author.name', Q.param('author'))
)
.size(10)

View File

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

View File

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

View File

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