mirror of https://github.com/interlegis/sapl.git
Browse Source
* Refatora solr_api * Conserta bug ao zipar subdir * Remove zip de controle de versão * Adiciona try/catch nos res.json() * Faz o zip de subdir * Mais mudanças * WIP * Conserta bug em zip file * Remoção de linhas de debug * Adiciona create-collection.sh * Adiciona upload-config.sh * Adiciona delete-collection.sh * Adiciona delete-config.sh * Adiciona delete-records.sh * Adiciona list-collections-configs.sh * Adiciona update-configset.sh * Update and rename delete-records.sh to delete-all-documents.sh * Update update-configset.sh Co-authored-by: eribeiro <edwardr@senado.leg.br>pull/3286/merge
Vinícius Cantuária
4 years ago
committed by
GitHub
9 changed files with 108 additions and 13 deletions
@ -0,0 +1,6 @@ |
|||||
|
#!/usr/bin/env bash |
||||
|
|
||||
|
SOLR_URL=${SOLR_URL-'http://localhost:8983/solr'} |
||||
|
SOLR_COLLECTION=${SOLR_COLLECTION-'sapl'} |
||||
|
|
||||
|
curl -X POST "$SOLR_URL/admin/collections?action=CREATE&name=$SOLR_COLLECTION&numShards=1&replicationFactor=1&collection.configName=sapl_configset" |
@ -0,0 +1,6 @@ |
|||||
|
#!/usr/bin/env bash |
||||
|
|
||||
|
SOLR_URL=${SOLR_URL-'http://localhost:8983/solr'} |
||||
|
SOLR_COLLECTION=${SOLR_COLLECTION-'sapl'} |
||||
|
|
||||
|
curl -X POST "$SOLR_URL/$SOLR_COLLECTION/update?commit=true" -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>' |
@ -0,0 +1,6 @@ |
|||||
|
#!/usr/bin/env bash |
||||
|
|
||||
|
SOLR_URL=${SOLR_URL-'http://localhost:8983/solr'} |
||||
|
SOLR_COLLECTION=${SOLR_COLLECTION-'sapl'} |
||||
|
|
||||
|
curl -X POST "$SOLR_URL/admin/collections?action=DELETE&name=$SOLR_COLLECTION" |
@ -0,0 +1,5 @@ |
|||||
|
#!/usr/bin/env bash |
||||
|
|
||||
|
SOLR_URL=${SOLR_URL-'http://localhost:8983/solr'} |
||||
|
|
||||
|
curl -X POST "$SOLR_URL/admin/configs?action=DELETE&name=sapl_configset&omitHeader=true" |
@ -0,0 +1,6 @@ |
|||||
|
#!/usr/bin/env bash |
||||
|
SOLR_URL=${SOLR_URL-'http://localhost:8983/solr'} |
||||
|
|
||||
|
curl -X GET "$SOLR_URL/admin/collections?action=LIST" |
||||
|
|
||||
|
curl -X GET "$SOLR_URL/admin/configs?action=LIST" |
@ -0,0 +1,10 @@ |
|||||
|
#!/usr/bin/env bash |
||||
|
|
||||
|
if [[ -z $SOLR_HOME ]]; then |
||||
|
echo 'Cannot run script! You need to setup $SOLR_HOME' |
||||
|
exit |
||||
|
fi |
||||
|
|
||||
|
ZK_HOST=${ZK_HOST-'localhost:9983'} |
||||
|
|
||||
|
$SOLR_HOME/bin/solr zk upconfig -n sapl_configset -d solr/sapl_configset/ -z $ZK_HOST |
@ -0,0 +1,11 @@ |
|||||
|
#!/usr/bin/env bash |
||||
|
|
||||
|
SOLR_URL=${SOLR_URL-'http://localhost:8983/solr'} |
||||
|
|
||||
|
# zip configset sapl_configset |
||||
|
cd ../sapl_configset/conf && zip -r sapl_configset.zip . |
||||
|
|
||||
|
curl -X POST --header "Content-Type:application/octet-stream" --data-binary @sapl_configset.zip "$SOLR_URL/admin/configs?action=UPLOAD&name=sapl_configset" |
||||
|
|
||||
|
cd - |
||||
|
rm ../sapl_configset/conf/sapl_configset.zip |
Binary file not shown.
Loading…
Reference in new issue