use of com.zimbra.client.ZSearchPagerResult in project zm-mailbox by Zimbra.
the class ZMailboxUtil method doSearchNext.
private void doSearchNext() throws ServiceException {
if (mSearchParams == null)
return;
ZSearchPagerResult pager = mMbox.search(mSearchParams, ++mSearchPage, true, false);
mSearchPage = pager.getActualPage();
if (pager.getResult().getHits().size() == 0)
return;
dumpSearch(pager.getResult(), verboseOpt());
}
use of com.zimbra.client.ZSearchPagerResult in project zm-mailbox by Zimbra.
the class ZMailboxUtil method doSearch.
private void doSearch(String[] args) throws ServiceException {
if (currrentOpt()) {
doSearchRedisplay();
return;
} else if (previousOpt()) {
doSearchPrevious();
return;
} else if (nextOpt()) {
doSearchNext();
return;
} else if (args.length == 0) {
usage();
return;
}
mSearchParams = new ZSearchParams(args[0]);
// [limit {limit}] [sortby {sortBy}] [types {types}]
mSearchParams.setLimit(getOptLimit());
SearchSortBy sortBy = searchSortByOpt();
mSearchParams.setSortBy(sortBy != null ? sortBy : SearchSortBy.dateDesc);
String types = typesOpt();
mSearchParams.setTypes(types != null ? types : ZSearchParams.TYPE_CONVERSATION);
mSearchParams.setInDumpster(mCommandLine.hasOption(O_DUMPSTER.getLongOpt()));
mIndexToId.clear();
mSearchPage = 0;
ZSearchPagerResult pager = mMbox.search(mSearchParams, mSearchPage, false, false);
//stdout.println(result);
dumpSearch(pager.getResult(), verboseOpt());
}
use of com.zimbra.client.ZSearchPagerResult in project zm-mailbox by Zimbra.
the class ZMailboxUtil method doSearchPrevious.
private void doSearchPrevious() throws ServiceException {
if (mSearchParams == null || mSearchPage == 0)
return;
ZSearchPagerResult pager = mMbox.search(mSearchParams, --mSearchPage, true, false);
mSearchPage = pager.getActualPage();
if (pager.getResult().getHits().size() == 0)
return;
dumpSearch(pager.getResult(), verboseOpt());
}
use of com.zimbra.client.ZSearchPagerResult in project zm-mailbox by Zimbra.
the class ZMailboxUtil method doSearchRedisplay.
private void doSearchRedisplay() throws ServiceException {
if (mSearchParams == null)
return;
ZSearchPagerResult pager = mMbox.search(mSearchParams, mSearchPage, true, false);
mSearchPage = pager.getActualPage();
if (pager.getResult().getHits().size() == 0)
return;
dumpSearch(pager.getResult(), verboseOpt());
}
Aggregations