private Vector<Double> queryToVector(String [] q) {
        Vector<Double> vec = new Vector<>();
        for(String word: q) {
            if(index.containsKey(word)) {
                double idf = Math.log((double)FREE_DOC_ID/(double)index.get(word).size());
                vec.add(idf);
            }
        }
    return vec;
    }