diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-03-20 14:41:31 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-03-21 13:36:50 +0100 |
commit | 953b030e2678ce45d2f182c181ef2190f39d161d (patch) | |
tree | 0337988efca9bf3b714ca9af5e95e188d6ddb260 /db/item.php | |
parent | 03ce3af3a51f51852cd0a3f06872fc36d7f62dfb (diff) |
generate an index
Diffstat (limited to 'db/item.php')
-rw-r--r-- | db/item.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/db/item.php b/db/item.php index 24cc45de1..8c555db86 100644 --- a/db/item.php +++ b/db/item.php @@ -57,6 +57,7 @@ class Item extends Entity implements IAPI, \JsonSerializable { protected $feedId; protected $status = 0; protected $lastModified; + protected $searchIndex; public function __construct(){ $this->addType('pubDate', 'integer'); @@ -196,6 +197,16 @@ class Item extends Entity implements IAPI, \JsonSerializable { parent::setTitle(strip_tags($title)); } + public function generateSearchIndex() { + $this->setSearchIndex( + strtolower( + strip_tags($this->getBody()) . + $this->getAuthor() . + $this->getTitle() . + $this->getUrl() + ) + ); + } public function setUrl($url) { $url = trim($url); |