]> BookStack Code Mirror - website/blob - search/util.sh
Updated meilisearch setup
[website] / search / util.sh
1 #!/bin/bash
2
3 # This is a collection of common utilities to help manage the Meilisearch instance
4
5 #### Export the key to use as an environment variable
6 export MEILISEARCH_API_KEY='mLg0ioHwp2BnG5Rbxkj3ZFL6t1Y9DDmHUkUBpZ0zqmA'
7
8 ### Create a key
9 curl \
10   -X POST 'http://localhost:7700/keys' \
11   -H 'Content-Type: application/json' \
12   -H "Authorization: Bearer $MEILISEARCH_API_KEY" \
13   --data-binary '{
14     "description": "Search docs key",
15     "actions": ["search"],
16     "indexes": ["docs"],
17     "expiresAt": "2033-01-01T00:00:00Z"
18   }'