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

47 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: "my-index-000001",
settings: {
analysis: {
analyzer: {
my_custom_analyzer: {
char_filter: ["emoticons"],
tokenizer: "punctuation",
filter: ["lowercase", "english_stop"],
},
},
tokenizer: {
punctuation: {
type: "pattern",
pattern: "[ .,!?]",
},
},
char_filter: {
emoticons: {
type: "mapping",
mappings: [":) => _happy_", ":( => _sad_"],
},
},
filter: {
english_stop: {
type: "stop",
stopwords: "_english_",
},
},
},
},
});
console.log(response);
const response1 = await client.indices.analyze({
index: "my-index-000001",
analyzer: "my_custom_analyzer",
text: "I'm a :) person, and you?",
});
console.log(response1);
----