Algolia Firebase Functions Backend search

exports.searchTags = functions.https.onRequest((req,res)=>{

var data = req.body.searchTags;
var client = algoliasearch(ALGOLIA_APP_ID,ALGOLIA_SEARCH_KEY);
const index = client.initIndex('Users');

index.search({
    query:""
},function(err,content) {
    return res.send(content.hits)
})

});

I have this code,I integreted algolia to firebase , I want to search at backend but I’m getting some error,

> error Expected error to be handled handle-callback-err

Is firebase functions supported backend query ? How can I search at backend this is possible ?

Hello,

Looking at your code, it seems that your need error handling at several point in this code. At least, in your search query, the callback receives an error handler err that you can check, before sending the content (content.hits).

You can explore the documentation about Algolia and Firebase (here is the entry point ) for futher information.

If you need more information, feel free to request more them here, we’ll be happy to reply.

Regards,


Marwan Burelle
Software Engineer @ Algolia