1. Go to this page and download the library: Download mathsgod/milvus-client-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mathsgod / milvus-client-php example snippets
$client=new Milvus\Client($host, $port);
// Create a collection with 5 dimensions
$client->collections()->create("test_collection",5);
// Search for the top 10 vectors that are most similar to the vector [1.0,3.0,3.0,4.0,5.0]
$result = $client->entities("test_collection")->search("vector",[1.0,3.0,3.0,4.0,5.0],10);
$e = $client->entities("test_collection");
$result = $e->query("id in [1,2,3,4,5]");
$e = $client->entities("test_collection");
$e->delete("id in [1]");
$users = $client->users()->list();
$client->users()->create("test_user");
$client->user("test_user")->drop();
$client->user("test_user")->grantRole("admin");
$client->user("test_user")->revokeRole("admin");
$roles = $client->roles()->list();
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.