Commit 015447be authored by drunken monkey's avatar drunken monkey Committed by borisson_

Issue #2962227 by drunken monkey: Search query "processing level" should be checked

parent a74b95c1
...@@ -4,6 +4,7 @@ namespace Drupal\facets\Plugin\facets\query_type; ...@@ -4,6 +4,7 @@ namespace Drupal\facets\Plugin\facets\query_type;
use Drupal\facets\QueryType\QueryTypePluginBase; use Drupal\facets\QueryType\QueryTypePluginBase;
use Drupal\facets\Result\Result; use Drupal\facets\Result\Result;
use Drupal\search_api\Query\QueryInterface;
/** /**
* Provides support for range facets within the Search API scope. * Provides support for range facets within the Search API scope.
...@@ -29,9 +30,11 @@ class SearchApiRange extends QueryTypePluginBase { ...@@ -29,9 +30,11 @@ class SearchApiRange extends QueryTypePluginBase {
$field_identifier = $this->facet->getFieldIdentifier(); $field_identifier = $this->facet->getFieldIdentifier();
$exclude = $this->facet->getExclude(); $exclude = $this->facet->getExclude();
// Set the options for the actual query. if ($query->getProcessingLevel() === QueryInterface::PROCESSING_FULL) {
$options = &$query->getOptions(); // Set the options for the actual query.
$options['search_api_facets'][$field_identifier] = $this->getFacetOptions(); $options = &$query->getOptions();
$options['search_api_facets'][$field_identifier] = $this->getFacetOptions();
}
// Add the filter to the query if there are active values. // Add the filter to the query if there are active values.
$active_items = $this->facet->getActiveItems(); $active_items = $this->facet->getActiveItems();
......
...@@ -4,6 +4,7 @@ namespace Drupal\facets\Plugin\facets\query_type; ...@@ -4,6 +4,7 @@ namespace Drupal\facets\Plugin\facets\query_type;
use Drupal\facets\QueryType\QueryTypePluginBase; use Drupal\facets\QueryType\QueryTypePluginBase;
use Drupal\facets\Result\Result; use Drupal\facets\Result\Result;
use Drupal\search_api\Query\QueryInterface;
/** /**
* Provides support for string facets within the Search API scope. * Provides support for string facets within the Search API scope.
...@@ -34,9 +35,11 @@ class SearchApiString extends QueryTypePluginBase { ...@@ -34,9 +35,11 @@ class SearchApiString extends QueryTypePluginBase {
$field_identifier = $this->facet->getFieldIdentifier(); $field_identifier = $this->facet->getFieldIdentifier();
$exclude = $this->facet->getExclude(); $exclude = $this->facet->getExclude();
// Set the options for the actual query. if ($query->getProcessingLevel() === QueryInterface::PROCESSING_FULL) {
$options = &$query->getOptions(); // Set the options for the actual query.
$options['search_api_facets'][$field_identifier] = $this->getFacetOptions(); $options = &$query->getOptions();
$options['search_api_facets'][$field_identifier] = $this->getFacetOptions();
}
// Add the filter to the query if there are active values. // Add the filter to the query if there are active values.
$active_items = $this->facet->getActiveItems(); $active_items = $this->facet->getActiveItems();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment