Support Topics Documentation Slack YouTube Blog

Algolia search


(Niam Frost) #1

I’m just wondering has anyone had success in pushing data to Algolia for indexing and searching using business logic? I’m quite surprised that nobody has written about it yet.

I’m trying to use guidance provided by algolia https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/how-to/importing-with-the-api/#send-the-data-to-algolia, but all I get is just the name of my table on Algolia side.

Is it possible?


(Mark Piller) #2

I am not familiar with their API and cannot help you with that, however, if there is something that is not working on the Backendless side of things, please let us know.


(Niam Frost) #3

I have this code, but I think there is something wrong in it. Could you help me?

function fetchDataFromDatabase() {
const products = Backendless.Data.of(‘products’)
return products;
}

class AlgoliaService {
async pushData() {
const records = fetchDataFromDatabase();
index.addObjects( records );
}
}
Backendless.ServerCode.addService( AlgoliaService );


(Sergey Kukurudzyak) #4

Hello @Niam_frost,

this code do not fetch the data. Here it is an example of getting data:

Backendless.Data.of( "TABLE-NAME" ).find()
 .then( function( result ) {
  })
 .catch( function( error ) {
  });

Please check out the following documentation https://backendless.com/docs/js/data_basic_search.html

Also, check out documentation about paging https://backendless.com/docs/js/data_data_paging.html


(Niam Frost) #5

Thanks, this helps a lot!
Спасибо :slight_smile: