[Backport 8.1] Update docs for v8 (#1620)

Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2022-02-11 10:23:54 +01:00
committed by GitHub
parent 84d8b68007
commit 3e6b02b504
37 changed files with 315 additions and 1264 deletions

View File

@ -15,7 +15,7 @@ const client = new Client({ node: 'http://localhost:9200' })
async function run () {
await client.index({
index: 'game-of-thrones',
body: {
document: {
character: 'Ned Stark',
quote: 'Winter is coming.'
}
@ -24,7 +24,7 @@ async function run () {
await client.index({
index: 'game-of-thrones',
refresh: true,
body: {
document: {
character: 'Arya Stark',
quote: 'A girl is Arya Stark of Winterfell. And I\'m going home.'
}
@ -33,27 +33,23 @@ async function run () {
await client.updateByQuery({
index: 'game-of-thrones',
refresh: true,
body: {
script: {
lang: 'painless',
source: 'ctx._source["house"] = "stark"'
},
query: {
match: {
character: 'stark'
}
script: {
lang: 'painless',
source: 'ctx._source["house"] = "stark"'
},
query: {
match: {
character: 'stark'
}
}
})
const { body } = await client.search({
const result = await client.search({
index: 'game-of-thrones',
body: {
query: { match_all: {} }
}
query: { match_all: {} }
})
console.log(body.hits.hits)
console.log(result.hits.hits)
}
run().catch(console.log)