Compare commits

..

No commits in common. "4733438d3eb6cd8cf2d5a05b8f8d77e347e959d8" and "2634723958ea4397e8106e1f42fc79f03ff6857d" have entirely different histories.

View file

@ -117,7 +117,7 @@ podman exec -it akkoma-web \
--migrations-path priv/repo/optional_migrations/pgroonga
```
You can revert the applied changes at any time by replacing `migrate` with `rollback`.
You can revert the applied changes anytime by replacing `migrate` with `rollback`.
### 5. Test your setup
@ -161,24 +161,13 @@ Follow the printed link to set your password.
#### Switch to PGroonga
Before proceeding, make sure that `config :pleroma, :database, pgroonga_enabled` is set to `false`.
```ex
config :pleroma, :database,
rum_enabled: false,
pgroonga_enabled: false
```
Then, run the command below to apply optional migrations to switch to PGroonga.
Before moving forward, make sure you have stopped the backend for safety.
```sh
podman exec -it akkoma-web \
pleroma_ctl \
migrate \
--migrations-path priv/repo/optional_migrations/pgroonga
podman stop akkoma-web
```
After running the migration, change `config :pleroma, :database, pgroonga_enabled` to `true`.
After stopping the backend, change `config :pleroma, :database, pgroonga_enabled` to `true`.
```ex
config :pleroma, :database,
@ -186,47 +175,31 @@ config :pleroma, :database,
pgroonga_enabled: true # set this option to true
```
Don't forget to restart your backend for the changes to take effect.
If you have command history enabled in your shell, all you need to do is remove the `--name NAME` option and add `pleroma_ctl migrate --migrations-path priv/repo/optional_migrations/pgroonga` to the end of the command.
```sh
podman restart akkoma-web
podman run -d \
--pod akkoma-pod \
--restart unless-stopped \ # this option is optional (bruh)
# --name akkoma-web \ # make sure to remove this option to avoid name conflict
-e DB_NAME=YOUR_DB_NAME \
-e DB_USER=YOUR_DB_USER \
-e DB_PASS=YOUR_DB_PASS \
-v ${PWD}/static/:/var/lib/akkoma/static/:Z \
-v ${PWD}/uploads/:/var/lib/akkoma/uploads/:Z \
-v ${PWD}/etc/:/etc/akkoma/:Z \
akkoma \
pleroma_ctl \
migrate \
--migrations-path priv/repo/optional_migrations/pgroonga
```
You can revert the applied changes at any time by replacing `migrate` with `rollback`.
You can revert the applied changes anytime by replacing `migrate` with `rollback`.
#### Change PGroonga indexing options
By default, PGroonga uses a bigram tokenizer with prefix matching enabled.
If you're not happy with this, you can change the behavior using the `database set_pgroonga_options` command.
If you want to support Japanese in your instance and do not want "東京都" (Tokyo-to) to match "京都" (Kyoto), pass `TokenMecab` as the tokenizer.
Don't forget to start the container you stopped at the beginning of this guide.
```sh
podman exec -it akkoma-web \
pleroma_ctl \
database \
set_pgroonga_options "tokenizer='TokenMecab'"
```
If you want to disable prefix matching, e.g. you want "akko" to match "Akko is cute!" but not "Akkoma is cool!", pass `hash_table` as lexicon type.
```sh
podman exec -it akkoma-web \
pleroma_ctl \
database \
set_pgroonga_options "lexicon_type='hash_table'"
```
If you want to set multiple options, simply concatenate them with a comma.
_Do not add spaces after commas or Elixir will complain. **You have been warned!**_
```sh
podman exec -it akkoma-web \
pleroma_ctl \
database \
set_pgroonga_options "tokenizer='TokenMecab',lexicon_type='hash_table'"
podman start akkoma-web
```
---