From 7ddca4a71d0ff85952a574627b4328fd022dc2bc Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Fri, 29 Sep 2023 14:19:31 +0200 Subject: [PATCH] apply patch and expect values for removing index (#2572) --- apps/fulltextsearch.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/apps/fulltextsearch.sh b/apps/fulltextsearch.sh index f690b572..9cc9e205 100644 --- a/apps/fulltextsearch.sh +++ b/apps/fulltextsearch.sh @@ -36,7 +36,18 @@ else reinstall_remove_menu "$SCRIPT_NAME" # Reset Full Text Search to be able to index again, and also remove the app to be able to install it again nextcloud_occ_no_check fulltextsearch:stop - nextcloud_occ_no_check fulltextsearch:reset + install_if_not expect + REMOVE_FTS_INDEX=$(expect -c " + set timeout 3 + spawn sudo -u www-data php $NCPATH/occ fulltextsearch:reset + expect \"Do you really want to reset your indexed documents ? (y/N)\" + send \"y\r\" + expect \"Please confirm this destructive operation by typing 'reset ALL ALL':\" + send \"reset ALL ALL\r\" + expect eof + ") + echo "$REMOVE_FTS_INDEX" + apt -y purge expect # Drop database tables sudo -Hiu postgres psql "$NCDB" -c "DROP TABLE oc_fulltextsearch_ticks;" sudo -Hiu postgres psql "$NCDB" -c "DROP TABLE oc_fulltextsearch_index;" @@ -180,6 +191,9 @@ install_and_enable_app fulltextsearch_elasticsearch install_and_enable_app files_fulltextsearch chown -R www-data:www-data "$NC_APPS_PATH" +# Apply patch +git_apply_patch 319 fulltextsearch_elasticsearch 27.1.1 "$NCPATH/apps/fulltextsearch_elasticsearch" + # Final setup nextcloud_occ fulltextsearch:configure '{"search_platform":"OCA\\FullTextSearch_Elasticsearch\\Platform\\ElasticSearchPlatform"}' nextcloud_occ fulltextsearch_elasticsearch:configure "{\"elastic_host\":\"http://elastic:$ELASTIC_USER_PASSWORD@localhost:9200\",\"elastic_index\":\"${NEXTCLOUD_INDEX}\"}"