Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

ISAICP-6539: Use POST instead of GET with the Solr update endpoint #2493

Merged
merged 2 commits into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
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
12 changes: 10 additions & 2 deletions resources/runner/solr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,19 @@ commands:
- task: exec
command: curl
arguments:
- ${env.SOLR_CORE_PUBLISHED_URL}/${env.SOLR_CORE_PUBLISHED_NAME}/update?stream.body=<delete><query>*:*</query></delete>&commit=true
- ${env.SOLR_CORE_PUBLISHED_URL}/${env.SOLR_CORE_PUBLISHED_NAME}/update?commit=true&wt=json
options:
request: POST
header: 'Content-Type: application/xml'
data: '<delete><query>*:*</query></delete>'
- task: exec
command: curl
arguments:
- ${env.SOLR_CORE_UNPUBLISHED_URL}/${env.SOLR_CORE_UNPUBLISHED_NAME}/update?stream.body=<delete><query>*:*</query></delete>&commit=true
- ${env.SOLR_CORE_UNPUBLISHED_URL}/${env.SOLR_CORE_UNPUBLISHED_NAME}/update?commit=true&wt=json
options:
request: POST
header: 'Content-Type: application/xml'
data: '<delete><query>*:*</query></delete>'

# Restores the Solr index from a snapshot.
solr:restore:
Expand Down
2 changes: 1 addition & 1 deletion scripts/solr/restore_solr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fi

# Wipe out the existing index.
log "Wiping out the exiting index of Solr '${CORE}' core."
WIPE_INDEX=`/usr/bin/curl -sS "${SOLR_SERVER_URL}/${CORE}/update?stream.body=<delete><query>*:*</query></delete>&commit=true&wt=xml"`
WIPE_INDEX=`/usr/bin/curl -sS --request POST --header "Content-Type: application/xml" --data "<delete><query>*:*</query></delete>" "${SOLR_SERVER_URL}/${CORE}/update?commit=true&wt=xml"`
log "${WIPE_INDEX}"

# Restore the index.
Expand Down