response.addAttribute(MailService.A_QUERY_MORE, results.hasNext());
response.addAttribute(MailService.A_QUERY_MORE, (offset+iterLen)<msgs.length);
    Element putHits(ZimbraContext lc, Element response, Message[] msgs, ZimbraQueryResults results, SearchParams params)    throws ServiceException {        int offset = params.getOffset();        int limit  = params.getLimit();        EmailElementCache eecache = new EmailElementCache();        if (sLog.isDebugEnabled()) {            sLog.debug("SearchConv beginning with offset "+offset);        }        int iterLen = limit;//        boolean hasMoreHits = false;        if (msgs.length > iterLen+offset) {//            hasMoreHits = true;        } else {            // iterLen+offset <= msgs.length            iterLen = msgs.length - offset;        }                 if (iterLen > 0) {            //            // Array of ZimbraHit ptrs for matches, 1 entry for every message we might return from conv.            // NULL means no ZimbraHit presumably b/c the message didn't match the search            //            // ***Note that the match for msgs[i] is matched[i-offset]!!!!            //            ZimbraHit matched[] = new ZimbraHit[iterLen];            for (int i = 0; i < matched.length; i++) {                matched[i] = null;            }                        //            // Foreach hit, see if the hit message is in msgs[] (list of msgs in this conv), and if so             //            HitIter:                 for (ZimbraHit curHit = results.getFirstHit(); curHit != null; curHit = results.getNext()) {                    // we only bother checking the messages between offset and offset+iterLen, since only they                    // are getting returned.                    for (int i = offset; i < offset+iterLen; i++) {                        if (curHit.getItemId() == msgs[i].getId()) {                            matched[i-offset] = curHit;                            continue HitIter;                         }                    }                }                        //            // Okay, we've built the matched[] array.  Now iterate through all the messages, and put the message            // or the MATCHED entry into the result            //            boolean inline = params.getFetchFirst();            for (int i = offset; i < offset+iterLen; i++) {                if (matched[i-offset] != null) {                    addMessageHit(lc, response, (MessageHit) matched[i-offset], eecache, inline, params);                    inline = false;                } else {                    addMessageHit(lc, response, msgs[i], eecache, params);                }            }        }        response.addAttribute(MailService.A_QUERY_MORE, results.hasNext());        return response;    }