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 子句?


基础教程推荐
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 在多列上分布任意行 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01