Search Engine
Configure the search capabilities of your wiki
Overview
Wiki.js has a powerful search engine to quickly find what you're looking for across your wiki. It relies on PostgreSQL's pg_trgm extension for trigram text matching.
Parameters
| Parameter | Description | Default |
|---|---|---|
| Enable Term Highlighting | Whether to show the highlighted terms in search results. There is a slight performance impact when enabled. | True |
| PostgreSQL Dictionary Mapping Overrides | JSON object of 2 letters locale codes and their PostgreSQL dictionary association to override. Built-in PostgreSQL languages do not need to be defined here and are already automatically mapped. | {} |
Operations
- Click the Rebuild Index button in the top-right corner to fully rebuild the search index. This should only be done for maintenance / fixing errors, as this is done automatically as content change.
Additional Configs
Some languages may require extra configuration / extensions to support full-text search.
Chinese
- Install zhparser. The official postgres image doesn't include it.
- Create the config in your database:SQL
CREATE EXTENSION zhparser; CREATE TEXT SEARCH CONFIGURATION chinese (PARSER = zhparser); ALTER TEXT SEARCH CONFIGURATION chinese ADD MAPPING FOR n,v,a,i,e,l WITH simple; - In Wiki.js, under the Administration Area Search Engine page, add the following to the PostgreSQL Dictionary Mapping Overrides field:JSON
{ "zh": "chinese" } - Click Apply.
- Click Rebuild Index.