【问题标题】:not able to add new object to algolia无法向 algolia 添加新对象
【发布时间】:2021-03-04 12:26:01
【问题描述】:

我已经使用了所有的配置并按照 Algolia (https://www.algolia.com/doc/api-reference/api-methods/add-objects/#examples) 上的指南进行操作,但我不知道为什么它不起作用。

我用的是js:

const objects = [{
  firstname: 'Jimmie',
  lastname: 'Barninger'
}, 
{
  firstname: 'Warren',
  lastname: 'Speach'
}];

index.addObjects(objects, (err, content) => {
  console.log(content);
});

我没有收到错误,我可以使用搜索但不能添加新对象。我还需要别的吗?

【问题讨论】:

    标签: javascript algolia


    【解决方案1】:

    我只导入 lite 而不是完整的 Algolia。

    错误:

    import algoliasearch from 'algoliasearch/lite';
    

    右:

    import algoliasearch from 'algoliasearch';
    

    【讨论】:

      猜你喜欢
      • 2016-04-05
      • 2015-08-11
      • 1970-01-01
      • 2013-09-04
      • 2013-06-21
      • 1970-01-01
      • 2021-02-02
      • 2012-06-09
      相关资源
      最近更新 更多