AlgoliaSearch\Index::addObjects PHP Method

addObjects() public method

Add several objects.
public addObjects ( array $objects, string $objectIDKey = 'objectID' ) : mixed
$objects array contains an array of objects to add. If the object contains an objectID
$objectIDKey string
return mixed
    public function addObjects($objects, $objectIDKey = 'objectID')
    {
        $requests = $this->buildBatch('addObject', $objects, true, $objectIDKey);
        return $this->batch($requests);
    }

Usage Example

 /**
  * {@inheritDoc}
  */
 public function synchronize(array $documents)
 {
     if ($this->clearOnSync) {
         $this->index->clearIndex();
     }
     $this->index->addObjects($documents);
 }
All Usage Examples Of AlgoliaSearch\Index::addObjects