XF 2.0 Change minimum search keyword

Fastline

Active member
On my forum, the search keyboard length is 4. I changed it to 3 but unable to search. How can i fix this?
I'm using XF 2.0.x
 
You would have to set 'ft min word len' in MySQL configuration to '3' then restart the SQL server. After you change this value in MySQL and have restarted the SQL server, you need to rebuild all of the full text indexes on the server.
I'm not finding any details for the "rebuild all of the full text indexes on the server" part.

Find my.cnf files:
Code:
find / -name my.cnf
/etc/my.cnf
/usr/local/src/centminmod/config/mysql/my.cnf

This link https://electrictoolbox.com/mysql-full-text-index-word-length/ gives instructions for changing ft_min_word_len=3.
This one https://dev.mysql.com/doc/refman/8.0/en/fulltext-fine-tuning.html for InnoDB innodb_ft_min_token_size.
(XF currently uses MyISAM but will switch to InnoDB with v2.3)

Restart MySQL https://www.mysqltutorial.org/mysql-adminsitration/restart-mysql/ service mysql restart.

Repair:
The first two links above say REPAIR TABLE tbl_name QUICK;. But I'm not sure which tables I need to do that for.

https://www.askingbox.com/tip/mysql-change-minimum-word-length-for-full-text-search says REPAIR TABLE tab;. But that gives an error:
SQL:
MariaDB [myforum]> REPAIR TABLE tab;
+-------------+--------+----------+-----------------------------------+
| Table       | Op     | Msg_type | Msg_text                          |
+-------------+--------+----------+-----------------------------------+
| myforum.tab | repair | Error    | Table 'myforum.tab' doesn't exist |
| myforum.tab | repair | status   | Operation failed                  |
+-------------+--------+----------+-----------------------------------+
2 rows in set (0.002 sec)

There are multiple databases on my server:
SQL:
SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| myforum            |
| information_schema |
| mysql              |
| performance_schema |
| pgo_train          |
+--------------------+

