(cherry picked from commit f737290d10)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
39 lines
723 B
Plaintext
39 lines
723 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: {
|
|
my_wildcard: {
|
|
type: "wildcard",
|
|
},
|
|
},
|
|
},
|
|
});
|
|
console.log(response);
|
|
|
|
const response1 = await client.index({
|
|
index: "my-index-000001",
|
|
id: 1,
|
|
document: {
|
|
my_wildcard: "This string can be quite lengthy",
|
|
},
|
|
});
|
|
console.log(response1);
|
|
|
|
const response2 = await client.search({
|
|
index: "my-index-000001",
|
|
query: {
|
|
wildcard: {
|
|
my_wildcard: {
|
|
value: "*quite*lengthy",
|
|
},
|
|
},
|
|
},
|
|
});
|
|
console.log(response2);
|
|
----
|