I have the following query:
$query = \Drupal::entityQuery('node') ->condition('type', 'case_study') ->condition('status', '1') ->sort('changed', 'DESC') ->pager(4); $query->condition('title', "%QUERY%", "LIKE"); $nids = $query->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 <-- 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.