Search in sources :

Example 1 with ZSearchPagerResult

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());
}
Also used : ZSearchPagerResult(com.zimbra.client.ZSearchPagerResult)

Example 2 with ZSearchPagerResult

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());
}
Also used : ZSearchPagerResult(com.zimbra.client.ZSearchPagerResult) ZSearchParams(com.zimbra.client.ZSearchParams) SearchSortBy(com.zimbra.soap.type.SearchSortBy)

Example 3 with ZSearchPagerResult

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());
}
Also used : ZSearchPagerResult(com.zimbra.client.ZSearchPagerResult)

Example 4 with ZSearchPagerResult

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());
}
Also used : ZSearchPagerResult(com.zimbra.client.ZSearchPagerResult)

Aggregations

ZSearchPagerResult (com.zimbra.client.ZSearchPagerResult)4 ZSearchParams (com.zimbra.client.ZSearchParams)1 SearchSortBy (com.zimbra.soap.type.SearchSortBy)1