{ ZimbraQueryResults[] res = new ZimbraQueryResults[mMailboxId.length]; for (int i = 0; i < mMailboxId.length; i++) { Mailbox mbox = MailboxManager.getInstance().getMailboxById(mMailboxId[i]); ZimbraQuery zq = new ZimbraQuery(qstr, null, null, mbox, types, sortBy, false, false, 100, true, Mailbox.SearchResultMode.NORMAL); res[i] = zq.execute(); } return new HitIdGrouper(new MultiQueryResults(res, sortBy), sortBy); }
{ ZimbraQueryResults[] res = new ZimbraQueryResults[mMailboxId.length]; for (int i = 0; i < mMailboxId.length; i++) { Mailbox mbox = MailboxManager.getInstance().getMailboxById(mMailboxId[i]); SearchParams params = new SearchParams(); params.setQueryStr(qstr); params.setTypes(types); params.setSortBy(sortBy); params.setOffset(0); params.setLimit(100); params.setPrefetch(true); params.setMode(SearchResultMode.NORMAL); ZimbraQuery zq = new ZimbraQuery(mbox, params, false, false);   res[i] = zq.execute(); } return new HitIdGrouper(new MultiQueryResults(res, sortBy), sortBy); }
	    public ZimbraQueryResults runQuery(String qstr, byte[] types, SortBy sortBy) throws IOException, MailServiceException, ParseException, ServiceException	    {	    	ZimbraQueryResults[] res = new ZimbraQueryResults[mMailboxId.length];	        for (int i = 0; i < mMailboxId.length; i++) {	        	Mailbox mbox = MailboxManager.getInstance().getMailboxById(mMailboxId[i]);	        	ZimbraQuery zq = new ZimbraQuery(qstr, null, null, mbox, types, sortBy, false, false, 100, true, Mailbox.SearchResultMode.NORMAL);	        	res[i] = zq.execute();	        }	        return new HitIdGrouper(new MultiQueryResults(res, sortBy), sortBy);	    }