无法向 algolia 添加新对象 [英] not able to add new object to algolia
本文介绍了无法向 algolia 添加新对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经使用了所有的配置并遵循了 Algolia 的指南(https://www.algolia.com/doc/api-reference/api-methods/add-objects/#examples),我不知道为什么它不起作用.
I have used all the configuratgions and followed the guide on Algolia (https://www.algolia.com/doc/api-reference/api-methods/add-objects/#examples) and I don't know why it's not working.
我正在使用 js:
const objects = [{
firstname: 'Jimmie',
lastname: 'Barninger'
},
{
firstname: 'Warren',
lastname: 'Speach'
}];
index.addObjects(objects, (err, content) => {
console.log(content);
});
我没有收到错误,我可以使用搜索但不能添加新对象.我还需要别的东西吗?
I do not get an error and i'm able to use the search but not add a new object. Do I need something else?
推荐答案
我只导入了 lite 而不是 fullt Algolia.
I was importing the lite only and not the fullt Algolia.
错误:
import algoliasearch from 'algoliasearch/lite';
正确:
import algoliasearch from 'algoliasearch';
这篇关于无法向 algolia 添加新对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文