![](/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.