aboutsummaryrefslogtreecommitdiffstats
path: root/mod/network.php
diff options
context:
space:
mode:
authorMichael Vogel <icarus@dabo.de>2012-05-26 03:21:07 +0200
committerMichael Vogel <icarus@dabo.de>2012-05-26 03:21:07 +0200
commit49512105082dde72553f4250e6284920612cc6b8 (patch)
treee6222e7ca809b116af44d006218271bc36b5c009 /mod/network.php
parenta71e3134bf7250b60cafd1e51098eea70c3459de (diff)
downloadvolse-hubzilla-49512105082dde72553f4250e6284920612cc6b8.tar.gz
volse-hubzilla-49512105082dde72553f4250e6284920612cc6b8.tar.bz2
volse-hubzilla-49512105082dde72553f4250e6284920612cc6b8.zip
Speed optimisation by enabling the posibility of the MySQL fulltext engine
Diffstat (limited to 'mod/network.php')
-rw-r--r--mod/network.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/mod/network.php b/mod/network.php
index c6f683b93..f54d055d3 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -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 . '\\]%'))
+ );
+
}