flashlight and elasticsearch with web

239 views
Skip to first unread message

antonio fullone

unread,
Aug 19, 2016, 2:56:23 PM8/19/16
to Firebase Google Group
Hi,

sorry for the noob question but I am pretty new to firebase.

I am building a website and, since most of the data we store is text, I would like to use firebase. To improve the search system, I decided to use elasticsearch.
So I created my firebase database, installed the flashlight module and elasticsearch (on my local environment for the moment, apart of firebase of course).

When I start the app.js in the flashlight I get this error: 

/Library/WebServer/Documents/flashlight/node_modules/firebase/auth-node/auth.js:54
    throw new Error('Service account must contain a "private_key" field');


I created the service for elasticsearch and I have the key, but I don't understand where should I add this key in the config.js file.

I put this in the export.FB_SERVICE_ACCOUNT : 

exports.FB_SERVICEACCOUNT =  {
    serviceAccount: {
      projectId: "elastic search",
      clientEmail: "my...@iam.gserviceaccount.com",
      privateKey: "myPrivateKey"
    },
    databaseURL: "https://mydb.firebaseio.com"
  };


what am I doing wrong? 
Thanks so much and again sorry for the noob question. Just starting now with firebase, it's very easy to work with, I just would like to learn how to set up with elasticsearch to be able to make more advanced queries(like for example when you are typing and so use %like% how the "old sql style)

Cheers!

Jacob Wenger

unread,
Aug 19, 2016, 3:02:40 PM8/19/16
to fireba...@googlegroups.com
I think you want FB_SERVICEACCOUNT to just be the contents of your serviceAccount object, not everything including databaseURL. Try doing this instead:

exports.FB_SERVICEACCOUNT =  {
  projectId: "elastic search",
  privateKey: "myPrivateKey"
};

Note that although the error says you need to have a private_key field, we do allow you to pass it in as privateKey as you have done. So, that should work. It's easiest though to just copy the service account JSON key to a local file and set exports.FB_SERVICEACCOUNT to the path to that file.

Cheers,
Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/abf6f5dd-25df-49ad-a6ea-f8e23b1ba4a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages