Browse Source

added autocomplete with documents title in search form

Bachir Soussi Chiadmi 6 years ago
parent
commit
94175c1df1

+ 3 - 0
sites/all/modules/figli/edlp_search/src/Controller/EdlpSearchController.php

@@ -208,6 +208,9 @@ class EdlpSearchController extends ControllerBase {
     // if($this->request->query->get('field_synonyms')){
       $this->field_synonyms = $this->request->query->get('field_synonyms');
     // }
+    // if($this->request->query->get('node_type')){
+      // $this->node_type = $this->request->query->get('node_type');
+    // }
     $this->keys = $this->request->query->get('q');
   }
 

+ 2 - 0
sites/all/modules/figli/edlp_search/src/Form/EdlpSearchForm.php

@@ -29,6 +29,8 @@ class EdlpSearchForm extends FormBase {
       '#title' => $this->t('Search'),
       'keys' => [
         '#type' => 'search',
+        '#autocomplete_route_name' => 'edlp_search.edlp_search_controller_autocomplete',
+        '#autocomplete_route_parameters' => array('field_name' => 'title'),
         '#maxlength' => 20,
         '#size' => 15,
         '#weight' => '0',