public void coordIndexSearch(String query) throws Exception {
        String[] line = query.split(" ");
        HashMap<Integer, ArrayList<Integer>> result = new HashMap();
         
        if (line.length == 0) {
            System.out.println("Try another query");
            System.exit(0);
        } else if(line.length == 1) {
             boolSearch(query);
        } else {
            if (coordIndex.containsKey(line[0]))
                result = coordIndex.get(line[0]);
            for (int i = 1; i<line.length; i++) {
                if (coordIndex.containsKey(line[i]))
                    result.keySet().retainAll(coordIndex.get(line[i]).keySet()); 
            }
        
            System.out.println("Query: " + query);
            System.out.println("Result: ");
            Boolean res = false;
            for (Integer docId: result.keySet()) {
                ArrayList<Integer> coordList1 = coordIndex.get(line[0]).get(docId);
                for(int i = 1; i<line.length-1; i++) {
                    ArrayList<Integer> coordList2 = coordIndex.get(line[i]).get(docId);
                    res = (intersect(coordList1, coordList2, i) ? true : false);
                }
                if(res) {
                    System.out.println(getDocName(docId));
                }   
            }  
        }   
    }