我已经在很多网站上搜索过$index,但是没有一个定义如何获取这个variable.For的值,现在我不得不使用如下的模型:
有没有人可以帮我解决这个问题,如何让$index在algolia方面计数如下?
$index->searchForFacetValues("age", ['filters' => 'age']);我已经试了很多次了,但是没有得到正确的结果。
$results = User::search($request->get('search'))->with(['filters' => 'age:23',]);想要获取$index
发布于 2019-05-07 19:32:01
我想你是在找this snippet from the docs
// composer autoload
require __DIR__ . '/vendor/autoload.php';
// if you are not using composer
// require_once 'path/to/algolia/folder/autoload.php';
$client = Algolia\AlgoliaSearch\SearchClient::create(
'YourApplicationID',
'YourAdminAPIKey'
);
$index = $client->initIndex('your_index_name');您可以通过在Algolia API客户端实例上调用initIndex来获取$index。
如果这不是你想要的,你可能需要重新表达你的问题:)
https://stackoverflow.com/questions/56015948
复制相似问题