I found some discrepancy in the official documentation:
[`$search`](https://www.mongodb.com/docs/atlas/atlas-search/query-syntax/#mongodb-pipeline-pipe.-search) returns only the results of your query. The metadata results of your [`$search`](https://www.mongodb.com/docs/atlas/atlas-search/query-syntax/#mongodb-pipeline-pipe.-search) query are saved in the `$SEARCH_META` aggregation variable. You can use the `$SEARCH_META` variable to view the metadata results for your [`$search`](https://www.mongodb.com/docs/atlas/atlas-search/query-syntax/#mongodb-pipeline-pipe.-search) query.
The `$SEARCH_META` aggregation variable can be used anywhere after a [`$search`](https://www.mongodb.com/docs/atlas/atlas-search/query-syntax/#mongodb-pipeline-pipe.-search) stage in any pipeline, but it can't be used after the [`$lookup`](https://www.mongodb.com/docs/master/reference/operator/aggregation/lookup/#mongodb-pipeline-pipe.-lookup) or [`$unionWith`](https://www.mongodb.com/docs/master/reference/operator/aggregation/unionWith/#mongodb-pipeline-pipe.-unionWith) stage in any pipeline. Starting in MongoDB 6.0, the `$SEARCH_META` aggregation variable can't be used in any subsequent stage after a [`$searchMeta`](https://www.mongodb.com/docs/atlas/atlas-search/query-syntax/#mongodb-pipeline-pipe.-searchMeta) stage.
Here says the contrary:
Starting in v6.0, the MongoDB
$lookup
aggregation stage supports $search inside the
$lookup
pipeline option. Using
$lookup
, you can join multiple collections in the same database at query-time and run a $search query to further narrow down your search.