如何获取`dynamic_date_format`以及其他映射Elasticsearch设置的值。

huangapple go评论69阅读模式
英文:

How to get the value of `dynamic_date_format` and other mapping Elasticsearch settings

问题

New to Elasticsearch, and we are wondering how to check the current value of dynamic_date_formats.

The official online document, here, provides the below example of setting customized value, but we did not find how to get its value. Either an API call or a sample URL command will help.

Also, we are looking into the other arguments of the mapping settings, e.g., the Mapping limit settings, including index.mapping.total_fields.limit and others. So, we wonder how to check the values of these arguments as well.

We highly appreciate any hints and suggestions.

英文:

New to Elasticsearch, and we are wondering how to check the current value of dynamic_date_formats.

The official online document, here, provides the below example of setting customized value, but we did not find how to get its value. Either an API call or a sample URL command will help.

PUT my-index-000001
{
  "mappings": {
    "dynamic_date_formats": ["MM/dd/yyyy"]
  }
}

Also, we are looking into the other arguments of the mapping settings, e.g., the Mapping limit settings, including index.mapping.total_fields.limit and others. So, we wonder how to check the values of these arguments as well.

We highly appreciate any hints and suggestions.

答案1

得分: 1

你可以使用以下命令从索引中检索index.mapping.total_fields.limit或任何其他设置:

GET index/_settings?include_defaults=true&filter_path=**.total_fields

关于dynamic_date_formats,如果在创建索引时指定了它,可以使用以下命令检索该值:

GET test/_mapping?filter_path=**.dynamic_date_formats

或者如果没有指定,默认值如下,你可以硬编码到你的逻辑中:

[ "strict_date_optional_time","yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"]
英文:

You can retrieve the index.mapping.total_fields.limit or any other settings from an index using the command below:

GET index/_settings?include_defaults=true&filter_path=**.total_fields

Regarding dynamic_date_formats, either you have specified it when creating your index and you can retrieve the value using the command below:

GET test/_mapping?filter_path=**.dynamic_date_formats

Or you haven't specified it and the default value is the following that you can hardcode into your logic

[ "strict_date_optional_time","yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"]

huangapple
  • 本文由 发表于 2023年6月29日 23:36:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/76582581.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定