public void execute(DocumentMap dm) {
        documentMap = dm;
        candidates = new HashSet<String>();
        if ((query1 == null) || (query2 == null)) {
            throw new RuntimeException("Invalid query");
        }
        /* this seems to be faster than using executor.invokeAll (see Or query)
        Future t1 = documentMap.executor.submit(new ConcurrentQuery(query1,documentMap));
        Future t2 = documentMap.executor.submit(new ConcurrentQuery(query2,documentMap));
        while (true) {
            if (t1.isDone() && t2.isDone()) {
                break;
            }
        }
        */

        query1.execute(documentMap);
        query2.execute(documentMap);
        if ((query1.candidates == null) || query1.candidates.isEmpty()) {
            return;
        }
        if ((query2.candidates == null) || query2.candidates.isEmpty()) {
            return;
        }
        for (String cand: query1.candidates) {
            if (query2.candidates.contains(cand)) {
                candidates.add(cand);
            }
        }
        candidateIt = candidates.iterator();
    }