Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only switch RPPD index if count is larger than 10000 #406

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Changes from all commits
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
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
Loading