Updated examples
This commit is contained in:
@ -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)
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user