Search nodes with paragraph I have the following query:

$query = \Drupal::entityQuery('node')
            -&gt;condition('type', 'case_study')
            -&gt;condition('status', '1')
            -&gt;sort('changed', 'DESC')
            -&gt;pager(4);


$query-&gt;condition('title', "%QUERY%", "LIKE");


$nids = $query-&gt;execute();


This works fine, however it obviously only searches on the title of the node. My case study nodes' fields are structured like this

- Case Study
    - title
    - field_page_banner
    - ...
    - field_rows &lt;-- this is my paragraphs field


The paragraphs can contain multiple types and are chosen by the user when creating the content.

I want to be able to alter my query so that it searches the content of the paragraphs. For example, if the user adds a 'Rich Text' paragraph type, it will search the text.

This works fine for the built in search functionality, I just want to create a page of case studies with search functionality.

I am using Drupal 8.2.4 and Paragraphs 8.x-1.0.
The \Drupal::entityQuery object doesnt support JOINs I believe:
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21Query%21QueryInterface.php/interface/QueryInterface/8.2.x

If it did you could Join onto the Paragraph bundle and LIKE across that all you want.

I recommend the following approach with Views, a small chance exists it may not work:


Create a View of your case study Nodes
add a relationship to the Paragraph bundle (if needed)
assure the field list for the View includes title and field_rows (you can Exclude field_rows from showing in your view if you want).
add a Grouped Filter and Expose it and select it to use your title and field_rows values.


That should do the trick...