Update docs for v8 (#1572)

This commit is contained in:
Tomas Della Vedova
2022-02-11 10:23:07 +01:00
committed by delvedor
parent 221f9a9798
commit 5086a19512
37 changed files with 315 additions and 1264 deletions

View File

@ -18,7 +18,7 @@ async function run () {
// Let's start by indexing some data
await client.index({
index: 'game-of-thrones',
body: {
document: {
character: 'Ned Stark',
quote: 'Winter is coming.'
}
@ -26,7 +26,7 @@ async function run () {
await client.index({
index: 'game-of-thrones',
body: {
document: {
character: 'Daenerys Targaryen',
quote: 'I am the blood of the dragon.'
}
@ -38,25 +38,23 @@ async function run () {
// otherwise we will not get any result
// in the consequent search
refresh: true,
body: {
document: {
character: 'Tyrion Lannister',
quote: 'A mind needs books like a sword needs a whetstone.'
}
})
// Let's search!
const { body } = await client.search({
const result = await client.search({
index: 'game-of-thrones',
body: {
query: {
match: {
quote: 'winter'
}
query: {
match: {
quote: 'winter'
}
}
})
console.log(body.hits.hits)
console.log(result.hits.hits)
}
run().catch(console.log)