Wow man this is amazing, this weekend I know what I will thinker with then 👍️ .
I did a rough translation with DeepL if someone else is interested too
Plugin address: https://github.com/ganuonglachanh/flarum-sonic
Test environment.
flarum 1.0.4
php 7.4
mysql 5.7
1. configure Sonic config.cfg
(the following directory, configuration, etc. are only for demonstration purposes, you can change them yourself if you need to)
Enter the root directory (again, the directory is only for demonstration, adjust it yourself as needed), create a new folder named sonic, create a new file named config.cfg, and fill in the following configuration.
[server]
log_level = "error"
[channel]
inet = "0.0.0.0:1491"
tcp_timeout = 30
auth_password = "SecretPassword"
[channel.search]
query_limit_default = 10
query_limit_maximum = 100
query_alternates_try = 4
suggest_limit_default = 5
suggest_limit_maximum = 20
[store]
[store.kv]
path = "/var/lib/sonic/store/kv/"
retain_word_objects = 1000
[store.kv.pool]
inactive_after = 1800
[store.kv.database]
flush_after = 900
compress = true
parallelism = 2
max_files = 100
max_compactions = 1
max_flushes = 1
write_buffer = 16384
write_ahead_log = true
[store.fst]
path = "/var/lib/sonic/store/fst/"
[store.fst.pool]
inactive_after = 300
[store.fst.graph]
consolidate_after = 180
max_size = 2048
max_words = 250000
2. Install Sonic
Take docker as an example.
First, search for docker installation method, and then daemon run (note the directory location, you did not change the above that this side also do not need to change):.
docker run -d -p 1491:1491 -v ~/sonic/config.cfg:/etc/sonic.cfg -v ~/sonic/store/:/var/lib/sonic/store/ valeriansaliou/sonic:v1.3.0
3. install plug-ins
composer require ganuonglachanh/sonic
3. background settings, just fill in the default
4. create index (just run this once after installation)
php flarum sonic:addtoindex
Known problems:
The code is not deleted clean ... console output "Hello, Forum!", mention the pr has merge, not yet packaged the new version, a small problem does not hurt.
Search "two Chinese characters" + special characters when there are problems, for example: the title "[one two] three, four, five, six, seven, eight, nine", then the search bar input "[one two]" is not searched. of. ("one or two" for the English search will get)
In addition, the search "three or four" + space + "five or six" can not search, but "three or four" + space + "seven or eight" is searched.
The above problems are also harmless little problems, can already be used, the speed is also very fast (the advantages of the official repo instructions).
Do not want to use it is also very simple, directly turn off the plug-in, the container to stop on the line.
Translated with www.DeepL.com/Translator (free version)