Skip to content

Commit 7ddca4a

Browse files
authored
apply patch and expect values for removing index (#2572)
1 parent dc70178 commit 7ddca4a

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

apps/fulltextsearch.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,18 @@ else
3636
reinstall_remove_menu "$SCRIPT_NAME"
3737
# Reset Full Text Search to be able to index again, and also remove the app to be able to install it again
3838
nextcloud_occ_no_check fulltextsearch:stop
39-
nextcloud_occ_no_check fulltextsearch:reset
39+
install_if_not expect
40+
REMOVE_FTS_INDEX=$(expect -c "
41+
set timeout 3
42+
spawn sudo -u www-data php $NCPATH/occ fulltextsearch:reset
43+
expect \"Do you really want to reset your indexed documents ? (y/N)\"
44+
send \"y\r\"
45+
expect \"Please confirm this destructive operation by typing 'reset ALL ALL':\"
46+
send \"reset ALL ALL\r\"
47+
expect eof
48+
")
49+
echo "$REMOVE_FTS_INDEX"
50+
apt -y purge expect
4051
# Drop database tables
4152
sudo -Hiu postgres psql "$NCDB" -c "DROP TABLE oc_fulltextsearch_ticks;"
4253
sudo -Hiu postgres psql "$NCDB" -c "DROP TABLE oc_fulltextsearch_index;"
@@ -180,6 +191,9 @@ install_and_enable_app fulltextsearch_elasticsearch
180191
install_and_enable_app files_fulltextsearch
181192
chown -R www-data:www-data "$NC_APPS_PATH"
182193

194+
# Apply patch
195+
git_apply_patch 319 fulltextsearch_elasticsearch 27.1.1 "$NCPATH/apps/fulltextsearch_elasticsearch"
196+
183197
# Final setup
184198
nextcloud_occ fulltextsearch:configure '{"search_platform":"OCA\\FullTextSearch_Elasticsearch\\Platform\\ElasticSearchPlatform"}'
185199
nextcloud_occ fulltextsearch_elasticsearch:configure "{\"elastic_host\":\"http://elastic:$ELASTIC_USER_PASSWORD@localhost:9200\",\"elastic_index\":\"${NEXTCLOUD_INDEX}\"}"

0 commit comments

Comments
 (0)