2017-03-28 7 views
0

私は、弾性のネストされたフィールドでスクリプト集約を実行しようとしています。合併症は、自分のフィールドがマッピングに全く含まれていないということです。マッピングは次のとおりです。マッピングされていないフィールドのネストされた集約

{ 
    "my_index": { 
     "my_type": { 
      "properties": { 
       "Fields": { 
        "type": "nested", 
        "dynamic": "false", 
        "properties": { 
         "fieldname": { 
          "type": "string", 
          "index": "not_analyzed" 
         }, 
         "filtered": { 
          "type": "string", 
          "analyzer": "keyword" 
         }, 
         "index": { 
          "type": "integer" 
         }, 
         "policy": { 
          "type": "string", 
          "index": "not_analyzed" 
         }, 
         "profile": { 
          "type": "boolean" 
         }, 
         "result": { 
          "type": "integer" 
         }, 
         "type": { 
          "type": "string", 
          "index": "not_analyzed" 
         }, 
         "uri": { 
          "type": "string", 
          "index": "not_analyzed" 
         } 
        } 
       } 
      } 
     } 
    } 
} 

そして私は、ネストされた集計のための結果を得るていないしかし、私は

POST my_index/my_type/_search 
{ 
    "size": 0, 
    "aggs": { 
     "fields": { 
      "nested": { 
       "path": "Fields" 
      }, 
      "aggs": { 
       "distinct_content": { 
        "terms": { 
         "field": "Fields.content" 
        } 
       } 
      } 
     } 
    } 
} 

を行っており、集計クエリ。私はscripted_metric集約を使用してみましたが、私はまだコンテンツフィールドにアクセスできないようです。マッピングされていないフィールドにはアクセスできますか?

答えて

0

ダイナミックマッピングを無効にしたため、検索または集計によってこのフィールドにアクセスすることはできません。このdocumentation siteのボトムノートを参照してください(これは一般的なマッピングノートですが、ネストされたオブジェクトにも適用可能です)。

しかし、PUT mapping APIで簡単にマッピングを拡張して再インデックスすることができます。アクセス可能である必要があります。

関連する問題