Skip to content

Commit

Permalink
Item11664: better support for --file parameter -> now detects renamin…
Browse files Browse the repository at this point in the history
…g/deletion of topics offline

git-svn-id: http://svn.foswiki.org/trunk/SolrPlugin@17510 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Apr 4, 2014
1 parent db43e0b commit 39685af
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions tools/solrjob
Original file line number Diff line number Diff line change
Expand Up @@ -75,29 +75,31 @@ export TIME
cd $FOSWIKI_ROOT/tools
SOLRINDEX=./solrindex
SOLRINDEX_ARGS=
WEB=
if test -n "$VHOST"; then
SOLRINDEX=./virtualhosts-solrindex
SOLRINDEX_ARGS="host=$VHOST"
fi

#echo -n "indexing " >&2
#test -n "$VHOST" && echo -n "$VHOST " >&2
#test -n "$FILE" && echo -n "triggered by $FILE" >&2
#echo "in $THROTTLE seconds" >&2
#test -n "$VHOST" && echo "$VHOST " >&2

if test -n "$FILE"; then
WEB=${FILE/*data\//};
WEB="web=$(dirname $WEB)"
#echo "WEB=$WEB" >&2
WEB=$(dirname $WEB)
TOPIC=$(basename $FILE);
TOPIC=${TOPIC/.txt/};

SOLRINDEX_ARGS="$SOLRINDEX_ARGS topic=$WEB.$TOPIC"
MODE=delta
fi
sleep $THROTTLE

if test "$MODE" = "delta"; then
/bin/date >> $LOG 2>&1
time nice $SOLRINDEX mode=delta $WEB $SOLRINDEX_ARGS >> $LOG 2>&1
if test "$MODE" = "full"; then
SOLRINDEX_ARGS="$SOLRINDEX_ARGS mode=full optimize=on"
else
/bin/date > $LOG 2>&1
time nice $SOLRINDEX mode=full optimize=on $SOLRINDEX_ARGS >> $LOG 2>&1
SOLRINDEX_ARGS="$SOLRINDEX_ARGS mode=delta"
fi

sleep $THROTTLE
/bin/date > $LOG 2>&1
time nice $SOLRINDEX $SOLRINDEX_ARGS >> $LOG 2>&1
)
) 200>$LOCKFILE&

0 comments on commit 39685af

Please sign in to comment.