我在elasticsearch中有这样的文件:
{
"_index": "4ccda045-3958-4773-bb34-7af26fa52f4e",
"_type": "jira",
"_id": "BIGHALF-23",
"_score": 1,
"_source": {
"Issue Key": "BIGHALF-23",
"Issuetype Name": "Sub-task",
"Project Name": "Big_Half ",
"Project ID": "10500",
"Project Key": "BIGHALF",
"Workratio": -1,
"Watch Count": 1,
"Created": "2015-10-08T13:12:47",
"Priority": "Medium",
"Assignee Name": "german.solis",
"Assignee EmailAddress": "german.solis@bighalf.io",
"Assignee DisplayName": "German Solis",
"Is Assignee Active": "true",
"Assigne TimeZone": "America/Chicago",
"Updated": "2015-10-19T19:21:22",
"Issue Status": "Done",
"sprint": [{
"Sprint ID": "20",
"Sprint State": "CLOSED",
"Sprint Name": "Sprint 11",
"Sprint StartDate": "2015-10-05T01:43:29",
"Sprint EndDate": "2015-10-12T01:43:00",
"Sprint CompleteDate": "2015-10-13T14:31:47"
}, {
"Sprint ID": "23",
"Sprint State": "CLOSED",
"Sprint Name": "Sprint 1",
"Sprint StartDate": "2015-10-19T01:47:18",
"Sprint EndDate": "2015-10-26T01:47:00",
"Sprint CompleteDate": "2015-10-24T23:55:22"
}, {
"Sprint ID": "24",
"Sprint State": "CLOSED",
"Sprint Name": "Sprint 2",
"Sprint StartDate": "2015-10-26T11:21:21",
"Sprint EndDate": "2015-11-01T11:21:00",
"Sprint CompleteDate": "2015-11-01T23:06:45"
}],
"Creator Name": "fernando.velazquez",
"Creator EmailAddress": "fernando.velazquez@bighalf.io",
"Creator DisplayName": "fernando.velazquez",
"Creator Active": "false",
"Creator TimeZone": "America/Chicago",
"Reporter Name": "fernando.velazquez",
"Reporter EmailAddress": "fernando.velazquez@bighalf.io",
"Reporter DisplayName": "fernando.velazquez",
"Reporter Active": "false",
"Reporter TimeZone": "America/Chicago",
"Aggregate Progress": 0,
"Aggregate Progress Total": 0,
"Progress": 0,
"Progress Total": 0
}
}
使用传输客户端应用此类过滤器。
{
"bool" : {
"must" : [ {
"nested" : {
"query" : {
"bool" : {
"must" : {
"terms" : {
"sprint.Sprint Name" : [ "Sprint 9" ]
}
}
}
},
"path" : "sprint"
}
}, {
"terms" : {
"Assignee DisplayName" : [ "Mateen Khan" ]
}
} ]
}
}
即使在应用过滤器Am之后也会获得其他冲刺的数据。这意味着我正在获取“sprint 7”以及其他冲刺的数据。我正在使用传输客户端,并且在同一查询中执行的复杂聚合很少。
映射:
{
"4ccda045-3958-4773-bb34-7af26fa52f4e": {
"mappings": {
"jira": {
"properties": {
"Aggregate Progress": {
"type": "long"
},
"Aggregate Progress Total": {
"type": "long"
},
"Aggregate Progress percent": {
"type": "long"
},
"Aggregate Time Estimate": {
"type": "long"
},
"Aggregate Time Original Estimate": {
"type": "long"
},
"Aggregate Timespent": {
"type": "long"
},
"Assigne TimeZone": {
"type": "string",
"index": "not_analyzed"
},
"Assignee DisplayName": {
"type": "string",
"index": "not_analyzed"
},
"Assignee EmailAddress": {
"type": "string",
"index": "not_analyzed"
},
"Assignee Name": {
"type": "string",
"index": "not_analyzed"
},
"Created": {
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ss"
},
"Creator Active": {
"type": "string",
"index": "not_analyzed"
},
"Creator DisplayName": {
"type": "string",
"index": "not_analyzed"
},
"Creator EmailAddress": {
"type": "string",
"index": "not_analyzed"
},
"Creator Name": {
"type": "string",
"index": "not_analyzed"
},
"Creator TimeZone": {
"type": "string",
"index": "not_analyzed"
},
"Description": {
"type": "string",
"index": "not_analyzed"
},
"Is Assignee Active": {
"type": "string",
"index": "not_analyzed"
},
"Issue Key": {
"type": "string",
"index": "not_analyzed"
},
"Issue Status": {
"type": "string",
"index": "not_analyzed"
},
"Issuetype Name": {
"type": "string",
"index": "not_analyzed"
},
"Priority": {
"type": "string",
"index": "not_analyzed"
},
"Progress": {
"type": "long"
},
"Progress Percent": {
"type": "long"
},
"Progress Total": {
"type": "long"
},
"Project ID": {
"type": "string",
"index": "not_analyzed"
},
"Project Key": {
"type": "string"
},
"Project Name": {
"type": "string",
"index": "not_analyzed"
},
"Reporter Active": {
"type": "string",
"index": "not_analyzed"
},
"Reporter DisplayName": {
"type": "string",
"index": "not_analyzed"
},
"Reporter EmailAddress": {
"type": "string",
"index": "not_analyzed"
},
"Reporter Name": {
"type": "string",
"index": "not_analyzed"
},
"Reporter TimeZone": {
"type": "string",
"index": "not_analyzed"
},
"Sprint Issue Points": {
"type": "long"
},
"Summary": {
"type": "string",
"index": "not_analyzed"
},
"Time Estimate": {
"type": "long"
},
"Time Original Estimate": {
"type": "long"
},
"Time Tracking Original Estimate": {
"type": "string",
"index": "not_analyzed"
},
"Time Tracking Original Estimate Seconds": {
"type": "long"
},
"Time Tracking Remaining Estimate": {
"type": "string",
"index": "not_analyzed"
},
"Time Tracking Remaining Estimate Seconds": {
"type": "long"
},
"Time Tracking Time Spent": {
"type": "string",
"index": "not_analyzed"
},
"Time Tracking Time Spent Seconds": {
"type": "long"
},
"Updated": {
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ss"
},
"Watch Count": {
"type": "long"
},
"Workratio": {
"type": "long"
},
"sprint": {
"type": "nested",
"properties": {
"Sprint CompleteDate": {
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ss"
},
"Sprint EndDate": {
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ss"
},
"Sprint ID": {
"type": "string",
"index": "not_analyzed"
},
"Sprint Name": {
"type": "string",
"index": "not_analyzed"
},
"Sprint StartDate": {
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ss"
},
"Sprint State": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
}
}
答案 0 :(得分:0)
是否可以尝试将terms
must
中的match
替换为{
"bool" : {
"must" : [ {
"nested" : {
"query" : {
"bool" : {
"must" : {
"match" : {
"sprint.Sprint Name" : [ "Sprint 9" ]
}
}
}
},
"path" : "sprint"
}
}, {
"terms" : {
"Assignee DisplayName" : [ "Mateen Khan" ]
}
} ]
}
}
?
<form action="http://google.com">
<div>
<label for="inputBox">Email address</label>
<input name="email" type="text" id="inputBox"/>
<br>
(Center under input)
</div>
</form>