private void createInvertIndex() {
        for(Entry elem : matrix.entrySet()) {
            ArrayList<Integer> docIds= new ArrayList<>();
            BitSet docs = (BitSet) elem.getValue();
            for(int i = 0; i < docNumber; i++) {
                if (docs.get(i) == true)
                    docIds.add(i);
            }
            invertIndex.put(elem.getKey().toString(), docIds);
        }
    }