Add description for initial_indexing_chunk_size
[akkoma] / docs / configuration / search.md
index e9743f1a45bd4abd9e966579e4cc5598dd7b9b97..a785a18ad100eb388ce3074139c3322c9b3fa639 100644 (file)
@@ -6,7 +6,7 @@
 
 To use built-in search that has no external dependencies, set the search module to `Pleroma.Activity`:
 
-> config :pleroma, Pleroma.Search, module: Pleroma.Activity
+> config :pleroma, Pleroma.Search, module: Pleroma.Search.DatabaseSearch
 
 While it has no external dependencies, it has problems with performance and relevancy.
 
@@ -25,11 +25,15 @@ To use [meilisearch](https://www.meilisearch.com/), set the search module to `Pl
 
 > config :pleroma, Pleroma.Search, module: Pleroma.Search.Meilisearch
 
-You then need to set the address of the meilisearch instance, and optionally the private key for authentication.
+You then need to set the address of the meilisearch instance, and optionally the private key for authentication. You might
+also want to change the `initial_indexing_chunk_size` to be smaller if you're server is not very powerful, but not higher than `100_000`,
+because meilisearch will refuse to process it if it's too big. However, in general you want this to be as big as possible, because meilisearch
+indexes faster when it can process many posts in a single batch.
 
 > config :pleroma, Pleroma.Search.Meilisearch,
 >    url: "http://127.0.0.1:7700/",
->    private_key: "private key"
+>    private_key: "private key",
+>    initial_indexing_chunk_size: 100_000
 
 Information about setting up meilisearch can be found in the
 [official documentation](https://docs.meilisearch.com/learn/getting_started/installation.html).
@@ -60,7 +64,16 @@ have to do it one time, but it might take a while, depending on the amount of po
 consuming process for `meilisearch`, and it will take a lot of RAM when running if you have a lot of posts (seems to be around 5G for ~1.2
 million posts while idle and up to 7G while indexing initially, but your experience may be different).
 
-To start te initial indexing, run the `index` command:
+The sequence of actions is as follows:
+
+1. First, change the configuration to use `Pleroma.Search.Meilisearch` as the search backend
+2. Restart your instance, at this point it can be used while the search indexing is running, though search won't return anything
+3. Start the initial indexing process (as described below with `index`),
+   and wait until the task says it sent everything from the database to index
+4. Wait until everything is actually indexed (by checking with `stats` as described below),
+   at this point you don't have to do anything, just wait a while.
+
+To start the initial indexing, run the `index` command:
 
 === "OTP"
     ```sh