How could I have MySQL IN clause within my elasticsearch query?(如何在我的 elasticsearch 查询中使用 MySQL IN 子句?)
问题描述
我正在尝试将 elasticsearch
查询作为 GET
请求执行,以便从我创建的索引中提取数据.索引中的数据是一个来自MySQL
DB的表,通过logstash
配置.
I'm trying perform an elasticsearch
query as a GET
request in order pull data from the index which I created. The data which is in the index is, a table from MySQL
DB, configured though logstash
.
这是我没有 IN 子句的请求:
Here is my request without the IN clause:
http://localhost:9200/response_summary/_search?q=api:"location"+AND+transactionoperationstatus:"charged"+AND+operatorid='DIALOG'+AND+userid:test+AND+time:"2015-05-27"
在上面,我应该能够附加AND responseCode IN (401,403)
.我尝试在网上搜索它,但找不到任何解决方案.
In the above, I should be able to append AND responseCode IN (401,403)
. I tried giving it a search on the web, but couldn't find any solutions.
可以提供任何帮助.
推荐答案
只需添加其中一个:
responseCode:(401 403)
responseCode:(401 OR 403)
responseCode:(401 || 403)
像这样:
http://localhost:9200/response_summary/_search?q=api:"location"+AND+transactionoperationstatus:"charged"+AND+operatorid='DIALOG'+AND+userid:test+AND+time:"2015-05-27"+AND+responseCode:(401+403)
这篇关于如何在我的 elasticsearch 查询中使用 MySQL IN 子句?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在我的 elasticsearch 查询中使用 MySQL IN 子句?


- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- SQL 临时表问题 2022-01-01