简体   繁体   中英

not able to add new object to algolia

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.

I'm using 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?

I was importing the lite only and not the fullt Algolia.

wrong:

import algoliasearch from 'algoliasearch/lite';

right:

import algoliasearch from 'algoliasearch';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM