Skip to content

Commit

Permalink
MC-20381: Elasticsearch doesn't find products by dropdown attribute v…
Browse files Browse the repository at this point in the history
…alues on Frontend
  • Loading branch information
dhorytskyi committed Sep 24, 2019
1 parent dc0c274 commit 4844c67
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ protected function buildQueries(array $matches, array $queryValue)

$transformedTypes = [];
foreach ($matches as $match) {
$attributeAdapter = $this->attributeProvider->getByAttributeCode($match['field']);
$resolvedField = $this->fieldMapper->getFieldName(
$match['field'],
['type' => FieldMapperInterface::TYPE_QUERY]
);

$attributeAdapter = $this->attributeProvider->getByAttributeCode($resolvedField);
$fieldType = $this->fieldTypeResolver->getFieldType($attributeAdapter);
$valueTransformer = $this->valueTransformerPool->get($fieldType ?? 'text');
$valueTransformerHash = \spl_object_hash($valueTransformer);
Expand All @@ -151,10 +156,6 @@ protected function buildQueries(array $matches, array $queryValue)
continue;
}

$resolvedField = $this->fieldMapper->getFieldName(
$match['field'],
['type' => FieldMapperInterface::TYPE_QUERY]
);
$conditions[] = [
'condition' => $queryValue['condition'],
'body' => [
Expand Down

0 comments on commit 4844c67

Please sign in to comment.