Skip to content

Commit

Permalink
Merge branch 'rppd_rpb-189-aliasSwitch' of https://github.com/hbz/lob…
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Sep 10, 2024
2 parents 2456313 + 9b99804 commit 4c72bd9
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions transformAndIndexRppd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ cd ../rpb
bash transformRppd.sh
cd -
sbt -Dindex.prod.name=$INDEX "runMain apps.Index baseline"
curl -X POST "weywot3:9200/_aliases?pretty" -H 'Content-Type: application/json' -d'
{
"actions" : [
{ "remove" : { "index" : "*", "alias" : "'"$ALIAS"'" } },
{ "add" : { "index" : "'"$INDEX"'", "alias" : "'"$ALIAS"'" } }
]
}
'
curl -S -s -o /dev/null https://rppd.lobid.org

COUNT=$(curl -X POST "weywot3:9200/$INDEX/_count" | jq .count)
if (( $COUNT > 10000 )) ; then
curl -X POST "weywot3:9200/_aliases?pretty" -H 'Content-Type: application/json' -d'
{
"actions" : [
{ "remove" : { "index" : "*", "alias" : "'"$ALIAS"'" } },
{ "add" : { "index" : "'"$INDEX"'", "alias" : "'"$ALIAS"'" } }
]
}
'
curl -S -s -o /dev/null https://rppd.lobid.org
else
echo "Not switching alias, index count for $INDEX is too low: $COUNT"
fi

0 comments on commit 4c72bd9

Please sign in to comment.