⚡ Lightning Fast, Ultra Relevant, and Typo-Tolerant Search Engine 🔍
- Login as Super User
sudo su
- Install MeiliSearch (Ubuntu)
curl -L https://install.meilisearch.com | sh
- Move the MeiliSearch binary to your system binaries
mv ./meilisearch /usr/bin/
- Create a service file
- Specify Host, e.g.
--http-addr 127.0.0.1:7700
- Specify Environment, e.g.
--env production
- Specify Master Key, e.g.
--master-key MasterKey
- Specify Database Path, e.g.
--db-path /root/data.ms
- Specify Host, e.g.
cat << EOF > /etc/systemd/system/meilisearch.service
[Unit]
Description=MeiliSearch
After=systemd-user-sessions.service
[Service]
Type=simple
ExecStart=/usr/bin/meilisearch --http-addr 127.0.0.1:7700 --env production --master-key MasterKey --db-path /root/data.ms
[Install]
WantedBy=default.target
EOF
- Enable and start service
systemctl enable meilisearch
systemctl start meilisearch
systemctl status meilisearch
curl \
-X GET 'http://127.0.0.1:7700/version' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MasterKey' | python3 -mjson.tool
curl \
-X GET 'http://127.0.0.1:7700/indexes' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MasterKey' | python3 -mjson.tool
curl \
-X POST 'http://127.0.0.1:7700/indexes' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MasterKey' \
--data-binary '{
"uid": "users",
"primaryKey": "id"
}' | python3 -mjson.tool
curl \
-X DELETE 'http://127.0.0.1:7700/indexes/users' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MasterKey' | python3 -mjson.tool
curl \
-X GET 'http://127.0.0.1:7700/tasks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MasterKey' | python3 -mjson.tool
curl \
-X GET 'http://127.0.0.1:7700/indexes/users/tasks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MasterKey' | python3 -mjson.tool
curl \
-X GET 'http://127.0.0.1:7700/indexes/users/documents' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MasterKey' | python3 -mjson.tool
curl \
-X POST 'http://127.0.0.1:7700/indexes/users/documents' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MasterKey' \
--data-binary '[
{
"id": 1,
"name": "Eliyas Hossain",
"email" "[email protected]"
}
]' | python3 -mjson.tool
curl \
-X POST 'http://127.0.0.1:7700/indexes/users/search' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MasterKey' \
--data-binary '{ "q": "eliyas" }' | python3 -mjson.tool
curl \
-X GET 'http://127.0.0.1:7700/indexes/users/settings' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MasterKey' | python3 -mjson.tool
curl \
-X POST 'http://127.0.0.1:7700/indexes/users/settings/displayed-attributes' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MasterKey' \
--data-binary '[
"id",
"name",
"email",
"avatar"
]' | python3 -mjson.tool
curl \
-X POST 'http://127.0.0.1:7700/indexes/users/settings/searchable-attributes' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MasterKey' \
--data-binary '[
"name",
"email"
]' | python3 -mjson.tool
curl \
-X POST 'http://127.0.0.1:7700/indexes/users/settings/filterable-attributes' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MasterKey' \
--data-binary '[
"id",
"email"
]' | python3 -mjson.tool
curl \
-X POST 'http://127.0.0.1:7700/indexes/users/settings/sortable-attributes' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MasterKey' \
--data-binary '[
"id",
"name"
]' | python3 -mjson.tool
curl \
-X POST 'http://127.0.0.1:7700/indexes/users/settings/ranking-rules' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MasterKey' \
--data-binary '[
"words",
"sort",
"typo",
"proximity",
"attribute",
"exactness"
]' | python3 -mjson.tool