gpt4 book ai didi

ElasticSearch/Lucene 查询字符串 — 选择 "field X exists"

转载 作者:行者123 更新时间:2023-12-01 20:14:25 24 4
gpt4 key购买 nike

如何通过 Kibana 查询 ElasticSearch 以选择具有字段 X 的项目?

例如,我有一个包含字段 {"a": {"type": "string"}, "b": {"type": "string"}} 的映射,以及两个文档

{"a": "lalala"}
{"a": "enoheo", "b": "nthtnhnt"}

我想找到第二个文档,但不知道它的 b 实际上是什么。

最佳答案

距离给出这些答案已有一段时间了。如果有人需要更新的答案,文档现在提供了选择具有特定字段的结果的示例。

在查询字符串语法中:

where the field title has any non-null value:

_exists_:title

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_field_names

关于ElasticSearch/Lucene 查询字符串 — 选择 "field X exists",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30216956/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com