首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >什么是$index in facets count in algolia?

什么是$index in facets count in algolia?
EN

Stack Overflow用户
提问于 2019-05-07 13:16:27
回答 1查看 36关注 0票数 0

我已经在很多网站上搜索过$index,但是没有一个定义如何获取这个variable.For的值,现在我不得不使用如下的模型:

有没有人可以帮我解决这个问题,如何让$index在algolia方面计数如下?

代码语言:javascript
复制
$index->searchForFacetValues("age", ['filters' => 'age']);

我已经试了很多次了,但是没有得到正确的结果。

代码语言:javascript
复制
$results = User::search($request->get('search'))->with(['filters' => 'age:23',]);

想要获取$index

EN

回答 1

Stack Overflow用户

发布于 2019-05-07 19:32:01

我想你是在找this snippet from the docs

代码语言:javascript
复制
// 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

如果这不是你想要的,你可能需要重新表达你的问题:)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56015948

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档