0
我我的PHP MySQL的应用程序转换为Elasticsearch, 这里是我的PHP MySQL查询以及如何这个查询写入Elasticseach(5.5版)怎么办我写的MySQL不同的查询Elasticesearch
我试着写聚集,但结果数量从旧版本的MySQL结果数量不匹配。
SELECT COUNT(DISTINCT offerName, `OfferID`, `duration`, `price`, `numChannels`, providerName) AS "totalRecords" FROM `video` WHERE `active` = 'Y'
这里是我的Elasticsearch查询:
{
"size": 0,
"query":
{ "bool": {
"should": [
{ "match": { "active": "Y" }}
]
}
},
"aggs": {
"count_by_OfferID": {
"terms": {
"field": "offerID"
}
},
"count_by_offerName":{
"terms": {
"field": "offerName"
}
},
"count_by_duration":{
"terms": {
"field": "duration"
}
},
"count_by_price":{
"terms": {
"field": "price"
}
},
"count_by_downloadSpeed":{
"terms": {
"field": "downloadSpeed"
}
},
"count_by_numChannels":{
"terms": {
"field": "numChannels"
}
},
"count_by_providerName":{
"terms": {
"field": "providerName"
}
}
}
}
发表您的聚集请 – aclokay
你能在这里发表您elasticQuery? – sourabh1024
我有更新我的elasticsearch查询时,请检查一下,这写查询方式ES获得不同的值,或者是有任何其他方式? –