RE: A SearchEngine question`!
Elaborating on what Sverre said you can use the dataset returned by this SearchEngine to fill up your Map, but you probably already knew that :)
SearchEngine se;
se.addField("person.person_id");
se.addCriteria("person.(appointment->person_id).do_by","gte",getCurrentDateTime().toString(),"and",0);
se.addCriteria("person.(appointment->person_id).task_idx","equals","<ID of task>","and",0);
se.setDistinct("person.person_id");
se.execute();