diff --git a/src/Indexer/TNTGeoIndexer.php b/src/Indexer/TNTGeoIndexer.php index fca0d15..1359383 100644 --- a/src/Indexer/TNTGeoIndexer.php +++ b/src/Indexer/TNTGeoIndexer.php @@ -69,4 +69,16 @@ public function prepareInsertStatement() $this->insertStmt = $this->index->prepare("INSERT INTO locations (doc_id, longitude, latitude, cos_lat, sin_lat, cos_lng, sin_lng) VALUES (:doc_id, :longitude, :latitude, :cos_lat, :sin_lat, :cos_lng, :sin_lng)"); } + + public function insert($document) + { + $this->processDocument(new Collection($document)); + } + + public function delete($documentId) + { + $this->prepareAndExecuteStatement("DELETE FROM locations WHERE doc_id = :documentId;", [ + ['key' => ':documentId', 'value' => $documentId] + ]); + } }