code: public void removeWorkspaceIndex(WorkspaceEntry wsConfig, boolean isSystem) throws RepositoryConfigurationException,
              IOException
     {
        String indexDirName = wsConfig.getQueryHandler().getParameterValue(QueryHandlerParams.PARAM_INDEX_DIR);
        
        File indexDir = new File(indexDirName);
        if (PrivilegedFileHelper.exists(indexDir))
        {
           removeFolder(indexDir);
        }
        
        if (isSystem)
        {
           File systemIndexDir = new File(indexDirName + "_" + SystemSearchManager.INDEX_DIR_SUFFIX);
           if (PrivilegedFileHelper.exists(systemIndexDir))
           {
              removeFolder(systemIndexDir);
           }
        }
     }
docs: Remove all file of workspace index.
  
  @param wsConfig - workspace configuration.
  @param isSystem - 'true' to clean system workspace.
  @throws RepositoryConfigurationException - exception on parsing workspace configuration
  @throws IOException - exception on remove index folder