Skip to content

Commit 69b905e

Browse files
committed
Merge pull request #78 from networkteam/query-dimension-filter
[BUGFIX] Correctly filter for dimension combinations in query
2 parents eea13bb + ad0ac08 commit 69b905e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Eel/ElasticSearchQueryBuilder.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,11 @@ public function query(NodeInterface $contextNode) {
626626
// http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-terms-filter.html
627627
$this->queryFilter('terms', array('__workspace' => array_unique(array('live', $contextNode->getContext()->getWorkspace()->getName()))));
628628

629+
// match exact dimension values for each dimension, this works because the indexing flattens the node variants for all dimension preset combinations
630+
foreach ($contextNode->getContext()->getDimensions() as $dimensionName => $dimensionValues) {
631+
$this->queryFilter('terms', array('__dimensionCombinations.' . $dimensionName => $dimensionValues, 'execution' => 'and'));
632+
}
633+
629634
$this->contextNode = $contextNode;
630635

631636
return $this;

0 commit comments

Comments
 (0)