As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
search.luceneSearch("TYPE:\"{http://www.alfresco.org/model/bpm/1.0}workflowTask\"");
search.luceneSearch("TYPE:\"{http://www.alfresco.org/model/content/1.0}content\"");
However, reading your recuirements are you aware of the "All active tasks" dashlet is out of the box, listing all non completed tasks in the repo and status.
<dashlet id="tasks-active" label-id="tasks_active_title" description-id="tasks_active_desc" jsp="/jsp/workflow/tasks-active-dashlet.jsp" allow-narrow="false" />