mirror of
https://github.com/chylex/Nextcloud-News.git
synced 2025-05-08 22:34:05 +02:00
adapt generateSearchIndex
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
This commit is contained in:
parent
51e6928a46
commit
a66d62d1d7
@ -170,16 +170,28 @@ class Item extends Entity implements IAPI, \JsonSerializable
|
|||||||
? implode('', $this->getCategories())
|
? implode('', $this->getCategories())
|
||||||
: '';
|
: '';
|
||||||
|
|
||||||
$this->setSearchIndex(
|
if (!is_null($this->getBody())) {
|
||||||
mb_strtolower(
|
$stripedBody = strip_tags($this->getBody());
|
||||||
html_entity_decode(strip_tags($this->getBody())) .
|
} else {
|
||||||
html_entity_decode($this->getAuthor()) .
|
$stripedBody = "";
|
||||||
html_entity_decode($this->getTitle()) .
|
}
|
||||||
html_entity_decode($categoriesString) .
|
|
||||||
$this->getUrl(),
|
$input_list = array($stripedBody, $this->getAuthor(), $this->getTitle(), $categoriesString);
|
||||||
'UTF-8'
|
|
||||||
)
|
$search_string = "";
|
||||||
);
|
|
||||||
|
foreach ($input_list as $value) {
|
||||||
|
if (is_null($value)){
|
||||||
|
$search_string .= "";
|
||||||
|
} else {
|
||||||
|
html_entity_decode($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$search_string .= $this->getUrl();
|
||||||
|
$search_string .= 'UTF-8';
|
||||||
|
|
||||||
|
$this->setSearchIndex(mb_strtolower($search_string));
|
||||||
$this->setFingerprint($this->computeFingerprint());
|
$this->setFingerprint($this->computeFingerprint());
|
||||||
$this->setContentHash($this->computeContentHash());
|
$this->setContentHash($this->computeContentHash());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user