CyberDuck\Searchly\Index\SearchIndex
Object representation of a Elastic Search index.
- Author: Andrew Mc Cormack <andy@cyber-duck.co.uk>
- Copyright: Copyright (c) 2018, Andrew Mc Cormack
- License: https://github.com/cyber-duck/silverstripe-searchly/license
Synopsis
class SearchIndex
{
- // members
- protected $name;
- protected $data;
- protected $type;
- protected array $classes = ;
- protected DataObjectSchema $schema;
- protected array $records = ;
- // methods
- public void __construct()
- public string getName()
- public string getType()
- public array getClasses()
- public DataObjectSchema getSchema()
- public string getRecordID()
- public SearchIndex setRecords()
- public array getRecords()
- public void createIndex()
- public SearchIndex resetIndex()
- public void deleteIndex()
- public SearchIndexClient index()
- public void indexRecord()
- public void removeRecord()
- protected boolean isIndexableClass()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
Members
protected
- $classes
—
array
Array of DataObject classes for this index. - $data
—
string
Search index data. - $name
—
string
Search index name. - $records
—
array
Array of object records for the index. - $schema
—
SilverStripe\ORM\DataObjectSchema
DataObjectSchema instance. - $type
—
string
Search index type.
Methods
protected
- isIndexableClass() — Checks if a passed DataObject can be added to the index.
public
- __construct() — Sets the required properties and classes.
- createIndex() — Creates the search index using the passed mappings and settings.
- deleteIndex() — Delete the index through the API client.
- getClasses() — Returns the search index classes.
- getName() — Returns the search index name.
- getRecordID() — Returns a UUID for a record
- getRecords() — Returns the index records.
- getSchema() — Returns the DataObjectSchema instance.
- getType() — Returns the search index type.
- index() — Updates the index data through the API client.
- indexRecord() — Adds a DataObject to the index.
- removeRecord() — Removes a DataObject from the index.
- resetIndex() — Deletes and recreates the index.
- setRecords() — Sets the index records.