fork of outlinewiki/outline with support of CJK search
318
This is a fix version for the known issue——Search should support CJK
Only server/models/helpers/SearchHelper.ts has been modified from original tag v1.6.1
Reference: danfate's fork https://github.com/danfate/outline/
1.Use pgroonga for full text search here
2.Create index:
CREATE EXTENSION IF NOT EXISTS pgroonga;
CREATE INDEX text_pgroonga_index ON documents USING pgroonga (text);
CREATE INDEX title_pgroonga_index
ON documents
USING pgroonga (title pgroonga_varchar_full_text_search_ops_v2);
3.Change code, inspired by @ckmarkhsu server/models/helpers/SearchHelper.ts :317
// Build the SQL query to get documentIds, ranking, and search term context
const whereClause = `
"searchVector" @@ to_tsquery('english', :query) AND
with
const keywords = `${"'" + query + "'"}`;
// Build the SQL query to get documentIds, ranking, and search term context
const whereClause = `
(text &@~ ${keywords} OR title &@~ ${keywords}) AND
Enjoy! :)
Content type
Image
Digest
sha256:f3db70e9a…
Size
261.7 MB
Last updated
7 months ago
docker pull foxzzz/outline