#!/bin/sh
# mnogoreindex - Rebuilds "mnogosearch" database for local web site
# Revision: 111216

P=__META_PREFIX__
INDEXER=$P/sbin/mnogoindexer

if [ -f $INDEXER ]; then
    PATH=$P/bin:$P/sbin:$PATH
    DATADIR=$P/data
    mkdir -p $DATADIR

    DBFILE=$DATADIR/mnogosearch.db
    rm -fr  $DBFILE
    sqlite3 $DBFILE < $P/etc/create.txt

    NP=`getconf _NPROCESSORS_ONLN`
    NP=`expr $NP + $NP + 1`
    $INDEXER -N $NP
    $INDEXER -Eblob -N $NP
fi
