Enhanced SQL query so that the search is faster.
This commit is contained in:
parent
136626c199
commit
c0411ae25a
1 changed files with 2 additions and 2 deletions
|
@ -130,8 +130,8 @@ function search_content(&$a) {
|
|||
if($tag) {
|
||||
$sql_extra = "";
|
||||
|
||||
$sql_table = sprintf("`item` INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d) AS `term` ON `item`.`id` = `term`.`oid` ",
|
||||
dbesc(protect_sprintf($search)), intval(TERM_OBJ_POST), intval(TERM_HASHTAG));
|
||||
$sql_table = sprintf("`item` INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` IN (%d, 0)) AS `term` ON `item`.`id` = `term`.`oid` ",
|
||||
dbesc(protect_sprintf($search)), intval(TERM_OBJ_POST), intval(TERM_HASHTAG), intval(local_user()));
|
||||
|
||||
$sql_order = "`item`.`id`";
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue