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

Firestore functions doesn't push data to typesense schema #22

Closed acobre closed 2 years ago

acobre commented 2 years ago

Hi all! i've create a typesense schema like this: const myCollection = { 'name': 'products', 'fields': [ {"name": ".*", "type": "auto" } ] } then, i've installed firestore extension and link "products" schema to a firestore DB collection. But the functions doesn't work.

When I tried backfill, function throw this error:

image

When I tried to add a document the function doesn't throw an error but in the typesense schema doesn't appear. On delete the same document, the function throw this error:

image

It seems that firestore extension cannot comunicate with typesense schema. Can you help me?

jasonbosco commented 2 years ago

@OCALAB Could you share the name of your Firestore collection and also a sample Firestore document?

acobre commented 2 years ago

Hi @jasonbosco I think that this isn't an error that depends on Firestore document structure. I've tryed to push a simple document like { id: 'Test', title: 'test' } as you can see on log screenshots, but the same error persist. The collection is called "Products".

I've a self-hosted Typesense. Throught the API i'm able to push/retrive data correctly.

acobre commented 2 years ago

Hi @jasonbosco Maybe i've found the error. In "Host" param of Search Firestore with Typesense extension i've write: mydomain.com:8108.

In Google Cloud Error Reporting notification i've seen that the function Backfill call an invalid URL https://mydomain.com:8108:443/collections/products/documents/import

image

how can i configure the extension for self-hosted typesense?

jasonbosco commented 2 years ago

@OCALAB Good eye! The extension only supports sending data over HTTPS/443 because the data goes from Firestore over the internet to Typesense (regardless of whether its self-hosted or on Typesense Cloud). And we don't want to expose unencrypted data to the public internet.

Could you get may be LetsEncrypt SSL certs and use that to start your Typesense node on port 443?

acobre commented 2 years ago

hi @jasonbosco. I've restart Typesense on port 443 and issued a LetsEncrypt SSL cert. Everything work properly. Many thanks for you help!