Update docs examples (#1024)
* Updated generate-docs-examples script * Updated docs examples
This commit is contained in:
committed by
GitHub
parent
c69db0ba08
commit
01e045f491
43
docs/doc_examples/028f6d6ac2594e20b78b8a8f8cbad49d.asciidoc
Normal file
43
docs/doc_examples/028f6d6ac2594e20b78b8a8f8cbad49d.asciidoc
Normal file
@ -0,0 +1,43 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
countries: {
|
||||
terms: {
|
||||
field: 'artist.country',
|
||||
order: [
|
||||
{
|
||||
'rock>playback_stats.avg': 'desc'
|
||||
},
|
||||
{
|
||||
_count: 'desc'
|
||||
}
|
||||
]
|
||||
},
|
||||
aggs: {
|
||||
rock: {
|
||||
filter: {
|
||||
term: {
|
||||
genre: 'rock'
|
||||
}
|
||||
},
|
||||
aggs: {
|
||||
playback_stats: {
|
||||
stats: {
|
||||
field: 'play_count'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
22
docs/doc_examples/033778305d52746f5ce0a2a922c8e521.asciidoc
Normal file
22
docs/doc_examples/033778305d52746f5ce0a2a922c8e521.asciidoc
Normal file
@ -0,0 +1,22 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
genres: {
|
||||
terms: {
|
||||
script: {
|
||||
source: "doc['genre'].value",
|
||||
lang: 'painless'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
48
docs/doc_examples/06afce2955f9094d96d27067ebca32e8.asciidoc
Normal file
48
docs/doc_examples/06afce2955f9094d96d27067ebca32e8.asciidoc
Normal file
@ -0,0 +1,48 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
bool: {
|
||||
must: {
|
||||
term: {
|
||||
user: 'kimchy'
|
||||
}
|
||||
},
|
||||
filter: {
|
||||
term: {
|
||||
tag: 'tech'
|
||||
}
|
||||
},
|
||||
must_not: {
|
||||
range: {
|
||||
age: {
|
||||
gte: 10,
|
||||
lte: 20
|
||||
}
|
||||
}
|
||||
},
|
||||
should: [
|
||||
{
|
||||
term: {
|
||||
tag: 'wow'
|
||||
}
|
||||
},
|
||||
{
|
||||
term: {
|
||||
tag: 'elasticsearch'
|
||||
}
|
||||
}
|
||||
],
|
||||
minimum_should_match: 1,
|
||||
boost: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
21
docs/doc_examples/0ac9916f47a2483b89c1416684af322a.asciidoc
Normal file
21
docs/doc_examples/0ac9916f47a2483b89c1416684af322a.asciidoc
Normal file
@ -0,0 +1,21 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
match: {
|
||||
message: {
|
||||
query: 'to be or not to be',
|
||||
operator: 'and',
|
||||
zero_terms_query: 'all'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
21
docs/doc_examples/0afaf1cad692e6201aa574c8feb6e622.asciidoc
Normal file
21
docs/doc_examples/0afaf1cad692e6201aa574c8feb6e622.asciidoc
Normal file
@ -0,0 +1,21 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
tags: {
|
||||
terms: {
|
||||
field: 'tags',
|
||||
include: '.*sport.*',
|
||||
exclude: 'water_.*'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
21
docs/doc_examples/162b5b693b713f0bfab1209d59443c46.asciidoc
Normal file
21
docs/doc_examples/162b5b693b713f0bfab1209d59443c46.asciidoc
Normal file
@ -0,0 +1,21 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
constant_score: {
|
||||
filter: {
|
||||
term: {
|
||||
status: 'active'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
11
docs/doc_examples/1c23507edd7a3c18538b68223378e4ab.asciidoc
Normal file
11
docs/doc_examples/1c23507edd7a3c18538b68223378e4ab.asciidoc
Normal file
@ -0,0 +1,11 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: 'twitter'
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
29
docs/doc_examples/34efeade38445b2834749ced59782e25.asciidoc
Normal file
29
docs/doc_examples/34efeade38445b2834749ced59782e25.asciidoc
Normal file
@ -0,0 +1,29 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
genres: {
|
||||
terms: {
|
||||
field: 'genre',
|
||||
order: {
|
||||
'playback_stats.max': 'desc'
|
||||
}
|
||||
},
|
||||
aggs: {
|
||||
playback_stats: {
|
||||
stats: {
|
||||
field: 'play_count'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
21
docs/doc_examples/35e8da9410b8432cf4095f2541ad7b1d.asciidoc
Normal file
21
docs/doc_examples/35e8da9410b8432cf4095f2541ad7b1d.asciidoc
Normal file
@ -0,0 +1,21 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
products: {
|
||||
terms: {
|
||||
field: 'product',
|
||||
size: 5,
|
||||
show_term_doc_count_error: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
20
docs/doc_examples/4466d410e06712c63328de4db249e6da.asciidoc
Normal file
20
docs/doc_examples/4466d410e06712c63328de4db249e6da.asciidoc
Normal file
@ -0,0 +1,20 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
range: {
|
||||
timestamp: {
|
||||
gte: 'now-1d/d',
|
||||
lt: 'now/d'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
24
docs/doc_examples/4646764bf09911fee7d58630c72d3137.asciidoc
Normal file
24
docs/doc_examples/4646764bf09911fee7d58630c72d3137.asciidoc
Normal file
@ -0,0 +1,24 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
genres: {
|
||||
terms: {
|
||||
script: {
|
||||
id: 'my_script',
|
||||
params: {
|
||||
field: 'genre'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
16
docs/doc_examples/4d46dbb96125b27f46299547de9d8709.asciidoc
Normal file
16
docs/doc_examples/4d46dbb96125b27f46299547de9d8709.asciidoc
Normal file
@ -0,0 +1,16 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: 'test',
|
||||
body: {
|
||||
settings: {
|
||||
'index.write.wait_for_active_shards': '2'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
24
docs/doc_examples/4d56b179242fed59e3d6476f817b6055.asciidoc
Normal file
24
docs/doc_examples/4d56b179242fed59e3d6476f817b6055.asciidoc
Normal file
@ -0,0 +1,24 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: 'test',
|
||||
body: {
|
||||
aliases: {
|
||||
alias_1: {},
|
||||
alias_2: {
|
||||
filter: {
|
||||
term: {
|
||||
user: 'kimchy'
|
||||
}
|
||||
},
|
||||
routing: 'kimchy'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
20
docs/doc_examples/5043b83a89091fa00edb341ddf7ba370.asciidoc
Normal file
20
docs/doc_examples/5043b83a89091fa00edb341ddf7ba370.asciidoc
Normal file
@ -0,0 +1,20 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
match: {
|
||||
message: {
|
||||
query: 'this is a testt',
|
||||
fuzziness: 'AUTO'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
20
docs/doc_examples/527324766814561b75aaee853ede49a7.asciidoc
Normal file
20
docs/doc_examples/527324766814561b75aaee853ede49a7.asciidoc
Normal file
@ -0,0 +1,20 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
tags: {
|
||||
terms: {
|
||||
field: 'tags',
|
||||
min_doc_count: 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
21
docs/doc_examples/5d13a71fa7fda73b15111803b1c7cfd3.asciidoc
Normal file
21
docs/doc_examples/5d13a71fa7fda73b15111803b1c7cfd3.asciidoc
Normal file
@ -0,0 +1,21 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
range: {
|
||||
timestamp: {
|
||||
time_zone: '+01:00',
|
||||
gte: '2015-01-01 00:00:00',
|
||||
lte: 'now'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
35
docs/doc_examples/5d9d7b84e2fec7ecd832145cbb951cf1.asciidoc
Normal file
35
docs/doc_examples/5d9d7b84e2fec7ecd832145cbb951cf1.asciidoc
Normal file
@ -0,0 +1,35 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
size: 0,
|
||||
aggs: {
|
||||
expired_sessions: {
|
||||
terms: {
|
||||
field: 'account_id',
|
||||
include: {
|
||||
partition: 0,
|
||||
num_partitions: 20
|
||||
},
|
||||
size: 10000,
|
||||
order: {
|
||||
last_access: 'asc'
|
||||
}
|
||||
},
|
||||
aggs: {
|
||||
last_access: {
|
||||
max: {
|
||||
field: 'access_date'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
20
docs/doc_examples/6138d6919f3cbaaf61e1092f817d295c.asciidoc
Normal file
20
docs/doc_examples/6138d6919f3cbaaf61e1092f817d295c.asciidoc
Normal file
@ -0,0 +1,20 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
match: {
|
||||
message: {
|
||||
query: 'this is a test',
|
||||
operator: 'and'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
22
docs/doc_examples/6a4679531e64c492fce16dc12de6dcb0.asciidoc
Normal file
22
docs/doc_examples/6a4679531e64c492fce16dc12de6dcb0.asciidoc
Normal file
@ -0,0 +1,22 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
genres: {
|
||||
terms: {
|
||||
field: 'genre',
|
||||
order: {
|
||||
_count: 'asc'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
29
docs/doc_examples/71b5b2ba9557d0f296ff2de91727d2f6.asciidoc
Normal file
29
docs/doc_examples/71b5b2ba9557d0f296ff2de91727d2f6.asciidoc
Normal file
@ -0,0 +1,29 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
genres: {
|
||||
terms: {
|
||||
field: 'genre',
|
||||
order: {
|
||||
max_play_count: 'desc'
|
||||
}
|
||||
},
|
||||
aggs: {
|
||||
max_play_count: {
|
||||
max: {
|
||||
field: 'play_count'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
20
docs/doc_examples/774d715155cd13713e6e327adf6ce328.asciidoc
Normal file
20
docs/doc_examples/774d715155cd13713e6e327adf6ce328.asciidoc
Normal file
@ -0,0 +1,20 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
tags: {
|
||||
terms: {
|
||||
field: 'tags',
|
||||
execution_hint: 'map'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
28
docs/doc_examples/7f28f8ae8fcdbd807dadde0b5b007a6d.asciidoc
Normal file
28
docs/doc_examples/7f28f8ae8fcdbd807dadde0b5b007a6d.asciidoc
Normal file
@ -0,0 +1,28 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
actors: {
|
||||
terms: {
|
||||
field: 'actors',
|
||||
size: 10
|
||||
},
|
||||
aggs: {
|
||||
costars: {
|
||||
terms: {
|
||||
field: 'actors',
|
||||
size: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
20
docs/doc_examples/7f56755fb6c42f7e6203339a6d0cb6e6.asciidoc
Normal file
20
docs/doc_examples/7f56755fb6c42f7e6203339a6d0cb6e6.asciidoc
Normal file
@ -0,0 +1,20 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
match: {
|
||||
message: {
|
||||
query: 'ny city',
|
||||
auto_generate_synonyms_phrase_query: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
22
docs/doc_examples/93f1bdd72e79827dcf9a34efa02fd977.asciidoc
Normal file
22
docs/doc_examples/93f1bdd72e79827dcf9a34efa02fd977.asciidoc
Normal file
@ -0,0 +1,22 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
genres: {
|
||||
terms: {
|
||||
field: 'genre',
|
||||
order: {
|
||||
_key: 'asc'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
21
docs/doc_examples/97bcd92ef148312d41e69f0d18284327.asciidoc
Normal file
21
docs/doc_examples/97bcd92ef148312d41e69f0d18284327.asciidoc
Normal file
@ -0,0 +1,21 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
range: {
|
||||
age: {
|
||||
gte: 10,
|
||||
lte: 20,
|
||||
boost: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
32
docs/doc_examples/98b121bf47cebd85671a2cb519688d28.asciidoc
Normal file
32
docs/doc_examples/98b121bf47cebd85671a2cb519688d28.asciidoc
Normal file
@ -0,0 +1,32 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
JapaneseCars: {
|
||||
terms: {
|
||||
field: 'make',
|
||||
include: [
|
||||
'mazda',
|
||||
'honda'
|
||||
]
|
||||
}
|
||||
},
|
||||
ActiveCarManufacturers: {
|
||||
terms: {
|
||||
field: 'make',
|
||||
exclude: [
|
||||
'rover',
|
||||
'jensen'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
19
docs/doc_examples/9a8995fd31351045d99c78e40444c8ea.asciidoc
Normal file
19
docs/doc_examples/9a8995fd31351045d99c78e40444c8ea.asciidoc
Normal file
@ -0,0 +1,19 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
genres: {
|
||||
terms: {
|
||||
field: 'genre'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
23
docs/doc_examples/a49169b4622918992411fab4ec48191b.asciidoc
Normal file
23
docs/doc_examples/a49169b4622918992411fab4ec48191b.asciidoc
Normal file
@ -0,0 +1,23 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
genres: {
|
||||
terms: {
|
||||
field: 'genre',
|
||||
script: {
|
||||
source: "'Genre: ' +_value",
|
||||
lang: 'painless'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
17
docs/doc_examples/b9c5d7ca6ca9c6f747201f45337a4abf.asciidoc
Normal file
17
docs/doc_examples/b9c5d7ca6ca9c6f747201f45337a4abf.asciidoc
Normal file
@ -0,0 +1,17 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: 'twitter',
|
||||
body: {
|
||||
settings: {
|
||||
number_of_shards: 3,
|
||||
number_of_replicas: 2
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
29
docs/doc_examples/cd5bc5bf7cd58d7b1492c9c298b345f6.asciidoc
Normal file
29
docs/doc_examples/cd5bc5bf7cd58d7b1492c9c298b345f6.asciidoc
Normal file
@ -0,0 +1,29 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
actors: {
|
||||
terms: {
|
||||
field: 'actors',
|
||||
size: 10,
|
||||
collect_mode: 'breadth_first'
|
||||
},
|
||||
aggs: {
|
||||
costars: {
|
||||
terms: {
|
||||
field: 'actors',
|
||||
size: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
20
docs/doc_examples/d50a3835bf5795ac73e58906a3413544.asciidoc
Normal file
20
docs/doc_examples/d50a3835bf5795ac73e58906a3413544.asciidoc
Normal file
@ -0,0 +1,20 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
products: {
|
||||
terms: {
|
||||
field: 'product',
|
||||
size: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
38
docs/doc_examples/dc15e2373e5ecbe09b4ea0858eb63d47.asciidoc
Normal file
38
docs/doc_examples/dc15e2373e5ecbe09b4ea0858eb63d47.asciidoc
Normal file
@ -0,0 +1,38 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
countries: {
|
||||
terms: {
|
||||
field: 'artist.country',
|
||||
order: {
|
||||
'rock>playback_stats.avg': 'desc'
|
||||
}
|
||||
},
|
||||
aggs: {
|
||||
rock: {
|
||||
filter: {
|
||||
term: {
|
||||
genre: 'rock'
|
||||
}
|
||||
},
|
||||
aggs: {
|
||||
playback_stats: {
|
||||
stats: {
|
||||
field: 'play_count'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
23
docs/doc_examples/dfef545b1e2c247bafd1347e8e807ac1.asciidoc
Normal file
23
docs/doc_examples/dfef545b1e2c247bafd1347e8e807ac1.asciidoc
Normal file
@ -0,0 +1,23 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: 'test',
|
||||
body: {
|
||||
settings: {
|
||||
number_of_shards: 1
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
field1: {
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
19
docs/doc_examples/e0d6e02b998bdea99c9c08dcc3630c5e.asciidoc
Normal file
19
docs/doc_examples/e0d6e02b998bdea99c9c08dcc3630c5e.asciidoc
Normal file
@ -0,0 +1,19 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
match: {
|
||||
message: {
|
||||
query: 'this is a test'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
19
docs/doc_examples/e5d2172b524332196cac0f031c043659.asciidoc
Normal file
19
docs/doc_examples/e5d2172b524332196cac0f031c043659.asciidoc
Normal file
@ -0,0 +1,19 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: 'twitter',
|
||||
body: {
|
||||
settings: {
|
||||
index: {
|
||||
number_of_shards: 3,
|
||||
number_of_replicas: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
20
docs/doc_examples/f085fb032dae56a3b104ab874eaea2ad.asciidoc
Normal file
20
docs/doc_examples/f085fb032dae56a3b104ab874eaea2ad.asciidoc
Normal file
@ -0,0 +1,20 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
aggs: {
|
||||
tags: {
|
||||
terms: {
|
||||
field: 'tags',
|
||||
missing: 'N/A'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
42
docs/doc_examples/f29a28fffa7ec604a33a838f48f7ea79.asciidoc
Normal file
42
docs/doc_examples/f29a28fffa7ec604a33a838f48f7ea79.asciidoc
Normal file
@ -0,0 +1,42 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
bool: {
|
||||
must: [
|
||||
{
|
||||
match: {
|
||||
title: 'Search'
|
||||
}
|
||||
},
|
||||
{
|
||||
match: {
|
||||
content: 'Elasticsearch'
|
||||
}
|
||||
}
|
||||
],
|
||||
filter: [
|
||||
{
|
||||
term: {
|
||||
status: 'published'
|
||||
}
|
||||
},
|
||||
{
|
||||
range: {
|
||||
publish_date: {
|
||||
gte: '2015-01-01'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
21
docs/doc_examples/f70a54cd9a9f4811bf962e469f2ca2ea.asciidoc
Normal file
21
docs/doc_examples/f70a54cd9a9f4811bf962e469f2ca2ea.asciidoc
Normal file
@ -0,0 +1,21 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
bool: {
|
||||
filter: {
|
||||
term: {
|
||||
status: 'active'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
17
docs/doc_examples/fa2fe60f570bd930d2891778c6efbfe6.asciidoc
Normal file
17
docs/doc_examples/fa2fe60f570bd930d2891778c6efbfe6.asciidoc
Normal file
@ -0,0 +1,17 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
match: {
|
||||
message: 'this is a test'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
24
docs/doc_examples/fa88f6f5a7d728ec4f1d05244228cb09.asciidoc
Normal file
24
docs/doc_examples/fa88f6f5a7d728ec4f1d05244228cb09.asciidoc
Normal file
@ -0,0 +1,24 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.search({
|
||||
body: {
|
||||
query: {
|
||||
bool: {
|
||||
must: {
|
||||
match_all: {}
|
||||
},
|
||||
filter: {
|
||||
term: {
|
||||
status: 'active'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
12
docs/doc_examples/fabe14480624a99e8ee42c7338672058.asciidoc
Normal file
12
docs/doc_examples/fabe14480624a99e8ee42c7338672058.asciidoc
Normal file
@ -0,0 +1,12 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: 'test',
|
||||
wait_for_active_shards: '2'
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
@ -37,7 +37,14 @@ const enabledFiles = [
|
||||
'query-dsl.asciidoc',
|
||||
'search/request-body.asciidoc',
|
||||
'setup/install/check-running.asciidoc',
|
||||
'mapping.asciidoc'
|
||||
'mapping.asciidoc',
|
||||
'query-dsl/query_filter_context.asciidoc',
|
||||
'query-dsl/bool-query.asciidoc',
|
||||
'query-dsl/match-query.asciidoc',
|
||||
'indices/create-index.asciidoc',
|
||||
'docs/index_.asciidoc',
|
||||
'aggregations/bucket/terms-aggregation.asciidoc',
|
||||
'query-dsl/range-query.asciidoc'
|
||||
]
|
||||
|
||||
function generate () {
|
||||
@ -67,8 +74,6 @@ function generateAsciidoc (source) {
|
||||
var serializedApiArguments = Object.keys(apiArguments).length > 0
|
||||
? JSON.stringify(apiArguments, null, 2)
|
||||
: ''
|
||||
serializedApiArguments = serializedApiArguments.replace(/"/g, "'")
|
||||
|
||||
code += `const response${getResponsePostfix(i)} = await client.${api.replace(/_([a-z])/g, g => g[1].toUpperCase())}(${serializedApiArguments})
|
||||
console.log(response${getResponsePostfix(i)})
|
||||
\n`
|
||||
|
||||
Reference in New Issue
Block a user