Added new docs examples (#1101)
* Added new docs examples * Updated enabled files list
This commit is contained in:
committed by
GitHub
parent
7b7c9130f3
commit
508aa362e6
18
docs/doc_examples/015294a400986295039e52ebc62033be.asciidoc
Normal file
18
docs/doc_examples/015294a400986295039e52ebc62033be.asciidoc
Normal file
@ -0,0 +1,18 @@
|
||||
// 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.update({
|
||||
index: 'test',
|
||||
id: '1',
|
||||
body: {
|
||||
doc: {
|
||||
name: 'new_name'
|
||||
},
|
||||
detect_noop: false
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
15
docs/doc_examples/09d617863a103c82fb4101e6165ea7fe.asciidoc
Normal file
15
docs/doc_examples/09d617863a103c82fb4101e6165ea7fe.asciidoc
Normal file
@ -0,0 +1,15 @@
|
||||
// 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_all: {}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
24
docs/doc_examples/0a958e486ede3f519d48431ab689eded.asciidoc
Normal file
24
docs/doc_examples/0a958e486ede3f519d48431ab689eded.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.update({
|
||||
index: 'test',
|
||||
id: '1',
|
||||
body: {
|
||||
script: {
|
||||
source: 'ctx._source.counter += params.count',
|
||||
lang: 'painless',
|
||||
params: {
|
||||
count: 4
|
||||
}
|
||||
},
|
||||
upsert: {
|
||||
counter: 1
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
18
docs/doc_examples/0cc991e3f7f8511a34730e154b3c5edc.asciidoc
Normal file
18
docs/doc_examples/0cc991e3f7f8511a34730e154b3c5edc.asciidoc
Normal file
@ -0,0 +1,18 @@
|
||||
// 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.reindex({
|
||||
body: {
|
||||
source: {
|
||||
index: 'twitter'
|
||||
},
|
||||
dest: {
|
||||
index: 'new_twitter'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
21
docs/doc_examples/1216f8f7367df3aa823012cef310c08a.asciidoc
Normal file
21
docs/doc_examples/1216f8f7367df3aa823012cef310c08a.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.reindex({
|
||||
body: {
|
||||
source: {
|
||||
index: 'test'
|
||||
},
|
||||
dest: {
|
||||
index: 'test2'
|
||||
},
|
||||
script: {
|
||||
source: 'ctx._source.tag = ctx._source.remove("flag")'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
17
docs/doc_examples/1577e6e806b3283c9e99f1596d310754.asciidoc
Normal file
17
docs/doc_examples/1577e6e806b3283c9e99f1596d310754.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.index({
|
||||
index: 'test',
|
||||
id: '1',
|
||||
refresh: true,
|
||||
body: {
|
||||
text: 'words words',
|
||||
flag: 'foo'
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
38
docs/doc_examples/1b8655e6ba99fe39933c6eafe78728b7.asciidoc
Normal file
38
docs/doc_examples/1b8655e6ba99fe39933c6eafe78728b7.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 response0 = await client.reindex({
|
||||
body: {
|
||||
source: {
|
||||
index: 'twitter',
|
||||
slice: {
|
||||
id: 0,
|
||||
max: 2
|
||||
}
|
||||
},
|
||||
dest: {
|
||||
index: 'new_twitter'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response0)
|
||||
|
||||
const response1 = await client.reindex({
|
||||
body: {
|
||||
source: {
|
||||
index: 'twitter',
|
||||
slice: {
|
||||
id: 1,
|
||||
max: 2
|
||||
}
|
||||
},
|
||||
dest: {
|
||||
index: 'new_twitter'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response1)
|
||||
----
|
||||
|
||||
31
docs/doc_examples/1b8caf0a6741126c6d0ad83b56fce290.asciidoc
Normal file
31
docs/doc_examples/1b8caf0a6741126c6d0ad83b56fce290.asciidoc
Normal file
@ -0,0 +1,31 @@
|
||||
// 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.putTemplate({
|
||||
name: 'template_1',
|
||||
body: {
|
||||
index_patterns: [
|
||||
'te*'
|
||||
],
|
||||
settings: {
|
||||
number_of_shards: 1
|
||||
},
|
||||
aliases: {
|
||||
alias1: {},
|
||||
alias2: {
|
||||
filter: {
|
||||
term: {
|
||||
user: 'kimchy'
|
||||
}
|
||||
},
|
||||
routing: 'kimchy'
|
||||
},
|
||||
'{index}-alias': {}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
25
docs/doc_examples/1bc731a4df952228af6dfa6b48627332.asciidoc
Normal file
25
docs/doc_examples/1bc731a4df952228af6dfa6b48627332.asciidoc
Normal file
@ -0,0 +1,25 @@
|
||||
// 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.reindex({
|
||||
body: {
|
||||
max_docs: 10,
|
||||
source: {
|
||||
index: 'twitter',
|
||||
query: {
|
||||
function_score: {
|
||||
random_score: {},
|
||||
min_score: 0.9
|
||||
}
|
||||
}
|
||||
},
|
||||
dest: {
|
||||
index: 'random_twitter'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
20
docs/doc_examples/2a1de18774f9c68cafa169847832b2bc.asciidoc
Normal file
20
docs/doc_examples/2a1de18774f9c68cafa169847832b2bc.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.indices.create({
|
||||
index: 'my_index',
|
||||
body: {
|
||||
mappings: {
|
||||
properties: {
|
||||
full_text: {
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
28
docs/doc_examples/36b2778f23d0955255f52c075c4d213d.asciidoc
Normal file
28
docs/doc_examples/36b2778f23d0955255f52c075c4d213d.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.reindex({
|
||||
body: {
|
||||
source: {
|
||||
remote: {
|
||||
host: 'http://otherhost:9200',
|
||||
username: 'user',
|
||||
password: 'pass'
|
||||
},
|
||||
index: 'source',
|
||||
query: {
|
||||
match: {
|
||||
test: 'data'
|
||||
}
|
||||
}
|
||||
},
|
||||
dest: {
|
||||
index: 'dest'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
18
docs/doc_examples/381fced1882ca8337143e6bb180a5715.asciidoc
Normal file
18
docs/doc_examples/381fced1882ca8337143e6bb180a5715.asciidoc
Normal file
@ -0,0 +1,18 @@
|
||||
// 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.index({
|
||||
index: 'test',
|
||||
id: '1',
|
||||
body: {
|
||||
counter: 1,
|
||||
tags: [
|
||||
'red'
|
||||
]
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
17
docs/doc_examples/38c1d0f6668e9563c0827f839f9fa505.asciidoc
Normal file
17
docs/doc_examples/38c1d0f6668e9563c0827f839f9fa505.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.update({
|
||||
index: 'test',
|
||||
id: '1',
|
||||
body: {
|
||||
doc: {
|
||||
name: 'new_name'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
16
docs/doc_examples/3ae03ba3b56e5e287953094050766738.asciidoc
Normal file
16
docs/doc_examples/3ae03ba3b56e5e287953094050766738.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 response0 = await client.indices.refresh()
|
||||
console.log(response0)
|
||||
|
||||
const response1 = await client.search({
|
||||
index: 'new_twitter',
|
||||
size: '0',
|
||||
filter_path: 'hits.total'
|
||||
})
|
||||
console.log(response1)
|
||||
----
|
||||
|
||||
18
docs/doc_examples/3b04cc894e6a47d57983484010feac0c.asciidoc
Normal file
18
docs/doc_examples/3b04cc894e6a47d57983484010feac0c.asciidoc
Normal file
@ -0,0 +1,18 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response0 = await client.get({
|
||||
index: 'metricbeat-2016.05.30-1',
|
||||
id: '1'
|
||||
})
|
||||
console.log(response0)
|
||||
|
||||
const response1 = await client.get({
|
||||
index: 'metricbeat-2016.05.31-1',
|
||||
id: '1'
|
||||
})
|
||||
console.log(response1)
|
||||
----
|
||||
|
||||
20
docs/doc_examples/400e89eb46ead8e9c9e40f123fd5e590.asciidoc
Normal file
20
docs/doc_examples/400e89eb46ead8e9c9e40f123fd5e590.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.reindex({
|
||||
body: {
|
||||
source: {
|
||||
index: 'source',
|
||||
size: 100
|
||||
},
|
||||
dest: {
|
||||
index: 'dest',
|
||||
routing: '=cat'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
12
docs/doc_examples/46658f00edc4865dfe472a392374cd0f.asciidoc
Normal file
12
docs/doc_examples/46658f00edc4865dfe472a392374cd0f.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.getTemplate({
|
||||
name: 'template_1',
|
||||
filter_path: '*.version'
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
21
docs/doc_examples/4cd246e5c4c035a2cd4081ae9a3d54e5.asciidoc
Normal file
21
docs/doc_examples/4cd246e5c4c035a2cd4081ae9a3d54e5.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.update({
|
||||
index: 'test',
|
||||
id: '1',
|
||||
body: {
|
||||
script: {
|
||||
source: 'ctx._source.tags.add(params.tag)',
|
||||
lang: 'painless',
|
||||
params: {
|
||||
tag: 'blue'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
19
docs/doc_examples/52b2bfbdd78f8283b6f4891c48013237.asciidoc
Normal file
19
docs/doc_examples/52b2bfbdd78f8283b6f4891c48013237.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.reindex({
|
||||
body: {
|
||||
max_docs: 1,
|
||||
source: {
|
||||
index: 'twitter'
|
||||
},
|
||||
dest: {
|
||||
index: 'new_twitter'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
15
docs/doc_examples/58df61acbfb15b8ef0aaa18b81ae98a6.asciidoc
Normal file
15
docs/doc_examples/58df61acbfb15b8ef0aaa18b81ae98a6.asciidoc
Normal file
@ -0,0 +1,15 @@
|
||||
// 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.update({
|
||||
index: 'test',
|
||||
id: '1',
|
||||
body: {
|
||||
script: "ctx._source.remove('new_field')"
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
27
docs/doc_examples/64b9baa6d7556b960b29698f3383aa31.asciidoc
Normal file
27
docs/doc_examples/64b9baa6d7556b960b29698f3383aa31.asciidoc
Normal file
@ -0,0 +1,27 @@
|
||||
// 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.reindex({
|
||||
body: {
|
||||
source: {
|
||||
remote: {
|
||||
host: 'http://otherhost:9200'
|
||||
},
|
||||
index: 'source',
|
||||
size: 10,
|
||||
query: {
|
||||
match: {
|
||||
test: 'data'
|
||||
}
|
||||
}
|
||||
},
|
||||
dest: {
|
||||
index: 'dest'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
12
docs/doc_examples/68738b4fd0dda177022be45be95b4c84.asciidoc
Normal file
12
docs/doc_examples/68738b4fd0dda177022be45be95b4c84.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.reindexRethrottle({
|
||||
task_id: 'r1A2WoRbTwKZ516z6NEs5A:36619',
|
||||
requests_per_second: '-1'
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
21
docs/doc_examples/6f097c298a7abf4c032c4314920c49c8.asciidoc
Normal file
21
docs/doc_examples/6f097c298a7abf4c032c4314920c49c8.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.reindex({
|
||||
body: {
|
||||
source: {
|
||||
index: [
|
||||
'twitter',
|
||||
'blog'
|
||||
]
|
||||
},
|
||||
dest: {
|
||||
index: 'all_together'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
17
docs/doc_examples/75330ec1305d2beb0e2f34d2195464e2.asciidoc
Normal file
17
docs/doc_examples/75330ec1305d2beb0e2f34d2195464e2.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_all: {
|
||||
boost: 1.2
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
23
docs/doc_examples/764f9884b370cbdc82a1c5c42ed40ff3.asciidoc
Normal file
23
docs/doc_examples/764f9884b370cbdc82a1c5c42ed40ff3.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.reindex({
|
||||
body: {
|
||||
source: {
|
||||
index: 'twitter',
|
||||
query: {
|
||||
term: {
|
||||
user: 'kimchy'
|
||||
}
|
||||
}
|
||||
},
|
||||
dest: {
|
||||
index: 'new_twitter'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
24
docs/doc_examples/78c96113ae4ed0054e581b17542528a7.asciidoc
Normal file
24
docs/doc_examples/78c96113ae4ed0054e581b17542528a7.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.reindex({
|
||||
body: {
|
||||
source: {
|
||||
index: 'source',
|
||||
query: {
|
||||
match: {
|
||||
company: 'cat'
|
||||
}
|
||||
}
|
||||
},
|
||||
dest: {
|
||||
index: 'dest',
|
||||
routing: '=cat'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
18
docs/doc_examples/7cac05cb589f1614fd5b8589153bef06.asciidoc
Normal file
18
docs/doc_examples/7cac05cb589f1614fd5b8589153bef06.asciidoc
Normal file
@ -0,0 +1,18 @@
|
||||
// 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.update({
|
||||
index: 'test',
|
||||
id: '1',
|
||||
body: {
|
||||
doc: {
|
||||
name: 'new_name'
|
||||
},
|
||||
doc_as_upsert: true
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
28
docs/doc_examples/7f697eb436dfa3c30dfe610d8c32d132.asciidoc
Normal file
28
docs/doc_examples/7f697eb436dfa3c30dfe610d8c32d132.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.reindex({
|
||||
body: {
|
||||
source: {
|
||||
remote: {
|
||||
host: 'http://otherhost:9200',
|
||||
socket_timeout: '1m',
|
||||
connect_timeout: '10s'
|
||||
},
|
||||
index: 'source',
|
||||
query: {
|
||||
match: {
|
||||
test: 'data'
|
||||
}
|
||||
}
|
||||
},
|
||||
dest: {
|
||||
index: 'dest'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
15
docs/doc_examples/81c9aa2678d6166a9662ddf2c011a6a5.asciidoc
Normal file
15
docs/doc_examples/81c9aa2678d6166a9662ddf2c011a6a5.asciidoc
Normal file
@ -0,0 +1,15 @@
|
||||
// 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_none: {}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
23
docs/doc_examples/8871b8fcb6de4f0c7dff22798fb10fb7.asciidoc
Normal file
23
docs/doc_examples/8871b8fcb6de4f0c7dff22798fb10fb7.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.reindex({
|
||||
body: {
|
||||
source: {
|
||||
index: 'twitter'
|
||||
},
|
||||
dest: {
|
||||
index: 'new_twitter',
|
||||
version_type: 'external'
|
||||
},
|
||||
script: {
|
||||
source: "if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}",
|
||||
lang: 'painless'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
21
docs/doc_examples/9166cf38427d5cde5d2ec12a2012b669.asciidoc
Normal file
21
docs/doc_examples/9166cf38427d5cde5d2ec12a2012b669.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.indices.putTemplate({
|
||||
name: 'template_1',
|
||||
body: {
|
||||
index_patterns: [
|
||||
'*'
|
||||
],
|
||||
order: 0,
|
||||
settings: {
|
||||
number_of_shards: 1
|
||||
},
|
||||
version: 123
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
21
docs/doc_examples/96de5703ba0bd43fd4ac239ec5408542.asciidoc
Normal file
21
docs/doc_examples/96de5703ba0bd43fd4ac239ec5408542.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.update({
|
||||
index: 'test',
|
||||
id: '1',
|
||||
body: {
|
||||
script: {
|
||||
source: 'ctx._source.counter += params.count',
|
||||
lang: 'painless',
|
||||
params: {
|
||||
count: 4
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
22
docs/doc_examples/973a3ff47fc4ce036ecd9bd363fef9f7.asciidoc
Normal file
22
docs/doc_examples/973a3ff47fc4ce036ecd9bd363fef9f7.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.reindex({
|
||||
body: {
|
||||
source: {
|
||||
index: 'metricbeat-*'
|
||||
},
|
||||
dest: {
|
||||
index: 'metricbeat'
|
||||
},
|
||||
script: {
|
||||
lang: 'painless',
|
||||
source: "ctx._index = 'metricbeat-' + (ctx._index.substring('metricbeat-'.length(), ctx._index.length())) + '-1'"
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
21
docs/doc_examples/98aeb275f829b5f7b8eb2147701565ff.asciidoc
Normal file
21
docs/doc_examples/98aeb275f829b5f7b8eb2147701565ff.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.update({
|
||||
index: 'test',
|
||||
id: '1',
|
||||
body: {
|
||||
script: {
|
||||
source: "if (ctx._source.tags.contains(params.tag)) { ctx.op = 'delete' } else { ctx.op = 'none' }",
|
||||
lang: 'painless',
|
||||
params: {
|
||||
tag: 'green'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
26
docs/doc_examples/9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc
Normal file
26
docs/doc_examples/9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc
Normal file
@ -0,0 +1,26 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response0 = await client.index({
|
||||
index: 'metricbeat-2016.05.30',
|
||||
id: '1',
|
||||
refresh: true,
|
||||
body: {
|
||||
'system.cpu.idle.pct': 0.908
|
||||
}
|
||||
})
|
||||
console.log(response0)
|
||||
|
||||
const response1 = await client.index({
|
||||
index: 'metricbeat-2016.05.31',
|
||||
id: '1',
|
||||
refresh: true,
|
||||
body: {
|
||||
'system.cpu.idle.pct': 0.105
|
||||
}
|
||||
})
|
||||
console.log(response1)
|
||||
----
|
||||
|
||||
19
docs/doc_examples/a80f5db4357bb25b8704d374c18318ed.asciidoc
Normal file
19
docs/doc_examples/a80f5db4357bb25b8704d374c18318ed.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({
|
||||
index: 'my_index',
|
||||
pretty: true,
|
||||
body: {
|
||||
query: {
|
||||
match: {
|
||||
full_text: 'Quick Brown Foxes!'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
21
docs/doc_examples/ac544eb247a29ca42aab13826ca88561.asciidoc
Normal file
21
docs/doc_examples/ac544eb247a29ca42aab13826ca88561.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.update({
|
||||
index: 'test',
|
||||
id: '1',
|
||||
body: {
|
||||
script: {
|
||||
source: 'if (ctx._source.tags.contains(params.tag)) { ctx._source.tags.remove(ctx._source.tags.indexOf(params.tag)) }',
|
||||
lang: 'painless',
|
||||
params: {
|
||||
tag: 'blue'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
19
docs/doc_examples/b1efa1c51a34dd5ab5511b71a399f5b1.asciidoc
Normal file
19
docs/doc_examples/b1efa1c51a34dd5ab5511b71a399f5b1.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.reindex({
|
||||
body: {
|
||||
source: {
|
||||
index: 'source'
|
||||
},
|
||||
dest: {
|
||||
index: 'dest',
|
||||
pipeline: 'some_ingest_pipeline'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
44
docs/doc_examples/b5f95bc097a201b29c7200fc8d3d31c1.asciidoc
Normal file
44
docs/doc_examples/b5f95bc097a201b29c7200fc8d3d31c1.asciidoc
Normal file
@ -0,0 +1,44 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response0 = await client.indices.putTemplate({
|
||||
name: 'template_1',
|
||||
body: {
|
||||
index_patterns: [
|
||||
'*'
|
||||
],
|
||||
order: 0,
|
||||
settings: {
|
||||
number_of_shards: 1
|
||||
},
|
||||
mappings: {
|
||||
_source: {
|
||||
enabled: false
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response0)
|
||||
|
||||
const response1 = await client.indices.putTemplate({
|
||||
name: 'template_2',
|
||||
body: {
|
||||
index_patterns: [
|
||||
'te*'
|
||||
],
|
||||
order: 1,
|
||||
settings: {
|
||||
number_of_shards: 1
|
||||
},
|
||||
mappings: {
|
||||
_source: {
|
||||
enabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response1)
|
||||
----
|
||||
|
||||
20
docs/doc_examples/cb01106bf524df5e0501d4c655c1aa7b.asciidoc
Normal file
20
docs/doc_examples/cb01106bf524df5e0501d4c655c1aa7b.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.reindex({
|
||||
slices: '5',
|
||||
refresh: true,
|
||||
body: {
|
||||
source: {
|
||||
index: 'twitter'
|
||||
},
|
||||
dest: {
|
||||
index: 'new_twitter'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
19
docs/doc_examples/cdedd5f33f7e5f7acde561e97bff61de.asciidoc
Normal file
19
docs/doc_examples/cdedd5f33f7e5f7acde561e97bff61de.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({
|
||||
index: 'my_index',
|
||||
pretty: true,
|
||||
body: {
|
||||
query: {
|
||||
term: {
|
||||
full_text: 'Quick Brown Foxes!'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
12
docs/doc_examples/cfc37446bd892d1ac42a3c8e8b204e6c.asciidoc
Normal file
12
docs/doc_examples/cfc37446bd892d1ac42a3c8e8b204e6c.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.get({
|
||||
index: 'test2',
|
||||
id: '1'
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
20
docs/doc_examples/d0a8a938a2fa913b6fdbc871079a59dd.asciidoc
Normal file
20
docs/doc_examples/d0a8a938a2fa913b6fdbc871079a59dd.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: {
|
||||
term: {
|
||||
user: {
|
||||
value: 'Kimchy',
|
||||
boost: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
15
docs/doc_examples/d4b4cefba4318caeba7480187faf2b13.asciidoc
Normal file
15
docs/doc_examples/d4b4cefba4318caeba7480187faf2b13.asciidoc
Normal file
@ -0,0 +1,15 @@
|
||||
// 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.index({
|
||||
index: 'my_index',
|
||||
id: '1',
|
||||
body: {
|
||||
full_text: 'Quick Brown Foxes!'
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
13
docs/doc_examples/e567e6dbf86300142573c73789c8fce4.asciidoc
Normal file
13
docs/doc_examples/e567e6dbf86300142573c73789c8fce4.asciidoc
Normal file
@ -0,0 +1,13 @@
|
||||
// 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({
|
||||
index: 'new_twitter',
|
||||
size: '0',
|
||||
filter_path: 'hits.total'
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
34
docs/doc_examples/e5f50b31f165462d883ecbff45f74985.asciidoc
Normal file
34
docs/doc_examples/e5f50b31f165462d883ecbff45f74985.asciidoc
Normal file
@ -0,0 +1,34 @@
|
||||
// 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.putTemplate({
|
||||
name: 'template_1',
|
||||
body: {
|
||||
index_patterns: [
|
||||
'te*',
|
||||
'bar*'
|
||||
],
|
||||
settings: {
|
||||
number_of_shards: 1
|
||||
},
|
||||
mappings: {
|
||||
_source: {
|
||||
enabled: false
|
||||
},
|
||||
properties: {
|
||||
host_name: {
|
||||
type: 'keyword'
|
||||
},
|
||||
created_at: {
|
||||
type: 'date',
|
||||
format: 'EEE MMM dd HH:mm:ss Z yyyy'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
22
docs/doc_examples/e9c2e15b36372d5281c879d336322b6c.asciidoc
Normal file
22
docs/doc_examples/e9c2e15b36372d5281c879d336322b6c.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.reindex({
|
||||
body: {
|
||||
source: {
|
||||
index: 'twitter',
|
||||
_source: [
|
||||
'user',
|
||||
'_doc'
|
||||
]
|
||||
},
|
||||
dest: {
|
||||
index: 'new_twitter'
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
15
docs/doc_examples/eb30ba547e4a7b8f54f33ab259aca523.asciidoc
Normal file
15
docs/doc_examples/eb30ba547e4a7b8f54f33ab259aca523.asciidoc
Normal file
@ -0,0 +1,15 @@
|
||||
// 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.update({
|
||||
index: 'test',
|
||||
id: '1',
|
||||
body: {
|
||||
script: "ctx._source.new_field = 'value_of_new_field'"
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
26
docs/doc_examples/f9636d7ef1a45be4f36418c875cf6bef.asciidoc
Normal file
26
docs/doc_examples/f9636d7ef1a45be4f36418c875cf6bef.asciidoc
Normal file
@ -0,0 +1,26 @@
|
||||
// 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.update({
|
||||
index: 'sessions',
|
||||
id: 'dh3sgudg8gsrgl',
|
||||
body: {
|
||||
scripted_upsert: true,
|
||||
script: {
|
||||
id: 'my_web_session_summariser',
|
||||
params: {
|
||||
pageViewEvent: {
|
||||
url: 'foo.com/bar',
|
||||
response: 404,
|
||||
time: '2014-01-01 12:32'
|
||||
}
|
||||
}
|
||||
},
|
||||
upsert: {}
|
||||
}
|
||||
})
|
||||
console.log(response)
|
||||
----
|
||||
|
||||
@ -49,7 +49,12 @@ const enabledFiles = [
|
||||
'query-dsl/multi-match-query.asciidoc',
|
||||
'docs/bulk.asciidoc',
|
||||
'indices/delete-index.asciidoc',
|
||||
'indices/put-mapping.asciidoc'
|
||||
'indices/put-mapping.asciidoc',
|
||||
'query-dsl/match-all-query.asciidoc',
|
||||
'query-dsl/term-query.asciidoc',
|
||||
'docs/update.asciidoc',
|
||||
'docs/reindex.asciidoc',
|
||||
'indices/templates.asciidoc'
|
||||
]
|
||||
|
||||
function generate () {
|
||||
|
||||
Reference in New Issue
Block a user