private synchronized void rescan() {
        files.clear();
        words.clear();

        int i = 0;
        for (InputStream is : streams) {
            files.put(i++, is);
        }

        try {
            doIndex();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }