Added new docs examples (#1149)
* Updated enabled files list * Added new docs examples
This commit is contained in:
committed by
GitHub
parent
7717799ca6
commit
0e659031e3
30
docs/doc_examples/04fe1e3a0047b0cdb10987b79fc3f3f3.asciidoc
Normal file
30
docs/doc_examples/04fe1e3a0047b0cdb10987b79fc3f3f3.asciidoc
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// 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: 'kimchy'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sort: {
|
||||||
|
_script: {
|
||||||
|
type: 'number',
|
||||||
|
script: {
|
||||||
|
lang: 'painless',
|
||||||
|
source: "doc['field_name'].value * params.factor",
|
||||||
|
params: {
|
||||||
|
factor: 1.1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
order: 'asc'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
21
docs/doc_examples/0c4ad860a485fe53d8140ad3ccd11dcf.asciidoc
Normal file
21
docs/doc_examples/0c4ad860a485fe53d8140ad3ccd11dcf.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: {
|
||||||
|
terms: {
|
||||||
|
user: [
|
||||||
|
'kimchy',
|
||||||
|
'elasticsearch'
|
||||||
|
],
|
||||||
|
boost: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
22
docs/doc_examples/14701dcc0cca9665fce2aace0cb62af7.asciidoc
Normal file
22
docs/doc_examples/14701dcc0cca9665fce2aace0cb62af7.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({
|
||||||
|
index: 'twitter',
|
||||||
|
size: '0',
|
||||||
|
filter_path: 'hits.total',
|
||||||
|
body: {
|
||||||
|
query: {
|
||||||
|
range: {
|
||||||
|
likes: {
|
||||||
|
lt: 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
29
docs/doc_examples/15dad5338065baaaa7d475abe85f4c22.asciidoc
Normal file
29
docs/doc_examples/15dad5338065baaaa7d475abe85f4c22.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: {
|
||||||
|
sort: [
|
||||||
|
{
|
||||||
|
_geo_distance: {
|
||||||
|
'pin.location': [
|
||||||
|
-70,
|
||||||
|
40
|
||||||
|
],
|
||||||
|
order: 'asc',
|
||||||
|
unit: 'km'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
query: {
|
||||||
|
term: {
|
||||||
|
user: 'kimchy'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
11
docs/doc_examples/18ddb7e7a4bcafd449df956e828ed7a8.asciidoc
Normal file
11
docs/doc_examples/18ddb7e7a4bcafd449df956e828ed7a8.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.tasks.cancel({
|
||||||
|
task_id: 'r1A2WoRbTwKZ516z6NEs5A:36619'
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
42
docs/doc_examples/1e49eba5b9042c1900a608fe5105ba43.asciidoc
Normal file
42
docs/doc_examples/1e49eba5b9042c1900a608fe5105ba43.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 response0 = await client.deleteByQuery({
|
||||||
|
index: 'twitter',
|
||||||
|
body: {
|
||||||
|
slice: {
|
||||||
|
id: 0,
|
||||||
|
max: 2
|
||||||
|
},
|
||||||
|
query: {
|
||||||
|
range: {
|
||||||
|
likes: {
|
||||||
|
lt: 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response0)
|
||||||
|
|
||||||
|
const response1 = await client.deleteByQuery({
|
||||||
|
index: 'twitter',
|
||||||
|
body: {
|
||||||
|
slice: {
|
||||||
|
id: 1,
|
||||||
|
max: 2
|
||||||
|
},
|
||||||
|
query: {
|
||||||
|
range: {
|
||||||
|
likes: {
|
||||||
|
lt: 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response1)
|
||||||
|
----
|
||||||
|
|
||||||
12
docs/doc_examples/216848930c2d344fe0bed0daa70c35b9.asciidoc
Normal file
12
docs/doc_examples/216848930c2d344fe0bed0daa70c35b9.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.tasks.list({
|
||||||
|
detailed: 'true',
|
||||||
|
actions: '*/delete/byquery'
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
64
docs/doc_examples/22334f4b24bb8977d3e1bf2ffdc29d3f.asciidoc
Normal file
64
docs/doc_examples/22334f4b24bb8977d3e1bf2ffdc29d3f.asciidoc
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
// 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: {
|
||||||
|
nested: {
|
||||||
|
path: 'parent',
|
||||||
|
query: {
|
||||||
|
bool: {
|
||||||
|
must: {
|
||||||
|
range: {
|
||||||
|
'parent.age': {
|
||||||
|
gte: 21
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
filter: {
|
||||||
|
nested: {
|
||||||
|
path: 'parent.child',
|
||||||
|
query: {
|
||||||
|
match: {
|
||||||
|
'parent.child.name': 'matt'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sort: [
|
||||||
|
{
|
||||||
|
'parent.child.age': {
|
||||||
|
mode: 'min',
|
||||||
|
order: 'asc',
|
||||||
|
nested: {
|
||||||
|
path: 'parent',
|
||||||
|
filter: {
|
||||||
|
range: {
|
||||||
|
'parent.age': {
|
||||||
|
gte: 21
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
nested: {
|
||||||
|
path: 'parent.child',
|
||||||
|
filter: {
|
||||||
|
match: {
|
||||||
|
'parent.child.name': 'matt'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
20
docs/doc_examples/2891aa10ee9d474780adf94d5607f2db.asciidoc
Normal file
20
docs/doc_examples/2891aa10ee9d474780adf94d5607f2db.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({
|
||||||
|
index: 'index_long,index_double',
|
||||||
|
body: {
|
||||||
|
sort: [
|
||||||
|
{
|
||||||
|
field: {
|
||||||
|
numeric_type: 'double'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
17
docs/doc_examples/3342c69b2c2303247217532956fcce85.asciidoc
Normal file
17
docs/doc_examples/3342c69b2c2303247217532956fcce85.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: {
|
||||||
|
exists: {
|
||||||
|
field: 'user'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
25
docs/doc_examples/3e573bfabe00f8bfb8bb69aa5820768e.asciidoc
Normal file
25
docs/doc_examples/3e573bfabe00f8bfb8bb69aa5820768e.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 response0 = await client.indices.refresh()
|
||||||
|
console.log(response0)
|
||||||
|
|
||||||
|
const response1 = await client.search({
|
||||||
|
index: 'twitter',
|
||||||
|
size: '0',
|
||||||
|
filter_path: 'hits.total',
|
||||||
|
body: {
|
||||||
|
query: {
|
||||||
|
range: {
|
||||||
|
likes: {
|
||||||
|
lt: 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response1)
|
||||||
|
----
|
||||||
|
|
||||||
21
docs/doc_examples/43af86de5e49aa06070092fffc138208.asciidoc
Normal file
21
docs/doc_examples/43af86de5e49aa06070092fffc138208.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: {
|
||||||
|
must_not: {
|
||||||
|
exists: {
|
||||||
|
field: 'user'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
12
docs/doc_examples/52c7e4172a446c394210a07c464c57d2.asciidoc
Normal file
12
docs/doc_examples/52c7e4172a446c394210a07c464c57d2.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.deleteByQueryRethrottle({
|
||||||
|
task_id: 'r1A2WoRbTwKZ516z6NEs5A:36619',
|
||||||
|
requests_per_second: '-1'
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
20
docs/doc_examples/5f3549ac7fee94682ca0d7439eebdd2a.asciidoc
Normal file
20
docs/doc_examples/5f3549ac7fee94682ca0d7439eebdd2a.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({
|
||||||
|
index: 'index_long,index_double',
|
||||||
|
body: {
|
||||||
|
sort: [
|
||||||
|
{
|
||||||
|
field: {
|
||||||
|
numeric_type: 'date_nanos'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
20
docs/doc_examples/7477671958734843dd67cf0b8e6c7515.asciidoc
Normal file
20
docs/doc_examples/7477671958734843dd67cf0b8e6c7515.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: 'index_long',
|
||||||
|
body: {
|
||||||
|
mappings: {
|
||||||
|
properties: {
|
||||||
|
field: {
|
||||||
|
type: 'date_nanos'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
35
docs/doc_examples/77243bbf92f2a55e0fca6c2a349a1c15.asciidoc
Normal file
35
docs/doc_examples/77243bbf92f2a55e0fca6c2a349a1c15.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: {
|
||||||
|
sort: [
|
||||||
|
{
|
||||||
|
_geo_distance: {
|
||||||
|
'pin.location': [
|
||||||
|
[
|
||||||
|
-70,
|
||||||
|
40
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-71,
|
||||||
|
42
|
||||||
|
]
|
||||||
|
],
|
||||||
|
order: 'asc',
|
||||||
|
unit: 'km'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
query: {
|
||||||
|
term: {
|
||||||
|
user: 'kimchy'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
21
docs/doc_examples/7f465b7e8ed42df6c42251b4481e699e.asciidoc
Normal file
21
docs/doc_examples/7f465b7e8ed42df6c42251b4481e699e.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.create({
|
||||||
|
index: 'my_index',
|
||||||
|
body: {
|
||||||
|
mappings: {
|
||||||
|
properties: {
|
||||||
|
date: {
|
||||||
|
type: 'date',
|
||||||
|
format: 'yyyy-MM-dd'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
24
docs/doc_examples/899eef71a67a1b2aa11a2166ec7f48f1.asciidoc
Normal file
24
docs/doc_examples/899eef71a67a1b2aa11a2166ec7f48f1.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: {
|
||||||
|
sort: [
|
||||||
|
{
|
||||||
|
price: {
|
||||||
|
unmapped_type: 'long'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
query: {
|
||||||
|
term: {
|
||||||
|
product: 'chocolate'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
25
docs/doc_examples/8baccd8688a6bad1749b8935f9601ea4.asciidoc
Normal file
25
docs/doc_examples/8baccd8688a6bad1749b8935f9601ea4.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.index({
|
||||||
|
index: 'my_index',
|
||||||
|
id: '1',
|
||||||
|
body: {
|
||||||
|
group: 'fans',
|
||||||
|
user: [
|
||||||
|
{
|
||||||
|
first: 'John',
|
||||||
|
last: 'Smith'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
first: 'Alice',
|
||||||
|
last: 'White'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
15
docs/doc_examples/8c5977410335d58217e0626618ce6641.asciidoc
Normal file
15
docs/doc_examples/8c5977410335d58217e0626618ce6641.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: '2',
|
||||||
|
body: {
|
||||||
|
color: 'blue'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
29
docs/doc_examples/979d25dff2d8987119410291ad47b0d1.asciidoc
Normal file
29
docs/doc_examples/979d25dff2d8987119410291ad47b0d1.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: {
|
||||||
|
sort: [
|
||||||
|
{
|
||||||
|
_geo_distance: {
|
||||||
|
'pin.location': {
|
||||||
|
lat: 40,
|
||||||
|
lon: -70
|
||||||
|
},
|
||||||
|
order: 'asc',
|
||||||
|
unit: 'km'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
query: {
|
||||||
|
term: {
|
||||||
|
user: 'kimchy'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
20
docs/doc_examples/9e56d79ad9a02b642c361f0b85dd95d7.asciidoc
Normal file
20
docs/doc_examples/9e56d79ad9a02b642c361f0b85dd95d7.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: {
|
||||||
|
color: {
|
||||||
|
type: 'keyword'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
26
docs/doc_examples/a1db5c822745fe167e9ef854dca3d129.asciidoc
Normal file
26
docs/doc_examples/a1db5c822745fe167e9ef854dca3d129.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.search({
|
||||||
|
body: {
|
||||||
|
sort: [
|
||||||
|
{
|
||||||
|
_geo_distance: {
|
||||||
|
'pin.location': 'drm3btev3e86',
|
||||||
|
order: 'asc',
|
||||||
|
unit: 'km'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
query: {
|
||||||
|
term: {
|
||||||
|
user: 'kimchy'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
22
docs/doc_examples/a5a7050fb9dcb9574e081957ade28617.asciidoc
Normal file
22
docs/doc_examples/a5a7050fb9dcb9574e081957ade28617.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.deleteByQuery({
|
||||||
|
index: 'twitter',
|
||||||
|
refresh: true,
|
||||||
|
slices: '5',
|
||||||
|
body: {
|
||||||
|
query: {
|
||||||
|
range: {
|
||||||
|
likes: {
|
||||||
|
lt: 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
20
docs/doc_examples/abf329ebefaf58acd4ee30e685731499.asciidoc
Normal file
20
docs/doc_examples/abf329ebefaf58acd4ee30e685731499.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: 'index_double',
|
||||||
|
body: {
|
||||||
|
mappings: {
|
||||||
|
properties: {
|
||||||
|
field: {
|
||||||
|
type: 'double'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
33
docs/doc_examples/ae9b5fbd42af2386ffbf56ad4a697e51.asciidoc
Normal file
33
docs/doc_examples/ae9b5fbd42af2386ffbf56ad4a697e51.asciidoc
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// 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',
|
||||||
|
body: {
|
||||||
|
sort: [
|
||||||
|
{
|
||||||
|
post_date: {
|
||||||
|
order: 'asc'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'user',
|
||||||
|
{
|
||||||
|
name: 'desc'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
age: 'desc'
|
||||||
|
},
|
||||||
|
'_score'
|
||||||
|
],
|
||||||
|
query: {
|
||||||
|
term: {
|
||||||
|
user: 'kimchy'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
29
docs/doc_examples/b214942b938e47f2c486e523546cb574.asciidoc
Normal file
29
docs/doc_examples/b214942b938e47f2c486e523546cb574.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({
|
||||||
|
index: 'my_index',
|
||||||
|
body: {
|
||||||
|
query: {
|
||||||
|
bool: {
|
||||||
|
must: [
|
||||||
|
{
|
||||||
|
match: {
|
||||||
|
'user.first': 'Alice'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
match: {
|
||||||
|
'user.last': 'Smith'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
102
docs/doc_examples/b919f88e6f47a40d5793479440a90ba6.asciidoc
Normal file
102
docs/doc_examples/b919f88e6f47a40d5793479440a90ba6.asciidoc
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
// 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.create({
|
||||||
|
index: 'my_index',
|
||||||
|
body: {
|
||||||
|
mappings: {
|
||||||
|
properties: {
|
||||||
|
user: {
|
||||||
|
type: 'nested'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response0)
|
||||||
|
|
||||||
|
const response1 = await client.index({
|
||||||
|
index: 'my_index',
|
||||||
|
id: '1',
|
||||||
|
body: {
|
||||||
|
group: 'fans',
|
||||||
|
user: [
|
||||||
|
{
|
||||||
|
first: 'John',
|
||||||
|
last: 'Smith'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
first: 'Alice',
|
||||||
|
last: 'White'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response1)
|
||||||
|
|
||||||
|
const response2 = await client.search({
|
||||||
|
index: 'my_index',
|
||||||
|
body: {
|
||||||
|
query: {
|
||||||
|
nested: {
|
||||||
|
path: 'user',
|
||||||
|
query: {
|
||||||
|
bool: {
|
||||||
|
must: [
|
||||||
|
{
|
||||||
|
match: {
|
||||||
|
'user.first': 'Alice'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
match: {
|
||||||
|
'user.last': 'Smith'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response2)
|
||||||
|
|
||||||
|
const response3 = await client.search({
|
||||||
|
index: 'my_index',
|
||||||
|
body: {
|
||||||
|
query: {
|
||||||
|
nested: {
|
||||||
|
path: 'user',
|
||||||
|
query: {
|
||||||
|
bool: {
|
||||||
|
must: [
|
||||||
|
{
|
||||||
|
match: {
|
||||||
|
'user.first': 'Alice'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
match: {
|
||||||
|
'user.last': 'White'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
inner_hits: {
|
||||||
|
highlight: {
|
||||||
|
fields: {
|
||||||
|
'user.first': {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response3)
|
||||||
|
----
|
||||||
|
|
||||||
39
docs/doc_examples/b997885974522ef439d5e345924cc5ba.asciidoc
Normal file
39
docs/doc_examples/b997885974522ef439d5e345924cc5ba.asciidoc
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
// 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: 'my_index',
|
||||||
|
id: '1',
|
||||||
|
refresh: true,
|
||||||
|
body: {
|
||||||
|
product: 'chocolate',
|
||||||
|
price: [
|
||||||
|
20,
|
||||||
|
4
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response0)
|
||||||
|
|
||||||
|
const response1 = await client.search({
|
||||||
|
body: {
|
||||||
|
query: {
|
||||||
|
term: {
|
||||||
|
product: 'chocolate'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sort: [
|
||||||
|
{
|
||||||
|
price: {
|
||||||
|
order: 'asc',
|
||||||
|
mode: 'avg'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response1)
|
||||||
|
----
|
||||||
|
|
||||||
11
docs/doc_examples/be3a6431d01846950dc1a39a7a6a1faa.asciidoc
Normal file
11
docs/doc_examples/be3a6431d01846950dc1a39a7a6a1faa.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.tasks.get({
|
||||||
|
task_id: 'r1A2WoRbTwKZ516z6NEs5A:36619'
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
16
docs/doc_examples/c22b72c4a52ee098331b3f252c22860d.asciidoc
Normal file
16
docs/doc_examples/c22b72c4a52ee098331b3f252c22860d.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.deleteByQuery({
|
||||||
|
index: 'twitter,blog',
|
||||||
|
body: {
|
||||||
|
query: {
|
||||||
|
match_all: {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
21
docs/doc_examples/c32a3f8071d87f0a3f5a78e07fe7a669.asciidoc
Normal file
21
docs/doc_examples/c32a3f8071d87f0a3f5a78e07fe7a669.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.deleteByQuery({
|
||||||
|
index: 'twitter',
|
||||||
|
routing: '1',
|
||||||
|
body: {
|
||||||
|
query: {
|
||||||
|
range: {
|
||||||
|
age: {
|
||||||
|
gte: 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
32
docs/doc_examples/d17269bb80fb63ec0bf37d219e003dcb.asciidoc
Normal file
32
docs/doc_examples/d17269bb80fb63ec0bf37d219e003dcb.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: {
|
||||||
|
sort: [
|
||||||
|
{
|
||||||
|
_geo_distance: {
|
||||||
|
'pin.location': [
|
||||||
|
-70,
|
||||||
|
40
|
||||||
|
],
|
||||||
|
order: 'asc',
|
||||||
|
unit: 'km',
|
||||||
|
mode: 'min',
|
||||||
|
distance_type: 'arc',
|
||||||
|
ignore_unmapped: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
query: {
|
||||||
|
term: {
|
||||||
|
user: 'kimchy'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
29
docs/doc_examples/d1b3b7d2bb2ab90d15fd10318abd24db.asciidoc
Normal file
29
docs/doc_examples/d1b3b7d2bb2ab90d15fd10318abd24db.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.indices.create({
|
||||||
|
index: 'my_index',
|
||||||
|
body: {
|
||||||
|
mappings: {
|
||||||
|
properties: {
|
||||||
|
post_date: {
|
||||||
|
type: 'date'
|
||||||
|
},
|
||||||
|
user: {
|
||||||
|
type: 'keyword'
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
type: 'keyword'
|
||||||
|
},
|
||||||
|
age: {
|
||||||
|
type: 'integer'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
23
docs/doc_examples/d1bcf2eb63a462bfdcf01a68e68d5b4a.asciidoc
Normal file
23
docs/doc_examples/d1bcf2eb63a462bfdcf01a68e68d5b4a.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({
|
||||||
|
index: 'my_index',
|
||||||
|
pretty: true,
|
||||||
|
body: {
|
||||||
|
query: {
|
||||||
|
terms: {
|
||||||
|
color: {
|
||||||
|
index: 'my_index',
|
||||||
|
id: '2',
|
||||||
|
path: 'color'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
18
docs/doc_examples/d3088d5fa59b3ab110f64fb4f9b0065c.asciidoc
Normal file
18
docs/doc_examples/d3088d5fa59b3ab110f64fb4f9b0065c.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: 'my_index',
|
||||||
|
id: '1',
|
||||||
|
body: {
|
||||||
|
color: [
|
||||||
|
'blue',
|
||||||
|
'green'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
21
docs/doc_examples/d31062ff8c015387889fed4ad86fd914.asciidoc
Normal file
21
docs/doc_examples/d31062ff8c015387889fed4ad86fd914.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: {
|
||||||
|
wildcard: {
|
||||||
|
user: {
|
||||||
|
value: 'ki*y',
|
||||||
|
boost: 1,
|
||||||
|
rewrite: 'constant_score'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
26
docs/doc_examples/d50a3c64890f88af32c6d4ef4899d82a.asciidoc
Normal file
26
docs/doc_examples/d50a3c64890f88af32c6d4ef4899d82a.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.search({
|
||||||
|
body: {
|
||||||
|
sort: [
|
||||||
|
{
|
||||||
|
_geo_distance: {
|
||||||
|
'pin.location': '40,-70',
|
||||||
|
order: 'asc',
|
||||||
|
unit: 'km'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
query: {
|
||||||
|
term: {
|
||||||
|
user: 'kimchy'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
33
docs/doc_examples/de139866a220124360e5e27d1a736ea4.asciidoc
Normal file
33
docs/doc_examples/de139866a220124360e5e27d1a736ea4.asciidoc
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// 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: {
|
||||||
|
product: 'chocolate'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sort: [
|
||||||
|
{
|
||||||
|
'offer.price': {
|
||||||
|
mode: 'avg',
|
||||||
|
order: 'asc',
|
||||||
|
nested: {
|
||||||
|
path: 'offer',
|
||||||
|
filter: {
|
||||||
|
term: {
|
||||||
|
'offer.color': 'blue'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
19
docs/doc_examples/dfb1fe96d806a644214d06f9b4b87878.asciidoc
Normal file
19
docs/doc_examples/dfb1fe96d806a644214d06f9b4b87878.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.deleteByQuery({
|
||||||
|
index: 'twitter',
|
||||||
|
scroll_size: '5000',
|
||||||
|
body: {
|
||||||
|
query: {
|
||||||
|
term: {
|
||||||
|
user: 'kimchy'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
17
docs/doc_examples/e21e1c26dc8687e7bf7bd2bf019a6698.asciidoc
Normal file
17
docs/doc_examples/e21e1c26dc8687e7bf7bd2bf019a6698.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.deleteByQuery({
|
||||||
|
index: 'twitter',
|
||||||
|
conflicts: 'proceed',
|
||||||
|
body: {
|
||||||
|
query: {
|
||||||
|
match_all: {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
31
docs/doc_examples/e8e451bc8c45bcf16df43804c4fc8329.asciidoc
Normal file
31
docs/doc_examples/e8e451bc8c45bcf16df43804c4fc8329.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.search({
|
||||||
|
body: {
|
||||||
|
track_scores: true,
|
||||||
|
sort: [
|
||||||
|
{
|
||||||
|
post_date: {
|
||||||
|
order: 'desc'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'desc'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
age: 'desc'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
query: {
|
||||||
|
term: {
|
||||||
|
user: 'kimchy'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
18
docs/doc_examples/ebb6b59fbc9325c17e45f524602d6be2.asciidoc
Normal file
18
docs/doc_examples/ebb6b59fbc9325c17e45f524602d6be2.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.deleteByQuery({
|
||||||
|
index: 'twitter',
|
||||||
|
body: {
|
||||||
|
query: {
|
||||||
|
match: {
|
||||||
|
message: 'some message'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
24
docs/doc_examples/ef0f4fa4272c47ff62fb7b422cf975e7.asciidoc
Normal file
24
docs/doc_examples/ef0f4fa4272c47ff62fb7b422cf975e7.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: {
|
||||||
|
sort: [
|
||||||
|
{
|
||||||
|
price: {
|
||||||
|
missing: '_last'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
query: {
|
||||||
|
term: {
|
||||||
|
product: 'chocolate'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
20
docs/doc_examples/f4a1008b3f9baa67bb03ce9ef5ab4cb4.asciidoc
Normal file
20
docs/doc_examples/f4a1008b3f9baa67bb03ce9ef5ab4cb4.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: 'index_double',
|
||||||
|
body: {
|
||||||
|
mappings: {
|
||||||
|
properties: {
|
||||||
|
field: {
|
||||||
|
type: 'date'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
20
docs/doc_examples/f6b5032bf27c2445d28845be0d413970.asciidoc
Normal file
20
docs/doc_examples/f6b5032bf27c2445d28845be0d413970.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: 'index_long',
|
||||||
|
body: {
|
||||||
|
mappings: {
|
||||||
|
properties: {
|
||||||
|
field: {
|
||||||
|
type: 'long'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(response)
|
||||||
|
----
|
||||||
|
|
||||||
@ -54,7 +54,14 @@ const enabledFiles = [
|
|||||||
'query-dsl/term-query.asciidoc',
|
'query-dsl/term-query.asciidoc',
|
||||||
'docs/update.asciidoc',
|
'docs/update.asciidoc',
|
||||||
'docs/reindex.asciidoc',
|
'docs/reindex.asciidoc',
|
||||||
'indices/templates.asciidoc'
|
'indices/templates.asciidoc',
|
||||||
|
'query-dsl/exists-query.asciidoc',
|
||||||
|
'query-dsl/terms-query.asciidoc',
|
||||||
|
'query-dsl/wildcard-query.asciidoc',
|
||||||
|
'mapping/types/nested.asciidoc',
|
||||||
|
'mapping/params/format.asciidoc',
|
||||||
|
'docs/delete-by-query.asciidoc',
|
||||||
|
'search/request/sort.asciidoc'
|
||||||
]
|
]
|
||||||
|
|
||||||
function generate () {
|
function generate () {
|
||||||
|
|||||||
Reference in New Issue
Block a user