Skip to content
Snippets Groups Projects

Fix behavior of the SearchApiFulltext filter when no valid fulltext fields are configured

Merged Thomas Seidl requested to merge issue/search_api-3511293:3511293-text-plain-field into 8.x-1.x
@@ -397,13 +397,15 @@ class SearchApiFulltext extends FilterPluginBase {
if ($this->value === '') {
return;
}
$fields = $this->options['fields'];
$fields = $fields ?: array_keys($this->getFulltextFields());
$query = $this->getQuery();
$indexed_fulltext_fields = $query->getIndex()->getFulltextFields();
$fields = array_intersect($this->options['fields'], $indexed_fulltext_fields);
$fields = $fields ?: $indexed_fulltext_fields;
// Override the search fields, if exposed.
if (!empty($this->searchedFields)) {
$fields = array_intersect($fields, $this->searchedFields);
}
$query = $this->getQuery();
// Save any keywords that were already set.
$old = $query->getKeys();
Loading