/** * Get Settings of indices. * * @param string|array $index * @return mixed */ public function getSettings($index = null) { if ($index == null) { $index = $this->index; } $prefix = $this->connection->getIndexPrefix(); if (is_array($index)) { foreach ($index as $key => $value) { $index[$key] = $prefix . $value; } } else { $index = $prefix . $index; } $compiled = $this->grammar->compileGetSettings($index); return $this->processor->processGetSettings($this, $this->connection->indexGetSettings($compiled)); }
/** * Delete a document from elasticsearch. * * @param array $payload * @return mixed */ public function delete() { if (!$this->indexIsDefined()) { throw new IndexMustBeDefinedException("To delete a document, index must be definded", 1); } if (!$this->typeIsDefined()) { throw new TypeMustBeDefinedException("To delete a document, type must be defined", 1); } $compiled = $this->grammar->compileDelete($this); return $this->processor->processDelete($this, $this->connection->documentDelete($compiled)); }