Just use original source code, without any changes. Orignal can be found here: https://github.com/appwrite/templates/tree/main/node/sync-with-algolia
[Solved]Appwrite Database not Synchronising with Algolia
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 2: Process
So how do i connect this to my function ?
Rank 2: Process
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
Rank 2: Process
Oh, you mean i should update my codebase with the original source code which is the one you pasted here?
Rank 2: Process
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
Rank 2: Process
So which of the files will i update ?
Rank 2: Process
I already cleared the IDS added to the main.js file, so it's reading from the process.env
Does the execution work now?
Rank 2: Process
Rank 2: Process
I think so
Rank 2: Process
Let me check if the document is indexed on algolia
🎉
Rank 2: Process
How do i fix this format ?
Rank 2: Process
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.
Rank 2: Process
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.
Rank 2: Process
@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.
Rank 2: Process
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
Rank 2: Process
I have fixed it, thanks.
Rank 2: Process
[Solved]Appwrite Database not Synchronising with Algolia