索引由两个不同的网站共享但具有不同的权限

Index shared by two different websites but with different permissions

我在 Algolia 和两个网站上有一个索引。例如,记录是:

[{
    name: "record 1",
    public: 1
}, {
    name: "record 2",
    public: 0
}]

这两个网站搜索到同一个索引,但我想要的是:

我想过两个不同的索引,但是public: 1的记录是两个网站共享的,所以我应该有重复的记录(而且,对于每个计划,都有记录的限制)。这不是我想要应用的解决方案。

如何实现?

您可以为包含 public:1.

过滤器的第二个网站创建 secured API key

来自关于安全 API 密钥的文档:

The goal of a secured API key is to ensure a set of query parameters cannot be changed by the end user. In order to do that, we compute a HMAC SHA-256 hash between one of your API keys that is used as a secret and the set of query parameters you want to enforce.