(cherry picked from commit f737290d10)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
33 lines
683 B
Plaintext
33 lines
683 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",
|
|
settings: {
|
|
analysis: {
|
|
analyzer: {
|
|
my_analyzer: {
|
|
tokenizer: "my_tokenizer",
|
|
},
|
|
},
|
|
tokenizer: {
|
|
my_tokenizer: {
|
|
type: "simple_pattern",
|
|
pattern: "[0123456789]{3}",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
console.log(response);
|
|
|
|
const response1 = await client.indices.analyze({
|
|
index: "my-index-000001",
|
|
analyzer: "my_analyzer",
|
|
text: "fd-786-335-514-x",
|
|
});
|
|
console.log(response1);
|
|
----
|