]> git.mxchange.org Git - friendica.git/blobdiff - mod/search.php
Order search results by id
[friendica.git] / mod / search.php
index c42bcacfa007a3d675b0afea56ed8ef0b674f3ca..0790098a5373ae95333a383381f5be18ff01f9a9 100644 (file)
@@ -211,7 +211,8 @@ function search_content(App $a) {
                }
                dba::close($terms);
 
-               $items = Item::select(local_user(), [], ['id' => array_reverse($itemids)]);
+               $params = ['order' => ['id' => true]];
+               $items = Item::selectForUser(local_user(), [], ['id' => $itemids], $params);
                $r = dba::inArray($items);
        } else {
                logger("Start fulltext search for '".$search."'", LOGGER_DEBUG);
@@ -221,7 +222,7 @@ function search_content(App $a) {
                        local_user(), $search];
                $params = ['order' => ['id' => true],
                        'limit' => [$a->pager['start'], $a->pager['itemspage']]];
-               $items = Item::select(local_user(), [], $condition, $params);
+               $items = Item::selectForUser(local_user(), [], $condition, $params);
                $r = dba::inArray($items);
        }