2017-06-13 9 views
0

私は次のように複数のオプションを試してみましたが、IPデータ型にテキスト/文字列フィールドを変更する方法を松することはできませんでした。私はこれが原因のネストにある推測していますが、私は1elasticsearchダイナミックテンプレート

curl -XPUT localhost:9200/_template/clee-new-* -d '{ 
"template": "clee-new-*", 
"mappings": { 
    "clee-new": { 
     "_all": { 
      "enabled": true 
     }, 
     "dynamic_templates": [ 
      { 
       "string_fields": { 
        "match": "ipAddress*", 
        "match_mapping_type": "nested", 
        "mapping": { 
         "index": "not_analyzed", 
         "type": "ip" 
        } 
       } 
      } 
     ] 
    } 
} 
}' 

curl -XPUT localhost:9200/_template/clee-new-* -d '{ 
"template": "clee-new-*", 
"mappings": { 
    "clee-new": { 
     "_all": { 
      "enabled": true 
     }, 
     "dynamic_templates": [ 
      { 
       "string_fields": { 
        "match": "ipAddress.bytes", 
        "match_mapping_type": "string", 
        "mapping": { 
         "index": "not_analyzed", 
         "type": "ip" 
        } 
       } 
      } 
     ] 
    } 
} 
}' 

答えて

0

を構築する方法がわから動的テンプレートに新しいですし、ではない、これはpath_matchで

curl -XPUT localhost:9200/_template/clee-new -d '{ 
"template": "clee-new-*", 
"mappings": { 
    "_default_": { 
     "_all": { 
      "enabled": true 
     }, 
     "dynamic_templates": [ 
      { 
       "string_fields": { 
        "path_match": "ipAddress.*", 
        "match_mapping_type": "*", 
        "mapping": { 
         "index": "not_analyzed", 
         "type": "ip" 
        } 
       } 
      } 
     ] 
    } 
} 
}' 
を動作するようになりました
関連する問題