We're Hiring!

Mattermost, Inc.

Default_text_search_config setting not used


Postgres default_text_search_config was set to a new parser as outlined here https://docs.mattermost.com/install/i18n.html, but the actual MM text search still uses the default English parser.

Steps to reproduce

  • Using the latest community version 5.22
  • My install uses postgres and I just enabled the Chinese full text search following the steps outlined in the link above.
  • I can verify from the postgres command line that the parser defined in default_text_search_config works correctly.
    mattermost=# SELECT to_tsquery('保障房资金压力'); result: => to_tsquery '保障' & '房' & '资金' & '压力' (1 row)
  • then I move to try the search in the MM UI, from the trace log it seems it still loaded the default English, notice the log here to_tsvector method toward the end
    {"level":"debug","ts":1590501648.0632586,"caller":"sqlstore/supplier.go:125","msg":"sql-trace: SELECT * ,(SELECT COUNT(Posts.Id) FROM Posts WHERE q2.RootId = '' AND Posts.RootId = q2.Id AND Posts.DeleteAt = 0) as ReplyCount FROM Posts q2 WHERE DeleteAt = 0 AND Type NOT LIKE 'system_%' AND ChannelId IN ( SELECT Id FROM Channels, ChannelMembers WHERE Id = ChannelId AND (TeamId = $1 OR TeamId = '') AND UserId = $2 AND DeleteAt = 0 ) AND to_tsvector('english', Message) @@ to_tsquery('english', $3) ORDER BY CreateAt DESC LIMIT 100 [1:bueu4ri43b84bqe3twkc6izj3w 2:1z1dotz5wfrkxbaci1t6fg4oqc 3:(中文)] (15.90583ms)"}

Expected behavior

Expect the full text search should use the new parser that I defined

Observed behavior

see above

Does your issue sound similar to this thread with a proposed solution here Aliyun postgresql can't config default_text_search_config , how to enable chinese search?

Yes, I started there. the current release has a full text search that can only match the entire sentence for a post in Asian languages, because the double byte language doesn’t use space to separate words so the word vectorization doesn’t work

Actually, this is a bug that Mario at MM team is looking into https://mattermost.atlassian.net/browse/MM-25554