interface StandardSearchIndexerInterface (View source)

Class to be implemented by attribute categories to define the attribute indexing table.

Methods

string|false
getIndexedSearchTable()

Get the name of the indexing table (return false if there's no indexing table).

array|false
getSearchIndexFieldDefinition()

Get the definition of the indexing table, excluding attribute-related fields (return false if there's no indexing table).

mixed
getIndexedSearchPrimaryKeyValue(object $mixed)

Get the value of the primary key column of the indexing table that identifies the object to be indexed.

Details

string|false getIndexedSearchTable()

Get the name of the indexing table (return false if there's no indexing table).

Return Value

string|false

array|false getSearchIndexFieldDefinition()

Get the definition of the indexing table, excluding attribute-related fields (return false if there's no indexing table).

The resulting array can have these keys:

  • columns: an array describing the table columns
  • primary: an array containing the names of the columns that define the table primary key
  • foreignKeys: an array describing the foreign keys.

Return Value

array|false

Examples

Here's what the File attribute category returns:
[
'columns' => [
[
'name' => 'fID',
'type' => 'integer',
'options' => ['unsigned' => true, 'default' => 0, 'notnull' => true],
],
],
'primary' => ['fID'],
'foreignKeys' => [
[
'foreignTable' => 'Files',
'localColumns' => ['fID'],
'foreignColumns' => ['fID'],
'onUpdate' => 'CASCADE',
'onDelete' => 'CASCADE',
],
],
]

mixed getIndexedSearchPrimaryKeyValue(object $mixed)

Get the value of the primary key column of the indexing table that identifies the object to be indexed.

Parameters

object $mixed

The object for which we need the identifier

Return Value

mixed

Examples

For the File attribute category, the file ID will be returned.