
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
- Local function throws EACCES error when ...
I am developing an Appwrite function locally. Up until now, the process has been as smooth as butter: I edit my files, save them, and this triggers a rebuild of...
- Collections not showing for relationship...
I am updating one of my databases. I have removed the majority of collection and started adding new collections. The new collections do not appear in the drop d...
- Creating Push Notification Results in Fa...
When creating a push notification using the Python API, I get this error for the status of my message. I call it using basically this: ```python def main(conte...
