Compare commits
4 Commits
2634723958
...
4733438d3e
Author | SHA1 | Date |
---|---|---|
itepechi | 4733438d3e | |
itepechi | 1ce5f0a920 | |
itepechi | 5c19b8820f | |
itepechi | 059f3c4299 |
73
README.md
73
README.md
|
@ -117,7 +117,7 @@ podman exec -it akkoma-web \
|
||||||
--migrations-path priv/repo/optional_migrations/pgroonga
|
--migrations-path priv/repo/optional_migrations/pgroonga
|
||||||
```
|
```
|
||||||
|
|
||||||
You can revert the applied changes anytime by replacing `migrate` with `rollback`.
|
You can revert the applied changes at any time by replacing `migrate` with `rollback`.
|
||||||
|
|
||||||
### 5. Test your setup
|
### 5. Test your setup
|
||||||
|
|
||||||
|
@ -161,13 +161,24 @@ Follow the printed link to set your password.
|
||||||
|
|
||||||
#### Switch to PGroonga
|
#### Switch to PGroonga
|
||||||
|
|
||||||
Before moving forward, make sure you have stopped the backend for safety.
|
Before proceeding, make sure that `config :pleroma, :database, pgroonga_enabled` is set to `false`.
|
||||||
|
|
||||||
```sh
|
```ex
|
||||||
podman stop akkoma-web
|
config :pleroma, :database,
|
||||||
|
rum_enabled: false,
|
||||||
|
pgroonga_enabled: false
|
||||||
```
|
```
|
||||||
|
|
||||||
After stopping the backend, change `config :pleroma, :database, pgroonga_enabled` to `true`.
|
Then, run the command below to apply optional migrations to switch to PGroonga.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
podman exec -it akkoma-web \
|
||||||
|
pleroma_ctl \
|
||||||
|
migrate \
|
||||||
|
--migrations-path priv/repo/optional_migrations/pgroonga
|
||||||
|
```
|
||||||
|
|
||||||
|
After running the migration, change `config :pleroma, :database, pgroonga_enabled` to `true`.
|
||||||
|
|
||||||
```ex
|
```ex
|
||||||
config :pleroma, :database,
|
config :pleroma, :database,
|
||||||
|
@ -175,31 +186,47 @@ config :pleroma, :database,
|
||||||
pgroonga_enabled: true # set this option to true
|
pgroonga_enabled: true # set this option to true
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
Don't forget to restart your backend for the changes to take effect.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
podman run -d \
|
podman restart akkoma-web
|
||||||
--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 anytime by replacing `migrate` with `rollback`.
|
You can revert the applied changes at any time by replacing `migrate` with `rollback`.
|
||||||
|
|
||||||
Don't forget to start the container you stopped at the beginning of this guide.
|
#### 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.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
podman start akkoma-web
|
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'"
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
Loading…
Reference in New Issue