While developing a custom "search mode" that should filter by a specific field only ("title"), I was unable to prevent the research to search inside of attached documents (documents fields in index).
Indeed in Drupal\es_attachment\EventSubscriber\QueryEvent.php, there is an alterQuery on "QueryParamsEvent" provided by elasticsearch_connector module, but it does not allow us to pass any value that tells not to search in document fields.
- Add a "Search api attachments" field in index (eg. : "saa_field_pdf")
- Try researching only by 'title' textfield programmatically (eg. : $query->setFulltextFields(['title']); in HOOK__search_api_query_alter)
=> The research keeps searching in the attached documents, with no workaround.
Add the $query object as parameter in QueryParamsEvent so that we can retrieve passed options ? Or anything else that allows us to prevent this to happen
Active
1.0
Code