And a ton of tables in the XF DB:
SQL:
SHOW TABLES;
+---------------------------------------+
| Tables_in_myforum                     |
+---------------------------------------+
| xf_activity_summary_definition        |
| xf_activity_summary_section           |
| xf_addon                              |
| xf_addon_install_batch                |
| xf_admin                              |
| xf_admin_log                          |
| xf_admin_navigation                   |
| xf_admin_permission                   |
| xf_admin_permission_entry             |
| xf_advertising                        |
| xf_advertising_position               |
| xf_andrew_mp_user_note                |
| xf_api_attachment_key                 |
| xf_api_key                            |
| xf_api_key_scope                      |
| xf_api_login_token                    |
| xf_api_scope                          |
| xf_approval_queue                     |
| xf_attachment                         |
| xf_attachment_data                    |
| xf_attachment_view                    |
| xf_awedo_post_areas                   |
| xf_ban_email                          |
| xf_bb_code                            |
| xf_bb_code_media_site                 |
| xf_bespoke_convfolders_folder         |
| xf_bespoke_convfolders_options        |
| xf_bookmark_item                      |
| xf_bookmark_label                     |
| xf_bookmark_label_use                 |
| xf_captcha_log                        |
| xf_captcha_question                   |
| xf_category                           |
| xf_change_log                         |
| xf_class_extension                    |
| xf_code_event                         |
| xf_code_event_listener                |
| xf_connected_account_provider         |
| xf_content_spam_cache                 |
| xf_content_type_field                 |
| xf_content_vote                       |
| xf_conversation_master                |
| xf_conversation_message               |
| xf_conversation_recipient             |
| xf_conversation_user                  |
| xf_cookie_consent_log                 |
| xf_cron_entry                         |
| xf_css_cache                          |
| xf_data_registry                      |
| xf_deletion_log                       |
| xf_draft                              |
| xf_edit_history                       |
| xf_editor_dropdown                    |
| xf_email_bounce_log                   |
| xf_email_bounce_soft                  |
| xf_error_log                          |
| xf_feed                               |
| xf_feed_log                           |
| xf_file_check                         |
| xf_find_new                           |
| xf_find_new_default                   |
| xf_flood_check                        |
| xf_forum                              |
| xf_forum_field                        |
| xf_forum_prefix                       |
| xf_forum_prompt                       |
| xf_forum_read                         |
| xf_forum_type                         |
| xf_forum_watch                        |
| xf_help_page                          |
| xf_image_proxy                        |
| xf_image_proxy_referrer               |
| xf_ip                                 |
| xf_ip_match                           |
| xf_job                                |
| xf_json_convert_error                 |
| xf_language                           |
| xf_liamw_post_macros                  |
| xf_liamw_post_macros_global_enrolment |
| xf_liamw_post_macros_shared           |
| xf_link_forum                         |
| xf_link_proxy                         |
| xf_link_proxy_referrer                |
| xf_login_attempt                      |
| xf_mail_queue                         |
| xf_member_stat                        |
| xf_moderator                          |
| xf_moderator_content                  |
| xf_moderator_log                      |
| xf_navigation                         |
| xf_navigation_type                    |
| xf_news_feed                          |
| xf_node                               |
| xf_node_type                          |
| xf_notice                             |
| xf_notice_dismissed                   |
| xf_oembed                             |
| xf_oembed_referrer                    |
| xf_option                             |
| xf_option_group                       |
| xf_option_group_relation              |
| xf_ozzmodz_sc_schedule                |
| xf_page                               |
| xf_payment_profile                    |
| xf_payment_provider                   |
| xf_payment_provider_log               |
| xf_permission                         |
| xf_permission_cache_content           |
| xf_permission_combination             |
| xf_permission_combination_user_group  |
| xf_permission_entry                   |
| xf_permission_entry_content           |
| xf_permission_interface_group         |
| xf_phrase                             |
| xf_phrase_compiled                    |
| xf_phrase_map                         |
| xf_poll                               |
| xf_poll_response                      |
| xf_poll_vote                          |
| xf_post                               |
| xf_pre_reg_action                     |
| xf_profile_post                       |
| xf_profile_post_comment               |
| xf_purchasable                        |
| xf_purchase_request                   |
| xf_reaction                           |
| xf_reaction_content                   |
| xf_registration_spam_cache            |
| xf_report                             |
| xf_report_comment                     |
| xf_route                              |
| xf_route_filter                       |
| xf_search                             |
| xf_search_forum                       |
| xf_search_forum_cache                 |
| xf_search_forum_cache_user            |
| xf_search_index                       |
| xf_session                            |
| xf_session_activity                   |
| xf_session_admin                      |
| xf_session_install                    |
| xf_sitemap                            |
| xf_smilie                             |
| xf_smilie_category                    |
| xf_spam_cleaner_log                   |
| xf_spam_trigger_log                   |
| xf_stats_daily                        |
| xf_style                              |
| xf_style_property                     |
| xf_style_property_group               |
| xf_style_property_map                 |
| xf_sv_user_alert_rebuild              |
| xf_sv_user_alert_summary              |
| xf_sv_warning_category                |
| xf_sv_warning_default                 |
| xf_sv_warning_log                     |
| xf_tag                                |
| xf_tag_content                        |
| xf_tag_result_cache                   |
| xf_template                           |
| xf_template_history                   |
| xf_template_map                       |
| xf_template_modification              |
| xf_template_modification_log          |
| xf_template_phrase                    |
| xf_tfa_attempt                        |
| xf_tfa_provider                       |
| xf_thread                             |
| xf_thread_field                       |
| xf_thread_field_value                 |
| xf_thread_prefix                      |
| xf_thread_prefix_group                |
| xf_thread_prompt                      |
| xf_thread_prompt_group                |
| xf_thread_question                    |
| xf_thread_read                        |
| xf_thread_redirect                    |
| xf_thread_reply_ban                   |
| xf_thread_type                        |
| xf_thread_user_post                   |
| xf_thread_view                        |
| xf_thread_watch                       |
| xf_trophy                             |
| xf_unfurl_result                      |
| xf_upgrade_check                      |
| xf_upgrade_job                        |
| xf_upgrade_log                        |
| xf_user                               |
| xf_user_alert                         |
| xf_user_alert_optout                  |
| xf_user_authenticate                  |
| xf_user_ban                           |
| xf_user_change_temp                   |
| xf_user_confirmation                  |
| xf_user_connected_account             |
| xf_user_field                         |
| xf_user_field_value                   |
| xf_user_follow                        |
| xf_user_group                         |
| xf_user_group_change                  |
| xf_user_group_promotion               |
| xf_user_group_promotion_log           |
| xf_user_group_relation                |
| xf_user_ignored                       |
| xf_user_option                        |
| xf_user_privacy                       |
| xf_user_profile                       |
| xf_user_push_optout                   |
| xf_user_push_subscription             |
| xf_user_reject                        |
| xf_user_remember                      |
| xf_user_tfa                           |
| xf_user_tfa_trusted                   |
| xf_user_title_ladder                  |
| xf_user_trophy                        |
| xf_user_upgrade                       |
| xf_user_upgrade_active                |
| xf_user_upgrade_expired               |
| xf_username_change                    |
| xf_warning                            |
| xf_warning_action                     |
| xf_warning_action_trigger             |
| xf_warning_definition                 |
| xf_widget                             |
| xf_widget_definition                  |
| xf_widget_position                    |
+---------------------------------------+
226 rows in set (0.001 sec)

Is it only REPAIR TABLE xf_search_index QUICK;?

Hmm, seems to have worked. Somewhere I read you can alternatively do the rebuild via the ACP /admin.php?tools/rebuild -> Rebuild search index, but it's better and quicker to do it with the mysql command. Correct me if I'm wrong.
 
Last edited:
Top Bottom