mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-21 03:58:10 +01:00
Update 51-elasticsearch
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user