How to run Algolia Firestore extension import script?
Asked Answered
B

1

9

I'm installing the Algolia extension for Firestore. Setup works just fine and it updates indices on add delete and update. But now I want to backfill it with existing data.

The following steps are provided in the setup guide but I have no clue on HOW to run that script. I've tried pasting it directly in node shell and powershell, adding it to a js or ps1 file and running that but I don't know what kind of script this is.

Firestore console

How do I run this script? (I have a service account json next to it)

Beriosova answered 10/6, 2021 at 6:25 Comment(1)
did you actually make this work? For me when running the script, the command is not completing. Also have this question up. Did it work for you ?Exon
B
6

It's bash...

It works when pasted directly in bash with spaces on each newline after the line terminator. Or as a .sh file from the commandline.

#!/bin/bash
LOCATION=europe-west3\
  ALGOLIA_APP_ID=xxx\
  ALGOLIA_API_KEY=xxx\
  ALGOLIA_INDEX_NAME=organizations\
  COLLECTION_PATH=organizations\
  FIELDS=name,address,city\
  GOOGLE_APPLICATION_CREDENTIALS=./xxx.json\
  npx firestore-algolia-search
Beriosova answered 10/6, 2021 at 6:58 Comment(2)
firebaser here Thanks for flagging and clarifying the documentation Jonathan. 👍 This could/should indeed have been made clearer in those instructions. I've flagged it with the team.Lollop
Frank this still has not been made clear. I have to this day still not have been successfull at running this script.Decane

© 2022 - 2024 — McMap. All rights reserved.