弹性搜索:URI搜索不准确

时间:2015-10-06 13:00:07

标签: search elasticsearch

我在Webbrowser Firefox上搜索以下URI:

  

http://localhost:9200/xyz-leads/lead/_search?q=datetimeHour:22_09_2015__12&&deliveryType:EMAIL

但是我只得到了deliveryType:RVS,而不是EMAIL。

如果我搜索deliveryType:RVS,我会获得3次点击。

我知道RVS有3个结果,EMAIL有0个结果,总共有datetimeHour。

我猜ElasticSearch的标准行为是,忽略第二个搜索值'deliveryType',如果两者都没有结果,则只使用第一个'datetimeHour'。

如果我搜索deliveryType:电子邮件,那么我不想在回复中点击。

我是否需要设置一些额外的ElasticSearch参数?

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-uri-request.html

_source: {
country: "DEU",
brand: "A",
leadGroup: "TEST",
leadID: 108798,
deliveryType: "RVS",
datetime: 1442916913000,
datetimeFormatted: "22.09.2015 12:15:13",
datetimeHour: "22_09_2015__12",
datetimeDay: "22_09_2015"
}

1 个答案:

答案 0 :(得分:2)

查询字符串查询到您的网址(即q=...参数中)需要根据query string query syntax

进行格式化

请尝试使用此功能(即使用AND代替&&

http://localhost:9200/xyz-leads/lead/_search?q=datetimeHour:22_09_2015__12%20AND%20deliveryType:EMAIL
相关问题