ActiveData icon indicating copy to clipboard operation
ActiveData copied to clipboard

Nested filter is confused

Open klahnakoski opened this issue 6 years ago • 0 comments

In an attempt to query treeherder.job_log.failure_line, we can see that the query appears to a placing the filters inside the nested query instead at top level

{
	"sort":{"action.start_time":"desc"},
	"select":["test","created","status","expected"],
	"from":"treeherder.job_log.failure_line",
	"limit":1,
	"where":{"and":[
		{"eq":{"failure.notes.failure_classification":"fixed by commit"}},
		{"exists":"failure.notes.text"},
		{"in":{"build.branch":["mozilla-inbound","autoland"]}},
		{"gte":{"created":{"date":"today-week"}}},
		{"prefix":{"job.type.name":"test-"}}
	]}
}
{
	"from":0,
	"query":{"bool":{"filter":[
		{"bool":{"filter":[
			{"terms":{"build.branch.~s~":["mozilla-inbound","autoland"]}},
			{"prefix":{"job.type.name.~s~":"test-"}}
		]}},
		{"nested":{
			"inner_hits":{"size":100000},
			"path":"job_log.~N~.failure_line.~N~",
			"query":{"bool":{"filter":[
				{"term":{"failure.notes.failure_classification.~s~":"fixed by commit"}},
				{"exists":{"field":"failure.notes.text.~s~"}}
			]}}
		}}
	]}},
	"size":1,
	"sort":[{"action.start_time.~n~":"desc"}],
	"stored_fields":["job_log.status.~n~"]
}

klahnakoski avatar Oct 02 '18 17:10 klahnakoski