Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat : Implement sync with Meilisearch using php #222

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
minor changes
  • Loading branch information
Harsh3341 committed Oct 23, 2023
commit d2c9dee8ee90229aa3f3e7e7c018c2fba8a10212
14 changes: 7 additions & 7 deletions php/sync-with-meilisearch/src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
require(__DIR__ . '/../vendor/autoload.php');
require(__DIR__ . '/utils.php');

use Appwrite\Client as AppwriteClient;
use Appwrite\Client;
use Appwrite\Services\Databases;
use Appwrite\Query;
use MeiliSearch\Client;
use MeiliSearch\Client as MeiliSearch;

return function ($context) {
throw_if_missing($_ENV, [
Expand All @@ -31,17 +31,17 @@
]);
}

$appwriteClient = new AppwriteClient();
$appwriteClient
$client = new Client();
$client
->setEndpoint('https://cloud.appwrite.io/v1')
->setProject($_ENV['APPWRITE_PROJECT_ID'])
->setKey($_ENV['APPWRITE_API_KEY']);

$databases = new Databases($appwriteClient);
$databases = new Databases($client);

$meiliSearchClient = new Client($_ENV['MEILISEARCH_ENDPOINT'], $_ENV['MEILISEARCH_ADMIN_API_KEY']);
$meilisearch = new MeiliSearch($_ENV['MEILISEARCH_ENDPOINT'], $_ENV['MEILISEARCH_ADMIN_API_KEY']);

$index = $meiliSearchClient->index($_ENV['MEILISEARCH_INDEX_NAME']);
$index = $meilisearch->index($_ENV['MEILISEARCH_INDEX_NAME']);

$cursor = null;

Expand Down