How to create an Elasticsearch index with firebase RTDB

Viewed 195

Elasticsearch seems to expect the json data to be an array but firebase real time database stores the data in a gigantic object which makes it impossible to create a search index. I'm trying to build an autocomplete. Not sure if I'm missing something here.

1 Answers

As concluded it's not possible to directly copy/paste the RTDB into the elastic search index. I solved it this way.

  1. Export the RTDB (json object) from firebase console.
  2. Create a script that takes the raw database json object and destructure it into an array (after removing some unwanted keys).
  3. Do a fetch POST to the elastic engine using the url and private key provided by elastic search (app search in my case).
  4. You have now successfully created an elastic search index from your RTDB.
Related