Update 51-elasticsearch

This commit is contained in:
Alexandre
2021-11-06 08:00:40 +01:00
committed by GitHub
parent b9534d220e
commit 6a2bb34484

View File

@@ -39,11 +39,17 @@ else
done
chown -R abc:abc $NEXTCLOUD_PATH/apps
if bashio::config.has_value 'elasticsearch_server'; then
HOST=$(bashio::config 'elasticsearch_server')
else
bashio::log.warning 'Please define elasticsearch server url in addon options with the format "ip:port" such as "192.168.178.1:9200"'
HOST=$(bashio::network.ipv4_address)
HOST="${HOST%/*}:9200"
fi
# Final setup
echo "... settings apps"
#occ fulltextsearch:configure '{"search_platform":"ElasticSearchPlatform"}'
HOST=$(bashio::network.ipv4_address)
HOST=${HOST%/*}
$LAUNCHER fulltextsearch_elasticsearch:configure "{\"elastic_host\":\"http://$HOST:9200\"}" &>/dev/null
$LAUNCHER fulltextsearch_elasticsearch:configure "{\"elastic_index\":\"my_index\"}" &>/dev/null
$LAUNCHER fulltextsearch_elasticsearch:configure "{\"analyzer_tokenizer\":\"standard\"}" &>/dev/null
@@ -51,12 +57,12 @@ else
$LAUNCHER files_fulltextsearch:configure "{\"files_pdf\":\"1\",\"files_office\":\"1\"}" &>/dev/null || true
# Is server detected
# if [ curl $HOST:9200 ] &>/dev/null; then
# if [ curl $HOST ] &>/dev/null; then
# Wait further for cache for index to work
echo "Waiting for a few seconds before indexing starts..."
sleep 10s
if $LAUNCHER fulltextsearch:index &>/dev/null; then
bashio::log.info "Full Text Search was successfully installed!"
bashio::log.info "Full Text Search was successfully installed using elasticsearch server $HOST!"
else