How to clear a FAST Collection

I’ve struggled a lot lots of times when I needed to clear a collection on FAST ESP + Impulse because the most common commands available on the documentation for this task do not always work.
I’ve used several of them:

  • collection-admin –m clearcollection –n <collection name>
  • indexeradmin –a cleancollection <collectionname>

They seemed to work but when I checked the collection detailed information I could yet see the documents there and I could also see the documents on the FAST Impulse Search page.

The only process to clear a collection which always worked is:

  • Generate a list of all documents internal ids on the target collection and save it to a file.
    •  indexerinfo reportcontents <collection name> > documents.txt
    • It will save the list internal ids on the documents.txt file.
  • Run a command to delete all documents list on the file you generated on the previous step.
    • indexeradmin rdocs file.txt <collection name> <execution number>
    • This command will get all internal ids from the documents.txt and send to the indexer admin to delete. The execution number normally will be 1 but if you need to send more than 4000 documents to be deleted you might need to run these commands more than one time, increasing the execution number. The indexeradmin rdocs command can only process 4000 documents at a time.
It might take a little bit to FAST to delete all the documents but it will work.
You can check the progress by going to the collection detailed information page on FAST Admin or running the command to show the doc count for a collection:
indexerinfo -a doccount <collectionname>
See you around this world,
Amadeu.