
Just use original source code, without any changes. Orignal can be found here: https://github.com/appwrite/templates/tree/main/node/sync-with-algolia

So how do i connect this to my function ?

Not sure what you mean

You change code in your repository that you shared with me. By pushing to your repo, function is automatically deployed

Oh, you mean i should update my codebase with the original source code which is the one you pasted here?

Is that what you meant ?

Yes. That way you dont use any IDs in the code. Instead, it will read from process.env
, which should fix the problem

So which of the files will i update ?

I already cleared the IDS added to the main.js file, so it's reading from the process.env

Does the execution work now?


I think so

Let me check if the document is indexed on algolia

🎉

How do i fix this format ?


By default, template sync the whole document. As far as I understand, that's okay to do in Algolia. Inside Algolia dashboard you can configure which attributes are irrelevant, or which have higher priority.
Then, after you recieve results from Algolia after search, best practice is to only take ID, and using ID, search for the document in Appwrite. This way you have always up-to-date state of the document

If you only want to sync some information, you can rewrite the source code of the function to only sync parameters you need. Template is only meant as a starting point, you can customize it as much as you want.

Oh, okay. Must the template display the data as a JSON file?

Functions are fully customizable, and it's up to your imagination to change the template. All functions follow HTTP standard, so you can do anything you could do with any other HTTP server such as Express, Django or Laravel.

@Meldiron Can you guide me on how I can edit this to show only the details i want through Appwrite console, i configured my attributes on Algolia, but that of Appwrite i couldn't and my private data is still displaying.

This is how it's displaying on my Algolia index, i want it to be displayed this way on the Demo

You can hop into index.html
in the function, and change the way data is displayed in the demo. There is small JS code for it

I have fixed it, thanks.

[Solved]Appwrite Database not Synchronising with Algolia
Recommended threads
- Storage & Database is not allowing.
Storage & Database is not allowing to CRUD after i have logged in ? Using web SDK with next.js without any SSR or node-sdk.
- session client not allowed to create doc...
Hello all! So my issue is that I keep getting ERROR Error creating invitation: The requested service is disabled. You can enable the service from the Appwr...
- Help on importing data - error Unknown a...
Hey There! I want to create a local environment on my new computer, i wish to get the information i have on my staging appwrite cloud server. When running mig...
