mirror of
https://github.com/YGGverse/Yo.git
synced 2025-03-13 05:41:18 +00:00
35 lines
627 B
PHP
35 lines
627 B
PHP
<?php
|
|
|
|
// Load dependencies
|
|
require_once __DIR__ . '/../../../vendor/autoload.php';
|
|
|
|
// Init config
|
|
$config = json_decode(
|
|
file_get_contents(
|
|
__DIR__ . '/../../../config.json'
|
|
)
|
|
);
|
|
|
|
// Init client
|
|
$client = new \Manticoresearch\Client(
|
|
[
|
|
'host' => $config->manticore->server->host,
|
|
'port' => $config->manticore->server->port,
|
|
]
|
|
);
|
|
|
|
// Init index
|
|
$index = $client->index(
|
|
$config->manticore->index->document->name
|
|
);
|
|
|
|
// Search
|
|
foreach($index->search($argv[1])
|
|
->limit($argv[2] ? $argv[2] : 10)
|
|
->get() as $result)
|
|
{
|
|
var_dump(
|
|
$result
|
|
);
|
|
}
|