smileBeda
06/19/2025, 7:51 PMuse \Typesense\Client;
$ts_client = new Client(
array(
'nearest_node' => array(
'host' => 'host-here',
'port' => '443',
'protocol' => 'https',
),
'nodes' => array(
array(
'host' => 'host-here',
'port' => '443',
'protocol' => 'https',
),
array(
'host' => 'host-here',
'port' => '443',
'protocol' => 'https',
),
array(
'host' => 'host-here',
'port' => '443',
'protocol' => 'https',
),
),
'api_key' => 'api-here',
'connection_timeout_seconds' => 1800,
)
);
$collection = 'my_collection';
// Fetch current document
try {
$document = $ts_client->collections[ $collection ]->documents[ (string) $post_id ]->retrieve();
} catch ( \Exception $e ) {
// And here I received https://:443/collections/my_collection/documents/Document_ID? instead of the full proper URL
return;
}Rob Bast
06/20/2025, 12:28 PMsmileBeda
06/20/2025, 12:39 PM