如何在 Elasticsearch 中准确找到带有数组字段的短语?

How can I find exactly phrase with an array field in Elasticsearch?

我的索引字段 singers 映射如下:

"singers": {
    "type": "string",
    "index_name": "singer",
    "analyzer": "unicode_analyzer"
}

示例数据如:

"singers": [
    "Đàm Vĩnh Hưng",
    "Thanh Lam (NSƯT)"
]

现在我想查找索引中是否包含准确的歌手姓名“Đàm Vĩnh Hưng”,我该怎么做?

目前,我试过:

{
   "query": {
      "terms": {
         "singers": [
            "Đàm Vĩnh Hưng"
         ]
      }
   }
}

但是结果是空的

欢迎任何建议。谢谢大家。

经过尝试,我在使用 match_phrase 时解决了这个问题。我会为遇到同样问题的任何人保留这个。请关闭这个。谢谢。

使用match_phrase.

{
   "query": {
      "match_phrase": {
         "singers": "Đàm Vĩnh Hưng"
      }
   }
}