2016-04-28 32 views
2

我试图索引Algolia中的联系人。
这里是我的代码:“没有足够的权利添加对象”错误,同时实施Algolia

StreamReader re = File.OpenText("contacts.json"); 
JsonTextReader reader = new JsonTextReader(re);` 
JArray batch = JArray.Load(reader); 
// Add objects 
Index index = client.InitIndex("contacts"); 

index.AddObjects(batch); 

我就上线得到一个错误:

Not enough rights to add an object 
+0

你应该首先阅读[如何问[在StackOverflow]](http://stackoverflow.com/help/how-to-ask)。 – Jerska

+0

关于您的特定错误,您似乎正在使用的API密钥不允许您为对象建立索引。 – Jerska

+0

@Jerska我肯定会提高我的“提问技巧”。 显然我用的关键只是为了搜索。我用管理员密钥,它工作正常。非常感谢。 – KetanVaghasiya

回答

10

好像你正在使用的不具有API密钥“添加记录“在阿尔戈利亚ACL。

当您想要使用您的管理API密钥进行索引时,您可能使用了您的搜索API密钥。

相关问题