Dinesh Thiyagarajan
Dinesh Thiyagarajan

Reputation: 480

Full text Search in firestore using algolia

Im trying to implement Full Text Search in Android Application that uses Cloud firestore as database, so in the documentation they said firestore does not support it and go for Algolia(third party),Initially i tried using algolia search with some sample data and it works great.now i need to sync the data from firestore to algolia,im getting documentation only for realtime database and not for cloud firestore. Documentation given by Algolia ,Documentation given by google, they have given node.js functions and im new to node.js. i cant find any tutorials related to firestore sync with algolia , so anyone knows where to start ? im able to upload data into firestore using node js, i need to export the data from firestore to algolia .i tried it using node.js as given by google .this is the error im getting.i have tried changing the node versions , but no use.

    path.js:28
    throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'path', 'string');
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string
    at assertPath (path.js:28:11)
    at Object.join (path.js:1244:7)
    at database (/Users/Desktop/Projects/FirebaseCLI/functions/node_modules/firebase-functions/lib/providers/firestore.js:36)
    at Object.document (/Users/Desktop/Projects/FirebaseCLI/functions/node_modules/firebase-functions/lib/providers/firestore.js:44)
    at Object.<anonymous> (/Users/Desktop/Projects/FirebaseCLI/functions/index.js:27)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)

and this is the path of the document that im giving for document in firestore

    firestore exports.noteCreated = functions.firestore
  .document('note/{noteId}')
  .onCreate(event => {
    // Get an object representing the document
    // e.g. {'name': 'Marie', 'age': 66}
    console.log('New Note Created');
});

Upvotes: 2

Views: 875

Answers (1)

kevmo314
kevmo314

Reputation: 4317

This is due to the GCLOUD_PROJECT environment variable not being set. I've created a pull request to surface a more helpful error message here.

To set the environment variable, you can use cross-env: cross-env GCLOUD_PROJECT=whatever.

Upvotes: 1

Related Questions