]> git.mxchange.org Git - friendica.git/blobdiff - mod/network.php
Speed optimisation by enabling the posibility of the MySQL fulltext engine
[friendica.git] / mod / network.php
index c6f683b935f4ac8374edea125df9a0de2c759761..f54d055d385343597631943bc78f0b2a2a3a4714 100644 (file)
@@ -416,11 +416,19 @@ function network_content(&$a, $update = 0) {
                $myurl = substr($myurl,strpos($myurl,'://')+3);
                $myurl = str_replace(array('www.','.'),array('','\\.'),$myurl);
                $diasp_url = str_replace('/profile/','/u/',$myurl);
-               $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` like '%s' or `tag` like '%s' or tag like '%s' )) ",
-                       dbesc(protect_sprintf('%' . $myurl)),
-                       dbesc(protect_sprintf('%' . $myurl . '\\]%')),
-                       dbesc(protect_sprintf('%' . $diasp_url . '\\]%'))
-               );
+               if (get_config('system','use_fulltext_engine'))
+                       $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where (MATCH(`author-link`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(`tag`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(tag) AGAINST ('".'"%s"'."' in boolean mode))) ",
+                               dbesc(protect_sprintf($myurl)),
+                               dbesc(protect_sprintf($myurl)),
+                               dbesc(protect_sprintf($diasp_url))
+                       );
+               else
+                       $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` like '%s' or `tag` like '%s' or tag like '%s' )) ",
+                               dbesc(protect_sprintf('%' . $myurl)),
+                               dbesc(protect_sprintf('%' . $myurl . '\\]%')),
+                               dbesc(protect_sprintf('%' . $diasp_url . '\\]%'))
+                       );
+
        }