Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion apps/fulltextsearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;"
Expand Down Expand Up @@ -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}\"}"
Expand Down