![](/img/trans.png)
[英]With Algolia, how to pass the query string created by urlSync into the php client?
[英]How to create replica with Algolia php client?
我正在尝试使用Algolia php客户端将副本索引链接到主索引,我在索引设置中找不到将索引标记为主索引副本的任何内容,只是在设置中将$ forwardToReplicas标记了出来,但没有创建和链接副本。
要创建副本,您可以在设置中使用“副本”键。
<?php
$client = new \AlgoliaSearch\Client('application _id', 'api_key');
$index = $client->initIndex('index_name');
$index->setSettings([
'replicas' => ['products_name_asc', 'products_name_desc']
]);
这将创建2个新索引“ products_name_asc”和“ products_name_desc”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.