Doctrine ODM query to dwo Dotuments

I have two documents in Symfony6 and I would like to query them with a single aggregation.

The documents are not related, but they have one common field: “name”.

I would like to create an autocomplete that searches through two documents by the “name” field and merges them.

I tried using facet and aggregation but unfortunately without success 🙁