From 63fa638f628a6a4e4dd810310097e7a01b3ad54f Mon Sep 17 00:00:00 2001 From: Mateusz Deszert-Klosowski Date: Thu, 19 Nov 2020 08:03:33 +0100 Subject: [PATCH] Fix for searching attributes like '%100_wool' --- src/QueryBuilder/HasAttributesQueryBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/QueryBuilder/HasAttributesQueryBuilder.php b/src/QueryBuilder/HasAttributesQueryBuilder.php index 179d739b..de2de4e3 100644 --- a/src/QueryBuilder/HasAttributesQueryBuilder.php +++ b/src/QueryBuilder/HasAttributesQueryBuilder.php @@ -24,7 +24,7 @@ public function buildQuery(array $data): ?AbstractQuery foreach ((array) $data['attribute_values'] as $attributeValue) { $termQuery = new Term(); - $termQuery->setTerm($data['attribute'], $attributeValue); + $termQuery->setTerm($data['attribute'] . '.keyword', $attributeValue); $attributeQuery->addShould($termQuery); }