2016-05-14 9 views
0

私は修了者を作っています。インデックス化されたドキュメントのいくつかの重みを増分して増分したいと思います。私が持っている:補完候補フィールドの重みを増やすにはどうすればよいですか?

POST /tester/ 
{ 
     "mappings": { 
      "song": { 
      "properties": { 
       "suggest": { 
       "type": "completion", 
       "analyzer": "simple", 
       "search_analyzer" : "simple", 
       "payloads": true, 
       "preserve_separators": true, 
       "preserve_position_increments": true, 
       "max_input_length": 100 
       } 
      } 
      } 
     } 
     } 

//インデックスのdoc

PUT tester/song/1 
{ 
    "name" : "Nevermind", 
    "suggest" : { 
     "input": [ "Nevermind", "Nirvana" ], 
     "output": "Nirvana - Nevermind", 
     "payload" : { "artistId" : 2321 }, 
     "weight" : 1 
    } 
} 

//重量をインクリメント

POST /tester/song/1 
{ 
    "script" : { 
     "inline": "ctx._source.suggest.weight += 1" 
    } 
} 

// GET /テスターの結果

{ 
     "_index": "tester", 
     "_type": "song", 
     "_id": "1", 
     "_score": 1, 
     "_source": { 
      "script": { 
      "inline": "ctx._source.suggest.weight += 1" 
      } 
     } 
     } 

むしろそれを増やすよりも、文書を書き換えます。私はここで間違って何をしていますか?お使いの設定に以下の行を追加することによって、まず

答えて