【问题标题】:Like query in AWS Elasticsearch类似 AWS Elasticsearch 中的查询
【发布时间】:2019-12-11 01:39:45
【问题描述】:

我想在 Elasticsearch 中使用类似查询。任何人都可以帮助我提供一些示例代码,其中包括查询模式

在查询中使用了通配符,但它不起作用

{
    "query": {
        "bool": {
            "must": {
                "multi_match": {
                    "query": {
                        wildcard : {
                            "title": "searchquery*",
                            "description": "searchquery*"
                        }
                    }
                    "fields": ["title", "description"]
                }
            },
        }
    }
}

【问题讨论】:

标签: amazon-web-services elasticsearch


【解决方案1】:

试试这个:

{
  "query": {
    "bool": {
      "must": [
         {"match_phrase": {"title":  "searchquery*"}},
         {"match_phrase": {"description":  "searchquery*"}}
      ]
    }
 }
}

【讨论】:

    猜你喜欢
    • 2021-07-01
    • 1970-01-01
    • 2016-10-27
    • 1970-01-01
    • 2018-02-10
    • 2021-10-18
    • 1970-01-01
    • 1970-01-01
    • 2018-08-04
    相关资源
    最近更新 更多