62 lines
1.0 KiB
Plaintext
62 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.putMapping({
|
|
index: "cooking_blog",
|
|
properties: {
|
|
title: {
|
|
type: "text",
|
|
analyzer: "standard",
|
|
fields: {
|
|
keyword: {
|
|
type: "keyword",
|
|
ignore_above: 256,
|
|
},
|
|
},
|
|
},
|
|
description: {
|
|
type: "text",
|
|
fields: {
|
|
keyword: {
|
|
type: "keyword",
|
|
},
|
|
},
|
|
},
|
|
author: {
|
|
type: "text",
|
|
fields: {
|
|
keyword: {
|
|
type: "keyword",
|
|
},
|
|
},
|
|
},
|
|
date: {
|
|
type: "date",
|
|
format: "yyyy-MM-dd",
|
|
},
|
|
category: {
|
|
type: "text",
|
|
fields: {
|
|
keyword: {
|
|
type: "keyword",
|
|
},
|
|
},
|
|
},
|
|
tags: {
|
|
type: "text",
|
|
fields: {
|
|
keyword: {
|
|
type: "keyword",
|
|
},
|
|
},
|
|
},
|
|
rating: {
|
|
type: "float",
|
|
},
|
|
},
|
|
});
|
|
console.log(response);
|
|
----
|