Skip to content

Commit

Permalink
Be a bit more verbose when sending requests
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsomunozpomer committed Sep 25, 2023
1 parent f5f9c7e commit 320fb7b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bin/solr-jsonl-chunk-loader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ exec 3>&1
SOLR_HOSTS_ARR=(${SOLR_HOSTS})

commit() {
echo "Committing files..."
echo "Committing files on ${1}..."
HTTP_STATUS=$(curl $SOLR_AUTH -o >(cat >&3) -w "%{http_code}" "http://${1}/solr/${COLLECTION}/update" --data-binary '{ "commit": {} }' -H 'Content-type:application/json')

if [[ ! ${HTTP_STATUS} == 2* ]]
Expand Down Expand Up @@ -72,11 +72,12 @@ I=0
J=0
for CHUNK_FILE in $CHUNK_FILES
do
I=$(( $I + 1 ))
echo "$CHUNK_FILE ${I}/$(wc -w <<< $CHUNK_FILES)"

SOLR_HOST=${SOLR_HOSTS_ARR[(( ${J} % ${#SOLR_HOSTS_ARR[@]} ))]}
J=$(( $J + 1 ))

I=$(( $I + 1 ))
echo "$CHUNK_FILE ${I}/$(wc -w <<< $CHUNK_FILES) -> ${SOLR_HOST}"

post_json ${SOLR_HOST} ${CHUNK_FILE}

if [[ $(( $I % ( $COMMIT_DOCS / $NUM_DOCS_PER_BATCH) )) == 0 ]]
Expand Down

0 comments on commit 320fb7b

Please sign in to comment.