Browse Source

added current language condition to searchapi query

Bachir Soussi Chiadmi 6 years ago
parent
commit
d62d02201b

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

@@ -336,6 +336,10 @@ class EdlpSearchController extends ControllerBase {
 
     // TODO: locuteurs
 
+    $language = \Drupal::languageManager()->getCurrentLanguage()->getId();
+    // $language =  \Drupal::languageManager()->getCurrentLanguage()->getName();
+    $query->addCondition('search_api_language', $language);
+
     $result = $query->execute();
     $items = $result->getResultItems();
     // dpm($items);