Skip to content

Commit

Permalink
Ensure option text attributes values are using their "parent" field p…
Browse files Browse the repository at this point in the history
…arameters for search usage : spellcheck, autocomplete, searchable, etc...
  • Loading branch information
romainruaud committed Sep 15, 2016
1 parent 2f19598 commit fabe5d9
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private function canIndexAttribute(AttributeInterface $attribute)
*
* @param AttributeInterface $attribute Entity attribute.
*
* @return \Smile\ElasticsuiteCatalog\Model\Catalog\Indexer\Fulltext\Datasource\AbstractAttributeData
* @return \Smile\ElasticsuiteCatalog\Model\Eav\Indexer\Fulltext\Datasource\AbstractAttributeData
*/
private function initField(AttributeInterface $attribute)
{
Expand All @@ -177,16 +177,10 @@ private function initField(AttributeInterface $attribute)
$fieldConfig = $this->attributeHelper->getMappingFieldOptions($attribute);

if ($attribute->usesSource()) {
$fieldConfig = $this->attributeHelper->getMappingFieldOptions($attribute);
$fieldConfig['is_searchable'] = false;
$fieldConfig['is_used_in_spellcheck'] = false;
$fieldConfig['is_used_in_autocomplete'] = false;
$fieldOptions = ['name' => $fieldName, 'type' => $fieldType, 'fieldConfig' => $fieldConfig];
$this->fields[$fieldName] = $this->fieldFactory->create($fieldOptions);
$fieldName = $this->attributeHelper->getOptionTextFieldName($fieldName);
$fieldType = 'string';

$fieldConfig['is_searchable'] = true;
}

$fieldOptions = ['name' => $fieldName, 'type' => $fieldType, 'fieldConfig' => $fieldConfig];
Expand Down

0 comments on commit fabe5d9

Please sign in to comment.