diff --git a/docs/en/reference/aggregation-stage-reference.rst b/docs/en/reference/aggregation-stage-reference.rst index a5926aec16..7296334bde 100644 --- a/docs/en/reference/aggregation-stage-reference.rst +++ b/docs/en/reference/aggregation-stage-reference.rst @@ -701,6 +701,27 @@ for a reference of all available operators. ->fields('title', 'content') ; +To combine multiple search operators, use the `compound operator `_: + +.. code-block:: php + + createAggregationBuilder(\Documents\Fruits::class); + $builder + ->compound() + ->must() + ->text()->query('varieties')->path('description') + ->should(minimumShouldMatch: 1) + ->text()->query('Fuji')->path('description') + ->text()->query('Golden Delicious')->path('description') + ; + +This aggregation will return `Fruits` documents from whose `description` field +contains the word "varieties" (must), and should also contain either "Fuji" or +"Golden Delicious" in the `description` field (at least one due to +`minimumShouldMatch: 1`). + $set ----