From 33d5e5b818052bf2de2555a3e79bfdd4760beca4 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 18 Apr 2017 20:09:05 +0000 Subject: [PATCH] Issue 3157: No fulltext anymore --- mod/admin.php | 3 --- mod/network.php | 6 +----- mod/search.php | 7 +------ view/templates/admin_site.tpl | 1 - view/theme/frost/templates/admin_site.tpl | 1 - 5 files changed, 2 insertions(+), 16 deletions(-) diff --git a/mod/admin.php b/mod/admin.php index fe89faf44..c57e7f354 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -653,7 +653,6 @@ function admin_page_site_post(App $a) { $force_ssl = ((x($_POST,'force_ssl')) ? True : False); $hide_help = ((x($_POST,'hide_help')) ? True : False); $suppress_tags = ((x($_POST,'suppress_tags')) ? True : False); - $use_fulltext_engine = ((x($_POST,'use_fulltext_engine')) ? True : False); $itemcache = ((x($_POST,'itemcache')) ? notags(trim($_POST['itemcache'])) : ''); $itemcache_duration = ((x($_POST,'itemcache_duration')) ? intval($_POST['itemcache_duration']) : 0); $max_comments = ((x($_POST,'max_comments')) ? intval($_POST['max_comments']) : 0); @@ -802,7 +801,6 @@ function admin_page_site_post(App $a) { set_config('system', 'force_ssl', $force_ssl); set_config('system', 'hide_help', $hide_help); - set_config('system', 'use_fulltext_engine', $use_fulltext_engine); set_config('system', 'itemcache', $itemcache); set_config('system', 'itemcache_duration', $itemcache_duration); set_config('system', 'max_comments', $max_comments); @@ -1031,7 +1029,6 @@ function admin_page_site(App $a) { '$nodeinfo' => array('nodeinfo', t("Publish server information"), get_config('system','nodeinfo'), t("If enabled, general server and usage data will be published. The data contains the name and version of the server, number of users with public profiles, number of posts and the activated protocols and connectors. See the-federation.info for details.")), - '$use_fulltext_engine' => array('use_fulltext_engine', t("Use MySQL full text engine"), get_config('system','use_fulltext_engine'), t("Activates the full text engine. Speeds up search - but can only search for four and more characters.")), '$suppress_tags' => array('suppress_tags', t("Suppress Tags"), get_config('system','suppress_tags'), t("Suppress showing a list of hashtags at the end of the posting.")), '$itemcache' => array('itemcache', t("Path to item cache"), get_config('system','itemcache'), t("The item caches buffers generated bbcode and external images.")), '$itemcache_duration' => array('itemcache_duration', t("Cache duration in seconds"), get_config('system','itemcache_duration'), t("How long should the cache files be hold? Default value is 86400 seconds (One day). To disable the item cache, set the value to -1.")), diff --git a/mod/network.php b/mod/network.php index 5e94429b5..db4bb9130 100644 --- a/mod/network.php +++ b/mod/network.php @@ -581,11 +581,7 @@ function network_content(App $a, $update = 0) { $sql_order = "`item`.`id`"; $order_mode = "id"; } else { - // Disabled until final decision what to do with this - //if (get_config('system','use_fulltext_engine')) - // $sql_extra = sprintf(" AND MATCH (`item`.`body`, `item`.`title`) AGAINST ('%s' in boolean mode) ", dbesc(protect_sprintf($search))); - //else - $sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search)))); + $sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search)))); $sql_order = "`item`.`id`"; $order_mode = "id"; } diff --git a/mod/search.php b/mod/search.php index f274b2a87..a804ca32e 100644 --- a/mod/search.php +++ b/mod/search.php @@ -203,12 +203,7 @@ function search_content(App $a) { } else { logger("Start fulltext search for '".$search."'", LOGGER_DEBUG); - // Disabled until finally is decided how to proceed with this - //if (get_config('system','use_fulltext_engine')) { - // $sql_extra = sprintf(" AND MATCH (`item`.`body`, `item`.`title`) AGAINST ('%s' in boolean mode) ", dbesc(protect_sprintf($search))); - //} else { - $sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search)))); - //} + $sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search)))); $r = q("SELECT %s FROM `item` %s diff --git a/view/templates/admin_site.tpl b/view/templates/admin_site.tpl index 86efb26a2..196bc479b 100644 --- a/view/templates/admin_site.tpl +++ b/view/templates/admin_site.tpl @@ -138,7 +138,6 @@

{{$performance}}

- {{include file="field_checkbox.tpl" field=$only_tag_search}} {{include file="field_input.tpl" field=$itemcache}} {{include file="field_input.tpl" field=$itemcache_duration}} diff --git a/view/theme/frost/templates/admin_site.tpl b/view/theme/frost/templates/admin_site.tpl index 535242a3e..ab0b6af73 100644 --- a/view/theme/frost/templates/admin_site.tpl +++ b/view/theme/frost/templates/admin_site.tpl @@ -65,7 +65,6 @@ {{include file="field_input.tpl" field=$basepath}}

{{$performance}}

- {{include file="field_checkbox.tpl" field=$use_fulltext_engine}} {{include file="field_input.tpl" field=$itemcache}} {{include file="field_input.tpl" field=$itemcache_duration}}