You can find the single instruction for wiping/deleting indices in the online learning center (https://www.fredhopper.com/learningcenter), but this post aims to detail all the steps involved in a real world scenario.
Consider a fredhopper installation with two instances: indexer and query.
1. Ensure that both instances are stopped
2. Execute the following for deleting the indices
sudo su - fredhopper
cd /home/fredhopper/fredhopper
./bin/deployment-agent-client --location <HOST> delete --instance indexer data/indices
./bin/deployment-agent-client --location <HOST> delete --instance query data/indices
3. Backup the processed XML files
It is very likely that the /processed/batch/ directory contains hundreds of files, which could result in the "Argument list too long" error when executing the cp or rm commands. An alternative approach using "find" is presented below.
mkdir /tmp/fredhopper-xml-backup/batch
cd /tmp/fredhopper-xml-backup/batch
find /home/fredhopper/fredhopper/data/instances/indexer/data/xml/processed/batch/ -maxdepth 1 -name "*.xml" -exec cp -uf "{}" . \;
4. Remove the processed XML files (IMPORTANT)
find /home/fredhopper/fredhopper/data/instances/indexer/data/xml/processed/batch/ -maxdepth 1 -name "*.xml" -exec rm -f "{}" \;
5. Restart the instances (indexer and query)
cd /home/fredhopper/fredhopper
./bin/instance indexer start &
Now publish content from SDL Web (Tridion) to be indexed in Fredhopper. Check http://<HOST>:<INDEXER_PORT>/fredhopper/sysadmin/indexinfo.jsp to confirm the published content has been indexed.
./bin/instance query start &
Check http://<HOST>:<QUERY_PORT>/fredhopper/sysadmin/indexinfo.jsp to confirm the indexed item has reached the query instance.