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