Need help with filter for Visualization

When I try to use the following query for Filter in Visualize, I am getting the following error.

Request to Elasticsearch failed: {"error":{"root_cause":[{"type":"query_shard_exception","reason":"Failed to parse query [{ \"bool\": { \t\"must\" :

Here is my query for Filters aggregation
{
"bool": {
"must" : {
"match_all":{}
}
"filter" : {
"must_not" : {
"exists" : {
"field" : "object1.name"
}
},
"must" : {
"exist" : {
"field" : "object2.name"
}
}
}
}
}

Following works for me when I directly submit to /search. How is the query different from one in Kibana

{
"query" : {
"bool": {
"must_not" : {
"exists" : {
"field" : "object1.name"
}
},
"must" : {
"exists" : {
"field" : "object2.name"
}
}
}
}
}

This worked

{
"bool": {
"must_not" : {
"exists" : {
"field" : "responderWithLevel.loginName"
}
},
"must" : {
"exists" : {
"field" : "responder.loginName"
}
}
}
}