File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,18 @@ cd ../rpb
9
9
bash transformRppd.sh
10
10
cd -
11
11
sbt -Dindex.prod.name=$INDEX " runMain apps.Index baseline"
12
- curl -X POST " weywot3:9200/_aliases?pretty" -H ' Content-Type: application/json' -d'
13
- {
14
- "actions" : [
15
- { "remove" : { "index" : "*", "alias" : "' " $ALIAS " ' " } },
16
- { "add" : { "index" : "' " $INDEX " ' ", "alias" : "' " $ALIAS " ' " } }
17
- ]
18
- }
19
- '
20
- curl -S -s -o /dev/null https://rppd.lobid.org
12
+
13
+ COUNT=$( curl -X POST " weywot3:9200/$INDEX /_count" | jq .count)
14
+ if (( $COUNT > 10000 )) ; then
15
+ curl -X POST " weywot3:9200/_aliases?pretty" -H ' Content-Type: application/json' -d'
16
+ {
17
+ "actions" : [
18
+ { "remove" : { "index" : "*", "alias" : "' " $ALIAS " ' " } },
19
+ { "add" : { "index" : "' " $INDEX " ' ", "alias" : "' " $ALIAS " ' " } }
20
+ ]
21
+ }
22
+ '
23
+ curl -S -s -o /dev/null https://rppd.lobid.org
24
+ else
25
+ echo " Not switching alias, index count for $INDEX is too low: $COUNT "
26
+ fi
You can’t perform that action at this time.
0 commit comments