소스 검색

sapi conditiongroup AND instead of OR

bach 3 년 전
부모
커밋
57d042e5d8
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      web/modules/custom/materio_sapi/src/Controller/Base.php

+ 2 - 2
web/modules/custom/materio_sapi/src/Controller/Base.php

@@ -51,7 +51,7 @@ class Base extends ControllerBase {
     //  - " edismax " => ???
     //  - " edismax " => ???
     $parse_mode = \Drupal::service('plugin.manager.search_api.parse_mode')
     $parse_mode = \Drupal::service('plugin.manager.search_api.parse_mode')
       ->createInstance('direct');
       ->createInstance('direct');
-    $parse_mode->setConjunction('OR');
+    $parse_mode->setConjunction('AND');
     $this->query->setParseMode($parse_mode);
     $this->query->setParseMode($parse_mode);
 
 
     // Set fulltext search keywords and fields.
     // Set fulltext search keywords and fields.
@@ -88,7 +88,7 @@ class Base extends ControllerBase {
 
 
     // filter the search
     // filter the search
     if ($this->filters) {
     if ($this->filters) {
-      $filters_conditions = $this->query->createConditionGroup('OR');
+      $filters_conditions = $this->query->createConditionGroup('AND');
       foreach ($this->filters as $filter) {
       foreach ($this->filters as $filter) {
         $filter = (int) $filter;
         $filter = (int) $filter;
         foreach (['tag_tid', 'thesaurus_tid'] as $field) {
         foreach (['tag_tid', 'thesaurus_tid'] as $field) {