|
| 1 | +# ⚡ Python Sync with Meilisearch Function |
| 2 | + |
| 3 | +Syncs documents in an Appwrite database collection to a Meilisearch index. |
| 4 | + |
| 5 | +## 🧰 Usage |
| 6 | + |
| 7 | +### GET / |
| 8 | + |
| 9 | +Returns HTML page where search can be performed to test the indexing. |
| 10 | + |
| 11 | +### POST / |
| 12 | + |
| 13 | +Triggers indexing of the Appwrite database collection to Meilisearch. |
| 14 | + |
| 15 | +**Response** |
| 16 | + |
| 17 | +Sample `204` Response: No content. |
| 18 | + |
| 19 | +## ⚙️ Configuration |
| 20 | + |
| 21 | +| Setting | Value | |
| 22 | +| ----------------- | --------------------------------- | |
| 23 | +| Runtime | Python (3.9) | |
| 24 | +| Entrypoint | `src/main.py` | |
| 25 | +| Build Commands | `pip install -r requirements.txt` | |
| 26 | +| Permissions | `any` | |
| 27 | +| Timeout (Seconds) | 15 | |
| 28 | + |
| 29 | +## 🔒 Environment Variables |
| 30 | + |
| 31 | +### APPWRITE_API_KEY |
| 32 | + |
| 33 | +API Key to talk to Appwrite backend APIs. |
| 34 | + |
| 35 | +| Question | Answer | |
| 36 | +| ------------- | -------------------------------------------------------------------------------------------------- | |
| 37 | +| Required | Yes | |
| 38 | +| Sample Value | `d1efb...aec35` | |
| 39 | +| Documentation | [Appwrite: Getting Started for Server](https://appwrite.io/docs/getting-started-for-server#apiKey) | |
| 40 | + |
| 41 | +### APPWRITE_DATABASE_ID |
| 42 | + |
| 43 | +The ID of the Appwrite database that contains the collection to sync. |
| 44 | + |
| 45 | +| Question | Answer | |
| 46 | +| ------------- | --------------------------------------------------------- | |
| 47 | +| Required | Yes | |
| 48 | +| Sample Value | `612a3...5b6c9` | |
| 49 | +| Documentation | [Appwrite: Databases](https://appwrite.io/docs/databases) | |
| 50 | + |
| 51 | +### APPWRITE_COLLECTION_ID |
| 52 | + |
| 53 | +The ID of the collection in the Appwrite database to sync. |
| 54 | + |
| 55 | +| Question | Answer | |
| 56 | +| ------------- | ------------------------------------------------------------- | |
| 57 | +| Required | Yes | |
| 58 | +| Sample Value | `7c3e8...2a9f1` | |
| 59 | +| Documentation | [Appwrite: Collections](https://appwrite.io/docs/databases#collection) | |
| 60 | + |
| 61 | +### APPWRITE_ENDPOINT |
| 62 | + |
| 63 | +The URL endpoint of the Appwrite server. If not provided, it defaults to the Appwrite Cloud server: `https://cloud.appwrite.io/v1`. |
| 64 | + |
| 65 | +| Question | Answer | |
| 66 | +| ------------ | ------------------------------ | |
| 67 | +| Required | No | |
| 68 | +| Sample Value | `https://cloud.appwrite.io/v1` | |
| 69 | + |
| 70 | +### MEILISEARCH_ENDPOINT |
| 71 | + |
| 72 | +The host URL of the Meilisearch server. |
| 73 | + |
| 74 | +| Question | Answer | |
| 75 | +| ------------ | ----------------------- | |
| 76 | +| Required | Yes | |
| 77 | +| Sample Value | `http://127.0.0.1:7700` | |
| 78 | + |
| 79 | +### MEILISEARCH_ADMIN_API_KEY |
| 80 | + |
| 81 | +The admin API key for Meilisearch. |
| 82 | + |
| 83 | +| Question | Answer | |
| 84 | +| ------------- | ------------------------------------------------------------------------ | |
| 85 | +| Required | Yes | |
| 86 | +| Sample Value | `masterKey1234` | |
| 87 | +| Documentation | [Meilisearch: API Keys](https://docs.meilisearch.com/reference/api/keys) | |
| 88 | + |
| 89 | +### MEILISEARCH_INDEX_NAME |
| 90 | + |
| 91 | +Name of the Meilisearch index to which the documents will be synchronized. |
| 92 | + |
| 93 | +| Question | Answer | |
| 94 | +| ------------ | ---------- | |
| 95 | +| Required | Yes | |
| 96 | +| Sample Value | `my_index` | |
| 97 | + |
| 98 | +### MEILISEARCH_SEARCH_API_KEY |
| 99 | + |
| 100 | +API Key for Meilisearch search operations. |
| 101 | + |
| 102 | +| Question | Answer | |
| 103 | +| ------------- | ------------------------------------------------------------------------ | |
| 104 | +| Required | Yes | |
| 105 | +| Sample Value | `searchKey1234` | |
| 106 | +| Documentation | [Meilisearch: API Keys](https://docs.meilisearch.com/reference/api/keys) | |
0 commit comments