Skip to content

Commit

Permalink
Merge pull request #283 from piolet/insert-update-geoindexer
Browse files Browse the repository at this point in the history
override insert and delete functions
  • Loading branch information
nticaric authored May 2, 2023
2 parents 201d679 + 6c43188 commit 3727048
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Indexer/TNTGeoIndexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]
]);
}
}

0 comments on commit 3727048

Please sign in to comment.