added sapi_solr query condition on field_reference

This commit is contained in:
Bachir Soussi Chiadmi 2021-02-24 10:48:07 +01:00
parent d579bba5c7
commit 015139d04b
1 changed files with 5 additions and 3 deletions

View File

@ -34,11 +34,13 @@ class Base extends ControllerBase {
// Set fulltext search keywords and fields. // Set fulltext search keywords and fields.
$this->query->keys($this->keys); $this->query->keys($this->keys);
// $this->query->setFulltextFields(['name']); // $this->query->setFulltextFields(['field_reference']);
// Set additional conditions. // Set additional conditions.
// $this->query->addCondition('status', 1) // in case we search for material reference like W0117
// ->addCondition('author', 1, '<>'); if (preg_match('/^[WTRPCMFGSO]\d{4}$/i', $this->keys, $matches)) {
$this->query->addCondition('field_reference', $this->keys);
}
// Restrict the search to specific languages. // Restrict the search to specific languages.
// $this->query->setLanguages(['de', 'it']); // $this->query->setLanguages(['de', 'it']);