Wilr\SilverStripe\Algolia\Service\AlgoliaIndexer
Handles all the index management and communication with Algolia. Note that any checking of records should be performed by the caller of these methods as no permission checking is done by this class
Synopsis
class AlgoliaIndexer
{
- // members
- private static boolean $include_page_content = true;
- private static array $attributes_blacklisted = ;
- private static integer $max_field_size_bytes = 10000;
- // methods
- public boolean indexItem()
- public AlgoliaService getService()
- public $this indexItems()
- public Map exportAttributesFromObject()
- public void exportAttributesFromRelationship()
- public void deleteItem()
- public string generateUniqueID()
- public array getObject()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
Members
private
- $attributes_blacklisted
-
$include_page_content
Include rendered markup from the object's `Link` method in the index. - $max_field_size_bytes
Methods
public
- deleteItem() — Remove an item ID from the index. As this would usually be when an object is deleted in Silverstripe we cannot rely on the object existing.
- exportAttributesFromObject() — Generates a map of all the fields and values which will be sent.
- exportAttributesFromRelationship() — Retrieve all the attributes from the related object that we want to add to this record. As the related record may not have the
- generateUniqueID() — Generates a unique ID for this item. If using a single index with different dataobjects such as products and pages they potentially would have the same ID. Uses the classname and the ID.
- getObject()
- getService()
- indexItem() — Add the provided item to the Algolia index.
- indexItems() — Index multiple items of the same class at a time.