简体   繁体   English

如何在弹性搜索中为所有未来字段定义映射

[英]How to define mapping for all future field in elastic search

I am using template on elasticsearch 1.1.1 which is creating special mapping at index creation. 我在Elasticsearch 1.1.1上使用模板,该模板在创建索引时创建特殊映射。 My template is as following : 我的模板如下:

{
  "template": "*",
  "mappings": {
    "foo": {
      "properties": {
        "where": {
          "type": "nested",
          "properties": {
            "*": {
              "index": "not_analyzed"
            },
            "geo_point": {
              "type": "geo_point"
            }
          }
        }
      }
    }
  }
}

There will be future fields in the nested object "where". 嵌套对象“ where”中将有将来的字段。 I would like them to not be analyzed to avoid tokenization during a terms Faceting. 我希望不对它们进行分析,以免在术语“构面”中产生标记化。 Unfortunately I do not know the name of this future fields when my index is created. 不幸的是,创建索引后,我不知道此将来字段的名称。

Do you know any way of defining a mapping for any future field in a nested or inner object ? 您是否知道为嵌套或内部对象中的任何将来字段定义映射的任何方法?

Sincerely, 此致

You can use dynamic templates for this, along with the index template that you already posted. 您可以为此使用动态模板以及已发布的索引模板。 Have a look here . 在这里看看。

You can specify patterns that match your fields and have mappings apply to them instead of the usual defaults. 您可以指定与您的字段匹配的模式,并将映射应用于它们,而不是通常的默认值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 更新添加新字段时,弹性搜索不遵循映射 - elastic search does not obey mapping when update adds a new field 弹性搜索未使用logstash中的已定义模板进行映射 - Defined Template from logstash not being used by elastic search for mapping 上传到DocuSIgn之前如何在Word中定义字段 - how to define field in Word before uploading to DocuSIgn 在 Elastic 中搜索过滤器和应该的模板 - Search Template in Elastic for filter and should boost::future::那么它是如何实现的? - boost::future::then how is it implemented? NGINX自定义日志的弹性搜索索引模板 - Elastic Search Index template for NGINX custom log 如何定义一个模板化的 function ,它需要一个 map 和一个 lambda 来按值搜索映射对? - How can I define a templated function which takes a map and a lambda to search map-pair by value? (WordPress)仅在存档和搜索结果中显示将来的帖子 - (Wordpress) Only show future posts in archive & search results 如何定义使用模板类但不具有该类所有参数的模板函数? - How to define a template function that uses a template class, but does not have all the arguments for the class? 在何处/如何定义模板 - Where/how to define a template
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM