使用Elasticsearch节点客户端搜索案例不敏感的通配符搜索

发布于 2025-02-06 03:29:25 字数 659 浏览 2 评论 0原文

我正在使用Node Client使用Elasticsearch版本7.17.0,并且正在尝试执行通配符搜索这样的搜索:

const query: QueryDslQueryContainer = {
      wildcard: {
        'fieldName.wildcard': '*ing',
        case_insensitive: 'true',
      },
    }

我收到错误

ResponseError: parsing_exception: [parsing_exception] Reason: [wildcard] query doesn't support multiple fields, found [fieldName.wildcard] and [case_insensitive]

文档表示在版本7.10.0中添加了案例不敏感的通配符搜索。不确定如何获取不敏感的通配符查询。

I'm using Elasticsearch version 7.17.0 with node client and am trying to execute a wildcard search like so:

const query: QueryDslQueryContainer = {
      wildcard: {
        'fieldName.wildcard': '*ing',
        case_insensitive: 'true',
      },
    }

I receive the error

ResponseError: parsing_exception: [parsing_exception] Reason: [wildcard] query doesn't support multiple fields, found [fieldName.wildcard] and [case_insensitive]

The documentation indicates that case-insensitive wildcard search was added in version 7.10.0. Not sure how to get case-insensitive wildcard queries.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

可是我不能没有你 2025-02-13 03:29:25

我相信您的查询是错误的。

这样尝试:

{
  "query": {
    "wildcard": {
      "field_name": {
        "value": "VALUE",
        "case_insensitive": true
      }
    }
  }
}

I believe that you query is wrong.

Try like this:

{
  "query": {
    "wildcard": {
      "field_name": {
        "value": "VALUE",
        "case_insensitive": true
      }
    }
  }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文