0

というインデックスfindと というタイプがありsongます。ソングタイプの構造 :

    "_index": "find",
    "_type": "song",
    "_id": "192108",
    "_source": {
      "id": 192108,          
      "artist": "Melanie",
      "title": "Dark Night",
      "lyrics": "Hot air hangs like a dead man\nFrom a white oak tree",
      "downloadCount": 234
    }

複数の曲が同じフィールド値を持つ可能性があるため、downloadCount などの人気フィールドで結果をブーストする必要があります。

以下のクエリを変更して、downloadCount で最適化するにはどうすればよいですか?

GET /search/song/_search
{
  "query": {
      "multi_match": {
          "query": "like a dead hangs",
          "type": "most_fields",
          "fields": ["artist","title","lyrics"],
          "operator": "or"
        }
     }
}
4

2 に答える 2