Add search index (#15)
- Add utility rebuild script - Add Search to header - Add shell of search page - Add search query support to ItemList
This commit is contained in:
@@ -134,6 +134,22 @@ class ItemList {
|
||||
"/feed/items?id=$feedId&bookmarked");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an item list with items matching given search terms
|
||||
*
|
||||
* @param string $search The item search terms / query
|
||||
* @param SQLite3 $db The database connection to use to obtain items
|
||||
* @return static An item list match the given search terms
|
||||
*/
|
||||
public static function matchingSearch(string $search, SQLite3 $db): static {
|
||||
$list = new static($db,
|
||||
self::makeQuery($db, ['item.id IN (SELECT ROWID FROM item_search WHERE content MATCH :search)'],
|
||||
[[':search', $search]]), 'Matching', "/search?search=$search");
|
||||
$list->showIndicators = true;
|
||||
$list->displayFeed = true;
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render this item list
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user