get elasticsearch index from settings too
This commit is contained in:
parent
4a610346cc
commit
59b8ccde1f
1 changed files with 8 additions and 2 deletions
|
@ -234,11 +234,17 @@ function setup_elasticsearch () {
|
||||||
ES_CONNECTION="http://127.0.0.1:9200"
|
ES_CONNECTION="http://127.0.0.1:9200"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ES_INDEX="$(zammad run rails r "puts Setting.get('es_index')" 2>> /dev/null)"
|
||||||
|
|
||||||
|
if [ -z "${ES_INDEX}" ]; then
|
||||||
|
ES_INDEX="zammad_production"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$(/usr/share/elasticsearch/bin/elasticsearch-plugin list | grep mapper-attachments)" ]; then
|
if [ -n "$(/usr/share/elasticsearch/bin/elasticsearch-plugin list | grep mapper-attachments)" ]; then
|
||||||
REBUILD_ES_SEARCHINDEX="yes"
|
REBUILD_ES_SEARCHINDEX="yes"
|
||||||
|
|
||||||
echo "# Deleting old zammad_production elasticsearch index..."
|
echo "# Deleting old ${ES_INDEX} elasticsearch index..."
|
||||||
curl -XDELETE "${ES_CONNECTION}/zammad_production"
|
curl -XDELETE "${ES_CONNECTION}/${ES_INDEX}"
|
||||||
|
|
||||||
yes | /usr/share/elasticsearch/bin/elasticsearch-plugin -s remove mapper-attachments
|
yes | /usr/share/elasticsearch/bin/elasticsearch-plugin -s remove mapper-attachments
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue