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
- Need help with createExecution function
Hi, Need some help understanding createExecution. When requesting function execution via createExecution, the function handler arguments are incorrect and rese...
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...