summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-04-10 13:18:23 +0300
committerAndrew Dolgov <[email protected]>2019-04-10 13:18:23 +0300
commitd32e191ad7e844cac1943f5352f0c4828eb71525 (patch)
tree7aa9e2e344048e7dbc7785d53c4b26b0f06a80e7 /plugins
parented22473272da765133ff259915d2a0836fba693a (diff)
import_export: set tsvector_combined using DEFAULT_SEARCH_LANGUAGE on import
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/import_export/init.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/import_export/init.php b/plugins/import_export/init.php
index a41786117..3b225e659 100755
--- a/plugins/import_export/init.php
+++ b/plugins/import_export/init.php
@@ -400,6 +400,21 @@ class Import_Export extends Plugin implements IHandler {
if ($res) {
+ if (DB_TYPE == "pgsql") {
+ $ts_lang = get_pref('DEFAULT_SEARCH_LANGUAGE', $owner_uid);
+ // TODO: maybe use per-feed setting if available?
+
+ $sth = $this->pdo->prepare("UPDATE ttrss_entries
+ SET tsvector_combined = to_tsvector(:ts_lang, :ts_content)
+ WHERE id = :id");
+
+ $sth->execute([
+ "id" => $ref_id,
+ "ts_lang" => $ts_lang,
+ "ts_content" => mb_substr(strip_tags($article['title'] . " " . $article['content']), 0, 900000)
+ ]);
+ }
+
$label_cache = json_decode($article['label_cache'], true);
if (is_array($label_cache) && $label_cache["no-labels"] != 1) {