Skip to content

Commit

Permalink
Allow to run solr-indexing without an existing collection pkiraly#289:…
Browse files Browse the repository at this point in the history
… adding postprocess-solr
  • Loading branch information
pkiraly committed Oct 28, 2023
1 parent a8df0ac commit e4529cb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
8 changes: 7 additions & 1 deletion common-script
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ do_index() {
fi
PARAMS="${PARAMS} --outputDir ${OUTPUT_DIR}"

./index --db $NAME --file-path ${MARC_DIR} --file-mask $MASK ${PARAMS} --trimId 2>> ${PREFIX}/solr.log
ONLY_INDEX=$(echo ${TYPE_PARAMS} | grep -c -P -e '--onlyIndex' || true)
if [[ "${ONLY_INDEX}" == "0" ]]; then
CORE=${NAME}_dev
else
CORE=${NAME}
fi
./index --db ${CORE} --file-path ${MARC_DIR} --file-mask $MASK ${PARAMS} --trimId 2>> ${PREFIX}/solr.log
}

do_postprocess_solr() {
Expand Down
6 changes: 2 additions & 4 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ done
# echo "limit: $limit"
# echo "defaultEncoding: $defaultEncoding"

CORE=${DB}_dev
# CORE=${DB}_dev
CORE=${DB}

SOLR_DB_URL="${SOLR_HOST}/solr/${CORE}"

Expand All @@ -138,9 +139,6 @@ if [ "${DELETE}" == "1" ]; then
# curl $SOLR_DB_URL/update -H "Content-type: text/xml" --data-binary '<delete><query>*:*</query></delete>'
fi

echo "Prepare schema"
prepare_schema $CORE

echo "Start indexing"
curl -s $SOLR_DB_URL/update -H "Content-type: text/xml" --data-binary '<commit/>'

Expand Down
3 changes: 3 additions & 0 deletions prepare-solr
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ if [[ $DEV_EXISTS != 1 ]]; then
rename_core $CORE2 $CORE_DEV
fi

echo "Prepare schema"
prepare_schema $CORE_DEV

echo "Solr preparation DONE"

0 comments on commit e4529cb

Please sign in to comment.