如何从job_name
搜索ES文档?
这就是文档的样子:
{"_index":"deedloadjobstatus","_type":"DeedExtract","_id":"AVX0UkVKNGSyAbnrJkor","_score":1.0,
"_source":{"luigi_task_name": "DeedExtract", "job_name": "DeedDowloader2", "successful": 1,
"start_time": "2016-07-16T20:59:21.000Z", "error_message": null, "month": 7, "end_time": "2016-07-16T20:59:21.000Z",
"monthname": "Jul", "year": 2016, "runtime": 0,
"all_params": {"job_name": "DeedDowloader2", "run_date": "2016-07-15"},
"@timestamp": "2016-07-16T20:59:21.000Z", "day": 16}}
我尝试过以下但无法找到。
host:port_number/deedloadjobstatus/_search?jobname:DeedDowloader2
答案 0 :(得分:0)
您的解决方案应该有效。我想你只是忘记了下划线。 ( job_name 而非作业名)
如果需要,可以使用术语查询:
{
"query": {
"term": {
"job_name": "DeedDowloader2"
}
}
}
阅读本文:https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html