elasticsearch - 弹性查询 DSL 不会在 JSON 字段中搜索方括号
问题描述
我正在尝试在名为 "print_response_message" 的列之一中查询具有 json 响应的索引。
返回的该列的示例值如下 2 条记录所示。
print_response_message
myTestResponse string is : {
"orderPrintResponses" : [
{
"status" : "SUCCESS",
"responseCode" : "200",
"responseMessage" : "Documents printed",
"groupId" : "CONFIRMATION",
"orderItemResponses" : [ {
"status" : "SUCCESS",
"responseCode" : "200",
"responseMessage" : "Documents printed successfully",
"printDocumentMappingArray" : [ {
"pID" : "01.01",
"documentNumbers" : [ ]
}]
} ]
} ]
}
myTestResponse string is : {
"orderPrintResponses" : [
{
"status" : "SUCCESS",
"responseCode" : "200",
"responseMessage" : "Documents printed",
"groupId" : "CONFIRMATION",
"orderItemResponses" : [ {
"status" : "SUCCESS",
"responseCode" : "200",
"responseMessage" : "Documents printed successfully",
"printDocumentMappingArray" : [ {
"pID" : "01.01",
"documentNumbers" : [ "123456789" ]
}]
} ]
} ]
}
我只想检索文档编号数组为空的响应,在我上面分享的示例中,第一个是因为它具有 "documentNumbers" : [ ] 。
我尝试了几种方法,包括匹配器、术语,但都没有奏效。
有人可以帮我解决这个问题吗?非常感谢您的帮助。再次感谢
我什至尝试转义 [] , : 等,但它们都没有奏效。它不断检索第二个值而不是第一个值。我几乎花了 2 天时间,但无法获得正确的查询来执行此操作。
我希望 print_response_message 的 json 包含“documentNumbers”:[]
解决方案
推荐阅读
- java - com.sun.proxy.$Proxy439 无法转换为 DDLRecordSetLocalService
- javascript - Mapbox LngLat 对象
- asp.net - 我怎样才能获得数据表的价值呢?当我点击更新。我也想更新我的文本框,但我的数据表只更新
- python - 为什么在 python tkinter exe 中退出命令有时不退出?
- python - 训练独立的目标检测模型
- javascript - TypeError:无法读取未定义的属性'refs' - Next.js App & React
- reactjs - npm 错误!在“...sqk3urlRSf0SyulYvOMeZ”附近解析时 JSON 输入意外结束
- swift - 在 Swift 的可重用类中调用不同的函数
- c# - 如何在 ASP.NET Core 2.2 项目中增加或设置上传媒体文件大小无限制
- java - 如何在android中加载图像时将调色板加载为cardView背景?