use of com.zimbra.client.ZSearchResult in project zm-mailbox by Zimbra.
the class ZMailboxUtil method doSearchConvNext.
private void doSearchConvNext() throws ServiceException {
ZSearchParams sp = mConvSearchParams;
ZSearchResult sr = mConvSearchResult;
if (sp == null || sr == null || !sr.hasMore())
return;
List<ZSearchHit> hits = sr.getHits();
if (hits.size() == 0)
return;
sp.setOffset(sp.getOffset() + hits.size());
dumpConvSearch(mMbox.searchConversation(mConvSearchConvId, sp), verboseOpt());
}
use of com.zimbra.client.ZSearchResult in project zm-mailbox by Zimbra.
the class ZMailboxUtil method doSearchConvPrevious.
private void doSearchConvPrevious() throws ServiceException {
ZSearchParams sp = mConvSearchParams;
ZSearchResult sr = mConvSearchResult;
if (sp == null || sr == null || sp.getOffset() == 0)
return;
sp.setOffset(sp.getOffset() - sr.getHits().size());
dumpConvSearch(mMbox.searchConversation(mConvSearchConvId, sp), verboseOpt());
}
use of com.zimbra.client.ZSearchResult in project zm-mailbox by Zimbra.
the class TestDraftCount method checkMessageCount.
private void checkMessageCount(String query, int expected) throws Exception {
ZSearchParams params = new ZSearchParams(query);
params.setTypes("message");
params.setOffset(0);
params.setSortBy(SearchSortBy.rcptAsc);
ZSearchResult results = mbox.search(params);
assertEquals(expected, results.getHits().size());
params.setSortBy(SearchSortBy.rcptDesc);
results = mbox.search(params);
assertEquals(expected, results.getHits().size());
}
use of com.zimbra.client.ZSearchResult in project zm-mailbox by Zimbra.
the class TestDraftCount method deleteFromQuery.
private void deleteFromQuery(String query) throws Exception {
//delete all messages currently in drafts folder
ZSearchParams params = new ZSearchParams(query);
params.setTypes("message");
params.setOffset(0);
ZSearchResult results = mbox.search(params);
for (ZSearchHit hit : results.getHits()) {
ZMessageHit msg = (ZMessageHit) hit;
mbox.deleteMessage(hit.getId());
}
}
use of com.zimbra.client.ZSearchResult in project zm-mailbox by Zimbra.
the class TestTrashImapMessage method testTrashImapMessage.
@Test
public void testTrashImapMessage() throws Exception {
String subj = "testtrashimap";
addMessage(imapDsMbox1, subj, "test");
refreshImapData();
ZSearchParams params = new ZSearchParams("subject:" + subj);
params.setTypes("MESSAGE");
ZSearchResult result = mbox.search(params);
ZSearchHit hit = result.getHits().get(0);
String id = hit.getId();
msgIds.add(id);
mbox.trashMessage(id);
params = new ZSearchParams("in:\"" + IMAP_DS_1_FOLDER_NAME + "/Trash\"");
params.setTypes("MESSAGE");
result = mbox.search(params);
List<ZSearchHit> hits = result.getHits();
Assert.assertEquals(1, hits.size());
Assert.assertEquals(id, hits.get(0).getId());
}
Aggregations