2017-03-21 10 views
0

私はそれをしようとどのように私はこれがあるElasticsearch 5.2Elasticsearch 5.2コンテキスト提案者タイプ定義 - エラー

でコンテキスト提案者の定義の問題が生じています:

curl -XPUT 'localhost:9200/world/port/_mapping' -d '{ 
"port": { 

"properties": { 
    "name": { 
     "type": "string" 
    }, 
    "suggest": { 
     "type": "completion", 
     "analyzer": "simple", 
     "payloads": true, 
     "preserve_separators": true, 
     "preserve_position_increments": true, 
     "max_input_length": 50, 
     "contexts": { 
     "type": { 
      "name": "port_type", 
      "type": "category", 
      "path": "name" 
     } 
     } 
    } 
} 

} 
}' 

は、私はパラメータで遊んが、

{ 
"error": 
{ 
"root_cause": 
    [{"type":"parse_exception","reason":"missing [name] in context mapping"}], 
"type":"parse_exception","reason":"missing [name] in context mapping" 
}, 
"status":400 
} 

私はグーグルで解決しようとしましたが、成功しませんでした。

メッセージが参照している名前は何ですか?

私を助けることができますか?ここで

答えて

0

はカップルの瞬間です:

  • contextはその要素がところでちょうどJSON辞書
  • でなければなりませんJSON配列
  • する必要があり、"payload": trueものです - 私はそれができる1つの以上のアイテムであると考えてい不要として排除される。

    curl -XPUT 'localhost:9200/world' -d ' 
    { 
        "mappings" : { 
        "port": { 
         "properties": { 
         "name": { 
          "type": "string" 
         }, 
         "suggest": { 
          "type": "completion", 
          "analyzer": "simple", 
          "preserve_separators": true, 
          "preserve_position_increments": true, 
          "max_input_length": 50, 
          "contexts": [ 
          { 
           "name": "port_type", 
           "type": "category", 
           "path": "name" 
          } 
          ] 
         } 
         } 
        } 
        } 
    }' 
    

ことに、私はそれが次のコマンドで発生作った少し掘った後、

関連する問題