zeed
April 14, 2019, 3:25am
1
Describe the problem you’re having:
The manually saved articles are not searchable.
tt-rss version (including git commit id):
19.02
Platform (i.e. Linux distro, PHP, PostgreSQL, etc) versions:
PostgreSQL
Please provide any additional information below:
It seems that create_published_article doesn’t update the tsvector_combined. I wonder if copying the code from rssutils.php to article.php would work.
I there anything more that I should pay attention to?
list($pfclass,$pfaction) = explode(":", $pfn["param"]);
if (isset($plugin_filter_actions[$pfclass])) {
$plugin = $pluginhost->get_plugin($pfclass);
Debug::log("... $pfclass: $pfaction", Debug::LOG_VERBOSE);
if ($plugin) {
$start = microtime(true);
$article = $plugin->hook_article_filter_action($article, $pfaction);
Debug::log(sprintf("=== %.4f (sec)", microtime(true) - $start), Debug::LOG_VERBOSE);
} else {
Debug::log("??? $pfclass: plugin object not found.", Debug::LOG_VERBOSE);
}
} else {
Debug::log("??? $pfclass: filter plugin not registered.", Debug::LOG_VERBOSE);
}
}
}
$sth->execute($params);
}
$sth = $pdo->prepare("INSERT INTO ttrss_user_entries
(ref_id, uuid, feed_id, orig_feed_id, owner_uid, published, tag_cache, label_cache,
last_read, note, unread, last_published)
VALUES
(?, '', NULL, NULL, ?, true, '', '', NOW(), '', false, NOW())");
$sth->execute([$ref_id, $owner_uid]);
if (count($labels) != 0) {
foreach ($labels as $label) {
Labels::add_article($ref_id, trim($label), $owner_uid);
}
}
$rc = true;
}
}
$pdo->commit();
zeed
April 14, 2019, 3:43am
2
It seems to be working. Here is what I have added:
if (DB_TYPE == "pgsql"){
$sth = $pdo->prepare("UPDATE ttrss_entries
SET tsvector_combined = to_tsvector( :ts_content)
WHERE id = :id");
$params = [
":ts_content" => mb_substr(strip_tags($content ), 0, 900000),
":id" => $ref_id];
$sth->execute($params);
}
But I still wonder if I am not doing it properly.
fox
April 14, 2019, 4:03am
3
this seems fine, it would be great if you made a PR with this. you’ll need to register on gogs, etc.
zeed
April 14, 2019, 5:13am
4
I seems that I can not fork on gogs. It says that the upper limit of the number of my repos is zero.
Can you help me commit the code directly?
Also, do you think it is good to add a rebuild index feature that fetches all the articles in the database and update the “tsvector_combined” and maybe also sphinx?
fox
April 14, 2019, 5:26am
5
https://discourse.tt-rss.org/t/pull-requests-gogs-spam/1850
zeed:
rebuild index feature
there’s one already in update.php but it’s currently hardcoded to English language, i think.
fox
April 14, 2019, 5:28am
6
if your account name is the same as here, you should be able to fork things now.