mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-27 11:31:05 +00:00
Finished search engine function
Now searches also in title and in original url
This commit is contained in:
parent
d619120fc4
commit
cc60cbbbab
1 changed files with 2 additions and 2 deletions
|
@ -391,8 +391,8 @@ class Database {
|
||||||
|
|
||||||
public function search($term){
|
public function search($term){
|
||||||
$search = '%'.$term.'%';
|
$search = '%'.$term.'%';
|
||||||
$query = $this->getHandle()->prepare("SELECT * FROM entries WHERE content LIKE ?");
|
$query = $this->getHandle()->prepare("SELECT * FROM entries WHERE content LIKE ? OR title LIKE ? OR url LIKE ?"); //searches in content, title and URL
|
||||||
$query->execute(array($search));
|
$query->execute(array($search,$search,$search));
|
||||||
$entries = $query->fetchAll();
|
$entries = $query->fetchAll();
|
||||||
return $entries;
|
return $entries;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue