44 lines
899 B
Plaintext
44 lines
899 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: {
|
|
std_folded: {
|
|
type: "custom",
|
|
tokenizer: "standard",
|
|
filter: ["lowercase", "asciifolding"],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
mappings: {
|
|
properties: {
|
|
my_text: {
|
|
type: "text",
|
|
analyzer: "std_folded",
|
|
},
|
|
},
|
|
},
|
|
});
|
|
console.log(response);
|
|
|
|
const response1 = await client.indices.analyze({
|
|
index: "my-index-000001",
|
|
analyzer: "std_folded",
|
|
text: "Is this déjà vu?",
|
|
});
|
|
console.log(response1);
|
|
|
|
const response2 = await client.indices.analyze({
|
|
index: "my-index-000001",
|
|
field: "my_text",
|
|
text: "Is this déjà vu?",
|
|
});
|
|
console.log(response2);
|
|
----
|