Search: Added support for named filters/queries inside nested filters and queries.

Closes #6293