英文:
How to comment on an Elasticsearch index mapping?
问题
There is no direct translation needed for code-related phrases. Here's the translation of the non-code part:
"在我创建一个供更大团队使用的索引时,我需要记录基本信息,如日期、时间、作者、范围等。
除了过于显眼的索引名称之外,是否有可以使用的注释字段?"
英文:
As I create an index used by a larger team, I need to document basics like the date, time, author, scope, etc.
Is there a comment field I can use besides the too-exposed index name?
答案1
得分: 1
你可以使用映射中的 _meta
字段 来添加适合你的索引的自定义信息。
PUT my-index-000001
{
"_mappings": {
"_meta": {
"date": "2023-05-17",
"time": "10:12",
"author": "John Doe",
"scope": "Development"
}
}
}
可以使用更新映射 API 在现有类型上更新 _meta
字段:
PUT my-index-000001/_mapping
{
"_meta": {
"date": "2023-05-18",
"time": "23:10",
"author": "Jane Doe",
"scope": "Quality"
}
}
英文:
You can use the _meta
field in the mapping to add any custom information that suits your index.
PUT my-index-000001
{
"mappings": {
"_meta": {
"date": "2023-05-17",
"time": "10:12",
"author": "John Doe",
"scope": "Development"
}
}
}
The _meta
field can be updated on an existing type using the update mapping API:
PUT my-index-000001/_mapping
{
"_meta": {
"date": "2023-05-18",
"time": "23:10",
"author": "Jane Doe",
"scope": "Quality"
}
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论