typesense / firestore-typesense-search

Firebase Extension to automatically push Firestore documents to Typesense for full-text search with typo tolerance, faceting, and more
https://extensions.dev/extensions/typesense/firestore-typesense-search
Apache License 2.0
159 stars 35 forks source link

help setting up #19

Closed jonathan-chin closed 3 years ago

jonathan-chin commented 3 years ago

hi all. I'm running self hosted typesense on AWS via docker. I have nginx redirecting 80 and 443 traffic to locahost:8108, with SSL certificate etc.

if I visit my-domain.com/health, I get {"ok":true} back. I believe this means nginx is correctly redirecting traffic. however, when I try to trigger calls on firestore, I get this error:

{
  "textPayload": "Error: Request failed with HTTP code 404 | Server said: Not Found\n    at ApiCall._customErrorForResponse (/workspace/node_modules/typesense/lib/Typesense/ApiCall.js:378:26)\n    at ApiCall._callee$ (/workspace/node_modules/typesense/lib/Typesense/ApiCall.js:186:70)\n    at tryCatch (/workspace/node_modules/regenerator-runtime/runtime.js:63:40)\n    at Generator.invoke [as _invoke] (/workspace/node_modules/regenerator-runtime/runtime.js:293:22)\n    at Generator.next (/workspace/node_modules/regenerator-runtime/runtime.js:118:21)\n    at asyncGeneratorStep (/workspace/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)\n    at _next (/workspace/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)",
  "insertId": "000000-1be6577f-97bb-4c82-aa28-74f47012e713",
  "resource": {
    "type": "cloud_function",
    "labels": {
      "project_id": "modify-dev",
      "region": "us-central1",
      "function_name": "ext-firestore-typesense-search-indexToTypesenseOnFirestoreWrite"
    }
  },
  "timestamp": "2021-10-21T21:37:53.973Z",
  "severity": "ERROR",
  "labels": {
    "execution_id": "k67afrdv37p2"
  },
  "logName": "projects/modify-dev/logs/cloudfunctions.googleapis.com%2Fcloud-functions",
  "trace": "projects/modify-dev/traces/0f171f3a97592d67f6c842091303f0b5",
  "receiveTimestamp": "2021-10-21T21:38:03.542328289Z"
}

when looking at my nginx access logs, I can see that the extension does hit the server. any ideas?

jasonbosco commented 3 years ago

@jonathan-chin It sounds like you might not have created the collection in Typesense before installing the extension, hence the 404.

The extension does not auto-create the Typesense collection for you. See Step 1.3 here: https://github.com/typesense/firestore-typesense-search#1-setup-prerequisites

jonathan-chin commented 3 years ago

@jasonbosco yes, that worked! thanks for pointing me the right way. all I saw was the Install on Firebase button and I forgot about the rest of the instructions.

jasonbosco commented 3 years ago

Happy to help!