elasticsearch 对groupby的elasticsearch查询,条件给出意外结果,elasticsearch,logstash,elasticsearch,Logstash" /> elasticsearch 对groupby的elasticsearch查询,条件给出意外结果,elasticsearch,logstash,elasticsearch,Logstash" />

elasticsearch 对groupby的elasticsearch查询,条件给出意外结果

elasticsearch 对groupby的elasticsearch查询,条件给出意外结果,elasticsearch,logstash,elasticsearch,Logstash,我使用的是elasticsearch 1.3,我试图通过计数获得每种业务流程的groupby。另外,如果我能通过时间戳进一步细分,那就太好了 { "query": { "bool": { "should": [ { "match": { "business_process": "overlimit"

我使用的是elasticsearch 1.3,我试图通过计数获得每种业务流程的groupby。另外,如果我能通过时间戳进一步细分,那就太好了

{
    "query": {
        "bool": {
            "should": [
                {
                    "match": {
                        "business_process": "overlimit"
                    }
                },
                {
                    "match": {
                        "business_process": "proposal"
                    }
                },
                {
                    "match": {
                        "business_process": "overdraft"
                    }
                }
            ]
        }
    },
    "facets": {
        "name_your_facet_here": {
            "terms": {
                "field": "business_process",
                "size": 100000
            }
        }
    }
}

提前感谢。

基于您的不完整问题, 获取
业务流程
价值的计数
[“超限”、“提案”、“透支”]

POST http://localhost:9200/gccount/Customer/_search
{
    "size": 0, 
    "query": {
        "terms": {
           "business_process": [ "overlimit", "proposal", "overdraft"]
        }
    },
    "facets": {
        "name_your_facet_here": {
            "terms": {
                "field": "business_process",
                "size": 100000
            }
        }
    }
}

POST http://localhost:9200/gccount/Customer/_search
{
   "size": 0,
   "query": {
      "filtered": {
         "query": {
            "match_all": {}
         },
         "filter": {
            "terms": {
               "business_process": [ "proposal", "overlimit", "overdraft"]
            }
         }
      }
   },
   "facets": {
      "name_your_facet_here": {
         "terms": {
            "field": "business_process",
            "size": 100000
         }
      }
   }
}
业务流程的映射应为
“索引”:“未分析”


您当前的查询似乎只对第一个匹配项作出响应,即
超限

这不起作用。它只给了我一种类型(超限)的方面,而不是所有的业务processes@Tazo正如我所说,如果您的映射是“索引”:“未分析”在
business\u流程上
,它就可以正常工作。顺便说一句,你能更新你的地图吗。