Partial string match for nested value

If I have a document like this

"owner": {
"name": "joe",
"pet": {
"name": "rover",
"type": "dog"

And I want to search on all dogs with a name that starts with ro how could create a nested query on multiple fields?

I think I would query for some fields using a term query and other fields as a wildcard. Or maybe use ngram?

I would probably first do a filter query on = dog and then perform the query against using a match query. You should probably set your mapping on type to be an exact match, but make support ngrams. If you explicitly want start use prefix.