File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313 steps :
1414 - uses : actions/checkout@v5
15+ - name : Delete unaliased collections
16+ env :
17+ TYPESENSE_API_KEY : ${{ secrets.TYPESENSE_API_KEY }}
18+ TYPESENSE_HOST : ${{ secrets.TYPESENSE_HOST }}
19+ TYPESENSE_PROTOCOL : https
20+ TYPESENSE_PORT : 443
21+ run : |
22+ ALIAS_COLLECTION=$(curl -s -H "X-TYPESENSE-API-KEY: $TYPESENSE_API_KEY" \
23+ "$TYPESENSE_PROTOCOL://$TYPESENSE_HOST:$TYPESENSE_PORT/aliases/typeorm-docs" \
24+ | jq -r '.collection_name')
1525
26+ if [ "$ALIAS_COLLECTION" = "null" ] || [ -z "$ALIAS_COLLECTION" ]; then
27+ echo "Alias does not exist; skipping collection cleanup."
28+ exit 0
29+ fi
30+
31+ echo "Alias currently points to: $ALIAS_COLLECTION"
32+
33+ COLLECTIONS=$(curl -s -H "X-TYPESENSE-API-KEY: $TYPESENSE_API_KEY" \
34+ "$TYPESENSE_PROTOCOL://$TYPESENSE_HOST:$TYPESENSE_PORT/collections" \
35+ | jq -r '.[].name')
36+
37+ for col in $COLLECTIONS; do
38+ if [ "$col" != "$ALIAS_COLLECTION" ]; then
39+ echo "Deleting unaliased collection: $col"
40+ curl -s -X DELETE -H "X-TYPESENSE-API-KEY: $TYPESENSE_API_KEY" \
41+ "$TYPESENSE_PROTOCOL://$TYPESENSE_HOST:$TYPESENSE_PORT/collections/$col"
42+ fi
43+ done
1644 - run : |
1745 docker run \
1846 -e TYPESENSE_API_KEY=${{ secrets.TYPESENSE_API_KEY }} \
Original file line number Diff line number Diff line change 2727 "strip_chars" : " .,;:#" ,
2828 "custom_settings" : {
2929 "separatorsToIndex" : " _" ,
30- "attributesForFaceting" : [
31- " language" ,
32- " version" ,
33- " type" ,
34- " docusaurus_tag"
35- ],
30+ "attributesForFaceting" : [],
3631 "attributesToRetrieve" : [
3732 " hierarchy" ,
3833 " content" ,
4641 " 833762294"
4742 ],
4843 "nb_hits" : 0
49- }
44+ }
You can’t perform that action at this time.
0 commit comments