Skip to content

Commit b6d2d03

Browse files
authored
Merge pull request #278 from Wojdylak/fix-channel-query-builder
Fix channel filter by switching to keyword field in ES query
2 parents 4d9cf26 + 2f3fa21 commit b6d2d03

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

features/shop/searching_products_by_a_partial_name.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Feature: Filtering products
55
I want to be able to filter products by specific criteria
66

77
Background:
8-
Given the store operates on a channel named "Web-US" in "USD" currency
8+
Given the store operates on a single channel in "United States"
99
And the store classifies its products as "Shirts"
1010
And there is a product named "Loose white designer T-Shirt" in the store
1111
And there is a product named "Everyday white basic T-Shirt" in the store

features/shop/site_wide_searching_products.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Feature: Site-wide products search
55
I want to be able to search products across the entire catalog
66

77
Background:
8-
Given the store operates on a channel named "Web-US" in "USD" currency
8+
Given the store operates on a single channel in "United States"
99
And the store classifies its products as "Cars"
1010
And the store classifies its products as "Motorbikes"
1111
And the store has a select product attribute "Car Type" with values "Cabrio" and "SUV"

features/shop/site_wide_searching_products_113.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Feature: Site-wide products search
55
I want to be able to search products across the entire catalog
66

77
Background:
8-
Given the store operates on a channel named "Web-US" in "USD" currency
8+
Given the store operates on a single channel in "United States"
99
And the store classifies its products as "Cars"
1010
And the store classifies its products as "Motorbikes"
1111
And the store has a select product attribute "Car Type" with values "Cabrio" and "SUV"

src/QueryBuilder/HasChannelQueryBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ public function __construct(
2626

2727
public function buildQuery(array $data): ?AbstractQuery
2828
{
29-
$channelQuery = new Terms($this->channelsProperty);
29+
$channelQuery = new Terms(sprintf('%s.keyword', $this->channelsProperty));
3030
/** @var string $channelCode */
3131
$channelCode = $this->channelContext->getChannel()->getCode();
32-
$channelQuery->setTerms([strtolower($channelCode)]);
32+
$channelQuery->setTerms([$channelCode]);
3333

3434
return $channelQuery;
3535
}

0 commit comments

Comments
 (0)