50 lines
826 B
Plaintext
50 lines
826 B
Plaintext
// 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: "new_index",
|
|
mappings: {
|
|
properties: {
|
|
query: {
|
|
type: "percolator",
|
|
},
|
|
body: {
|
|
type: "text",
|
|
},
|
|
},
|
|
},
|
|
});
|
|
console.log(response);
|
|
|
|
const response1 = await client.reindex({
|
|
refresh: "true",
|
|
source: {
|
|
index: "index",
|
|
},
|
|
dest: {
|
|
index: "new_index",
|
|
},
|
|
});
|
|
console.log(response1);
|
|
|
|
const response2 = await client.indices.updateAliases({
|
|
actions: [
|
|
{
|
|
remove: {
|
|
index: "index",
|
|
alias: "queries",
|
|
},
|
|
},
|
|
{
|
|
add: {
|
|
index: "new_index",
|
|
alias: "queries",
|
|
},
|
|
},
|
|
],
|
|
});
|
|
console.log(response2);
|
|
----
|