class StandardSearchIndexer implements SearchIndexerInterface (View source)

Properties

protected Connection $connection
protected Comparator $comparator

Methods

__construct(Connection $connection, Comparator $comparator)

Initialize the instance.

refreshSearchIndexKeyColumns(CategoryInterface $category, AttributeKeyInterface $key) deprecated

No description

updateSearchIndexKeyColumns(CategoryInterface $category, AttributeKeyInterface $key, string|null $previousHandle = null)

Create or update the column that contains the indexed data of a specific attribute.

indexEntry(CategoryInterface $category, AttributeValueInterface $value, object $subject)

Store in the index table the value of an attribute of an item.

clearIndexEntry(CategoryInterface $category, AttributeValueInterface $value, object $subject)

Remove from the index table the value of an attribute of an item.

string
getIndexEntryColumnName(string $attributeKeyHandle, string $subKey = '')

Get the name of the column associated to an attribute key.

string
getIndexEntryColumn(Key $key, string|false $subKey = false) deprecated

No description

array
setTypeLength(array $options)

Set the 'length' key of an array containing the column options.

processColumn(Table $toTable, string $columnName, string $typeName, array $options)

No description

Details

__construct(Connection $connection, Comparator $comparator)

Initialize the instance.

Parameters

Connection $connection
Comparator $comparator

refreshSearchIndexKeyColumns(CategoryInterface $category, AttributeKeyInterface $key) deprecated

deprecated use the updateRepositoryColumns() method, with TRUE as the fourth argument

No description

Parameters

CategoryInterface $category
AttributeKeyInterface $key

updateSearchIndexKeyColumns(CategoryInterface $category, AttributeKeyInterface $key, string|null $previousHandle = null)

Create or update the column that contains the indexed data of a specific attribute.

Parameters

CategoryInterface $category
AttributeKeyInterface $key
string|null $previousHandle

See also

SearchIndexerInterface::updateSearchIndexKeyColumns

indexEntry(CategoryInterface $category, AttributeValueInterface $value, object $subject)

Store in the index table the value of an attribute of an item.

Parameters

CategoryInterface $category
AttributeValueInterface $value
object $subject

The item owning the attribute value

See also

SearchIndexerInterface::indexEntry

clearIndexEntry(CategoryInterface $category, AttributeValueInterface $value, object $subject)

Remove from the index table the value of an attribute of an item.

Parameters

CategoryInterface $category
AttributeValueInterface $value
object $subject

The item owning the attribute value

See also

SearchIndexerInterface::clearIndexEntry

protected string getIndexEntryColumnName(string $attributeKeyHandle, string $subKey = '')

Get the name of the column associated to an attribute key.

Parameters

string $attributeKeyHandle

the handle of the attribute key

string $subKey

the part of the name of a sub-field (if any - to be used for example if an attribute key needs multiple columns)

Return Value

string

protected string getIndexEntryColumn(Key $key, string|false $subKey = false) deprecated

deprecated use the getIndexEntryColumnName() method

No description

Parameters

Key $key
string|false $subKey

Return Value

string

private array setTypeLength(array $options)

Set the 'length' key of an array containing the column options.

For certain fields (eg TEXT) Doctrine uses the length of the longest column to determine what field type to use. For search indexing even if we may not currently have something long in a column, we need the longest possible column so that we don't truncate any data.

Parameters

array $options

Return Value

array

the $options argument, with the 'length' key set (if needed)

private processColumn(Table $toTable, string $columnName, string $typeName, array $options)

No description

Parameters

Table $toTable
string $columnName
string $typeName
array $options