繁体   English   中英

在浏览器中使用Elasticsearch REST API:如何做和操作

[英]Using Elasticsearch REST API with Browser: how to do AND operation

我想知道如何使用localhost:9200上的浏览器搜索2个key:value对

例如:要组合country = CAN AND brand = V

_source": {

    "country": "CAN",
    "brand": "V",
    "leadID": 10333,
    "datetime": 1442247315000

}
... and so on

我在将“ default_operator”设置为AND的情况下尝试了此uri:

http://localhost:9200/_search?default_operator=AND&q=country:CAN&q=brand:V

在响应中,我得到了country = CAN和brand = V,但是我也得到了country = PRT和brand = V。 因此它执行了OR运算而不是AND运算。

试试这个http://localhost:9200/_search?default_operator=AND&q=country:CAN AND brand:V

您的浏览器会将其转换为http://localhost:9200/_search?default_operator=AND&q=country:CAN%20AND%20brand:V

这意味着您将两个条件组合为一个: q=country:CAN AND brand:V

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM