Files
elasticsearch-js/docs/doc_examples/397bdb40d0146102f1f4c6a35675e16a.asciidoc
2024-07-29 17:10:05 -05:00

58 lines
1.0 KiB
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: "index",
settings: {
analysis: {
analyzer: {
english_exact: {
tokenizer: "standard",
filter: ["lowercase"],
},
},
},
},
mappings: {
properties: {
body: {
type: "text",
analyzer: "english",
fields: {
exact: {
type: "text",
analyzer: "english_exact",
},
},
},
},
},
});
console.log(response);
const response1 = await client.index({
index: "index",
id: 1,
document: {
body: "Ski resort",
},
});
console.log(response1);
const response2 = await client.index({
index: "index",
id: 2,
document: {
body: "A pair of skis",
},
});
console.log(response2);
const response3 = await client.indices.refresh({
index: "index",
});
console.log(response3);
----