From 0f9a1d70fad4af54a0d411b306427823476dcced Mon Sep 17 00:00:00 2001 From: happysalada Date: Tue, 21 Sep 2021 14:57:06 +0900 Subject: meilisearch: add docs --- nixos/modules/services/search/meilisearch.md | 39 ++++++++++++ nixos/modules/services/search/meilisearch.nix | 5 +- nixos/modules/services/search/meilisearch.xml | 85 +++++++++++++++++++++++++++ 3 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 nixos/modules/services/search/meilisearch.md create mode 100644 nixos/modules/services/search/meilisearch.xml (limited to 'nixos/modules') diff --git a/nixos/modules/services/search/meilisearch.md b/nixos/modules/services/search/meilisearch.md new file mode 100644 index 00000000000..98e7c542cb9 --- /dev/null +++ b/nixos/modules/services/search/meilisearch.md @@ -0,0 +1,39 @@ +# Meilisearch {#module-services-meilisearch} + +Meilisearch is a lightweight, fast and powerful search engine. Think elastic search with a much smaller footprint. + +## Quickstart + +the minimum to start meilisearch is + +```nix +services.meilisearch.enable = true; +``` + +this will start the http server included with meilisearch on port 7700. + +test with `curl -X GET 'http://localhost:7700/health'` + +## Usage + +you first need to add documents to an index before you can search for documents. + +### Add a documents to the `movies` index + +`curl -X POST 'http://127.0.0.1:7700/indexes/movies/documents' --data '[{"id": "123", "title": "Superman"}, {"id": 234, "title": "Batman"}]'` + +### Search documents in the `movies` index + +`curl 'http://127.0.0.1:7700/indexes/movies/search' --data '{ "q": "botman" }'` (note the typo is intentional and there to demonstrate the typo tolerant capabilities) + +## Defaults + +- The default nixos package doesn't come with the [dashboard](https://docs.meilisearch.com/learn/getting_started/quick_start.html#search), since the dashboard features makes some assets downloads at compile time. + +- Anonimized Analytics sent to meilisearch are disabled by default. + +- Default deployment is development mode. It doesn't require a secret master key. All routes are not protected and accessible. + +## Missing + +- the snapshot feature is not yet configurable from the module, it's just a matter of adding the relevant environment variables. diff --git a/nixos/modules/services/search/meilisearch.nix b/nixos/modules/services/search/meilisearch.nix index 9ed1a0e9053..f6210f6f16e 100644 --- a/nixos/modules/services/search/meilisearch.nix +++ b/nixos/modules/services/search/meilisearch.nix @@ -8,7 +8,10 @@ let in { - meta.maintainers = with maintainers; [ Br1ght0ne ]; + meta.maintainers = with maintainers; [ Br1ght0ne happysalada ]; + # Don't edit the docbook xml directly, edit the md and generate it: + # `pandoc meilisearch.md -t docbook --top-level-division=chapter --extract-media=media -f markdown+smart > meilisearch.xml` + meta.doc = ./meilisearch.xml; ###### interface diff --git a/nixos/modules/services/search/meilisearch.xml b/nixos/modules/services/search/meilisearch.xml new file mode 100644 index 00000000000..c1a73f358c2 --- /dev/null +++ b/nixos/modules/services/search/meilisearch.xml @@ -0,0 +1,85 @@ + + Meilisearch + + Meilisearch is a lightweight, fast and powerful search engine. Think + elastic search with a much smaller footprint. + +
+ Quickstart + + the minimum to start meilisearch is + + +services.meilisearch.enable = true; + + + this will start the http server included with meilisearch on port + 7700. + + + test with + curl -X GET 'http://localhost:7700/health' + +
+
+ Usage + + you first need to add documents to an index before you can search + for documents. + +
+ Add a documents to the <literal>movies</literal> + index + + curl -X POST 'http://127.0.0.1:7700/indexes/movies/documents' --data '[{"id": "123", "title": "Superman"}, {"id": 234, "title": "Batman"}]' + +
+
+ Search documents in the <literal>movies</literal> + index + + curl 'http://127.0.0.1:7700/indexes/movies/search' --data '{ "q": "botman" }' + (note the typo is intentional and there to demonstrate the typo + tolerant capabilities) + +
+
+
+ Defaults + + + + The default nixos package doesn’t come with the + dashboard, + since the dashboard features makes some assets downloads at + compile time. + + + + + Anonimized Analytics sent to meilisearch are disabled by + default. + + + + + Default deployment is development mode. It doesn’t require a + secret master key. All routes are not protected and + accessible. + + + +
+
+ Missing + + + + the snapshot feature is not yet configurable from the module, + it’s just a matter of adding the relevant environment + variables. + + + +
+
-- cgit 1.4.1