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

38 lines
714 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: "my-index-000001",
mappings: {
properties: {
names: {
type: "text",
position_increment_gap: 0,
},
},
},
});
console.log(response);
const response1 = await client.index({
index: "my-index-000001",
id: 1,
document: {
names: ["John Abraham", "Lincoln Smith"],
},
});
console.log(response1);
const response2 = await client.search({
index: "my-index-000001",
query: {
match_phrase: {
names: "Abraham Lincoln",
},
},
});
console.log(response2);
----