在Heroku上设置手电筒,使用新的Firebase进行ElasticSearch [英] Setting up Flashlight on Heroku for ElasticSearch with new Firebase
问题描述
我的目标是将Firebase与ElasticSearch连接起来进行索引,以便在iOS应用中搜索用户名时可以实现like查询。从我所看到的,这是最好的解决方案,我想尽早解决这个问题,以便进行可扩展性,而不是强迫它。
要实现这样,我正在尝试部署Firebase开发人员为Heroku提供的
要获得 FB_TOKEN
:
- 转到 Google开发者控制台
- 选择与...相关联的项目您的Firebase项目
- 转到
凭据
页面 - 创建一个新的
API密钥
或选择是否已经有适当的
注意:
您可以也设置(和s ee)您的Heroku项目中的那些变量(如果您不想从终端设置)。要执行此操作:
- 转到您的Heroku项目的
设置
页面 - 点击
显示配置变量
按钮
祝你好运。
My goal is to connect Firebase with ElasticSearch for indexing so that I can implement "like" queries when searching usernames in my iOS app. From what I've read this is the best solution, and I want to tackle it this way early in order to be scalable instead of brute-forcing it.
To achieve this, I'm trying to deploy the flashlight app that Firebase developers have provided for us onto a Heroku, but I'm confused on how to go about doing it. Please correct me where I'm wrong, I'm fairly new to the Heroku ecosystem, ElasticSearch, and nodejs.
I currently have a Heroku account, and have the toolbelt and nodejs/npm installed on my computer (Mac). I've run the following commands:
git clone https://github.com/firebase/flashlight
cd flashlight
heroku login
heroku create
heroku addons:add bonsai
heroku config
(I was able to get my bonsai url successfully with the heroku config command)
The next step is
heroku config:set FB_NAME=<instance> FB_TOKEN="<token>"
But I don't really understand what FB_NAME (my guess is Firebase app name, but is that the name of my app? or with the letters/numbers following it due to the new Firebase setup where it's no longer app_name.firebaseio.com
but app_name-abc123.firebaseio.com
) and what is FB_TOKEN? (is it a key or something in my plist I download?)
To get your FB_NAME
(it's basically your Firebase project's ID):
- Go to
Project Settings
- Go to
General
tab - Copy your
Project ID
To get your FB_TOKEN
:
- Go to your Google Developer Console
- Select the project that is associated with your Firebase project
- Go to
Credentials
page - Create a new
API Key
or choose if you have an appropriate one already
Note: You can also set (and see) those variables in you Heroku project (if you don't want to set it from the terminal). To do that:
- Go to your Heroku project's
Settings
page - Click on the
Reveal Config Variables
button
Good luck.
这篇关于在Heroku上设置手电筒,使用新的Firebase进行ElasticSearch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!