Skip to content

Commit 6c8601b

Browse files
committed
📝 Update readme
1 parent db9318e commit 6c8601b

File tree

1 file changed

+16
-33
lines changed

1 file changed

+16
-33
lines changed

README.md

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,19 @@ ghost-meilisearch init --config config.json
115115
ghost-meilisearch sync --config config.json
116116
```
117117

118+
The CLI tool provides several other commands:
119+
120+
```bash
121+
# Index a single post by ID
122+
ghost-meilisearch index <post-id> --config config.json
123+
124+
# Delete a single post from the index by ID
125+
ghost-meilisearch delete <post-id> --config config.json
126+
127+
# Clear all documents from the index
128+
ghost-meilisearch clear --config config.json
129+
```
130+
118131
### 5. Set Up Real-Time Updates (Optional)
119132

120133
To keep your search index in sync with your content, you can deploy the webhook handler to your preferred platform:
@@ -125,7 +138,7 @@ To keep your search index in sync with your content, you can deploy the webhook
125138
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/mfydev/ghost-meilisearch)
126139
[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/mfydev/ghost-meilisearch)
127140

128-
1. Click one of the deployment buttons above
141+
1. Fork this repository
129142
2. Create a new API key which will be used by the webhook handler in Meilisearch, and set the `actions` to `["documents.add", "documents.get", "documents.delete"]` and `indexes` to `["ghost_posts"]`.
130143
```bash
131144
curl \
@@ -139,7 +152,8 @@ curl \
139152
"expiresAt": null
140153
}'
141154
```
142-
3. Set these environment variables in your platform's dashboard:
155+
3. Click one of the deployment buttons above
156+
4. Set these environment variables in your platform's dashboard:
143157
```env
144158
GHOST_URL=https://your-ghost-blog.com
145159
GHOST_KEY=your-content-api-key # From Ghost Admin
@@ -167,37 +181,6 @@ Add all four events (Post published, updated, deleted, unpublished) pointing to
167181

168182
Now your search index will automatically update when you publish, update, or delete posts!
169183

170-
## 🔍 Advanced Usage
171-
172-
### CLI Commands
173-
174-
The CLI tool provides several commands:
175-
176-
```bash
177-
# Initialize the index with the schema from config.json
178-
ghost-meilisearch init --config config.json
179-
180-
# Sync all posts from Ghost to Meilisearch
181-
ghost-meilisearch sync --config config.json
182-
183-
# Index a single post by ID
184-
ghost-meilisearch index <post-id> --config config.json
185-
186-
# Delete a single post from the index by ID
187-
ghost-meilisearch delete <post-id> --config config.json
188-
189-
# Clear all documents from the index
190-
ghost-meilisearch clear --config config.json
191-
```
192-
193-
## 🔒 Security
194-
195-
- **Never** use your Meilisearch master key in the frontend
196-
- Create a search-only API key with minimal permissions for the frontend
197-
- Use environment variables for sensitive keys in production
198-
- Enable the webhook secret to prevent unauthorized index updates
199-
- If self-hosting Meilisearch, place it behind a reverse proxy with HTTPS
200-
201184
## 📦 Packages
202185

203186
| Package | Description | Latest Version |

0 commit comments

Comments
 (0)