removed autocomplete on main field search form, search only on title and description for main field
This commit is contained in:
@@ -45,7 +45,6 @@ class EdlpSearchController extends ControllerBase {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function getSearchForm(){
|
private function getSearchForm(){
|
||||||
$this->form = $this->formBuilder->getForm('Drupal\edlp_search\Form\EdlpSearchForm');
|
$this->form = $this->formBuilder->getForm('Drupal\edlp_search\Form\EdlpSearchForm');
|
||||||
}
|
}
|
||||||
@@ -315,7 +314,11 @@ class EdlpSearchController extends ControllerBase {
|
|||||||
|
|
||||||
// Search for keys.
|
// Search for keys.
|
||||||
if (!empty($this->keys)) {
|
if (!empty($this->keys)) {
|
||||||
$query->keys($this->keys);
|
// $query->keys($this->keys);
|
||||||
|
$keys_condition_group = $query->createConditionGroup('OR');
|
||||||
|
$keys_condition_group->addCondition('title', $this->keys, 'IN');
|
||||||
|
$keys_condition_group->addCondition('field_description', $this->keys, 'IN');
|
||||||
|
$query->addConditionGroup($keys_condition_group);
|
||||||
}
|
}
|
||||||
|
|
||||||
// langues
|
// langues
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ class EdlpSearchForm extends FormBase {
|
|||||||
'#title' => $this->t('Search'),
|
'#title' => $this->t('Search'),
|
||||||
'keys' => [
|
'keys' => [
|
||||||
'#type' => 'search',
|
'#type' => 'search',
|
||||||
'#autocomplete_route_name' => 'edlp_search.edlp_search_controller_autocomplete',
|
// '#autocomplete_route_name' => 'edlp_search.edlp_search_controller_autocomplete',
|
||||||
'#autocomplete_route_parameters' => array('field_name' => 'title'),
|
// '#autocomplete_route_parameters' => array('field_name' => 'title'),
|
||||||
'#maxlength' => 20,
|
'#maxlength' => 20,
|
||||||
'#size' => 15,
|
'#size' => 15,
|
||||||
'#weight' => '0',
|
'#weight' => '0',
|
||||||
|
|||||||
Reference in New Issue
Block a user