• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

Search with Chinese

Status
Not open for further replies.

NyaChan

Chevereto Member
Website URL
<private>

Chevereto version
3.10.4

Description of the issue
The search of Chinese characters is not working with MySQL full-text, is there a way to solve this?
Maria SQL version: 10.2.9 Stable

Reference: http://xiaorui.cc/2016/02/03/浅谈mysql-fulltext全文索引的优缺点/
https://dev.mysql.com/doc/refman/5.7/en/fulltext-restrictions.html
"In MySQL 5.7.6, a character-based ngram full-text parser that supports Chinese, Japanese, and Korean (CJK)"

I have no idea how to implement these, can you help me?
 
What you need to do is to re-create the table indexes using the ngram parser.

All fulltext indexes are on app/install/sql and this is at images.sql, this is the index used for image search function:
Code:
FULLTEXT KEY `searchindex` (`image_name`,`image_title`,`image_description`,`image_original_filename`)
Please note that this index is created on table creation, so is fulltext key <values>.

You need to drop that `searchindex` and then create a new index:
Code:
ALTER TABLE chv_images DROP INDEX `searchindex`;
ALTER TABLE chv_images ADD FULLTEXT INDEX `searchindex` (`image_name`,`image_title`,`image_description`,`image_original_filename`) WITH PARSER ngram;

Try that and see how it goes. Maybe the nparser needs to be tweaked to work properly, so try with that table and if it works then proceed to do the same for each fulltext index.
 
English search works, Chinese still doesn't work. Is there a way to let the search use LIKE method like in WordPress?
PHP:
$search .= "{$searchand}(($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}'))";
And can it search album and image name only?

Thank you for your patient.
 
Did you implemented the ngram parser or you just want me to change how search works?
 
Status
Not open for further replies.
Back
Top