Package org.apache.roller.ui.rendering.pagers

Examples of org.apache.roller.ui.rendering.pagers.SearchResultsPager


        // let parent initialize
        super.init(initData);
       
        // if there is no query, then we are done
        if(searchRequest.getQuery() == null) {
            pager = new SearchResultsPager(searchRequest, results, false);
            return;
        }
       
        // setup the search
        IndexManager indexMgr = RollerFactory.getRoller().getIndexManager();
       
        SearchOperation search = new SearchOperation(indexMgr);
        search.setTerm(searchRequest.getQuery());
       
        if(RollerRuntimeConfig.isSiteWideWeblog(searchRequest.getWeblogHandle())) {
            this.websiteSpecificSearch = false;
        } else {
            search.setWebsiteHandle(searchRequest.getWeblogHandle());
        }
       
        if(StringUtils.isNotEmpty(searchRequest.getWeblogCategoryName())) {
            search.setCategory(searchRequest.getWeblogCategoryName());
        }
       
        // execute search
        indexMgr.executeIndexOperationNow(search);
       
        if (search.getResultsCount() == -1) {
            // this means there has been a parsing (or IO) error
            this.errorMessage = bundle.getString("error.searchProblem");
        } else {
            Hits hits = search.getResults();
            this.hits = search.getResultsCount();
           
            // Convert the Hits into WeblogEntryData instances.
            convertHitsToEntries(hits);
        }
       
        // search completed, setup pager based on results
        pager = new SearchResultsPager(searchRequest, results, (hits > (offset+limit)));
    }
View Full Code Here


        // let parent initialize
        super.init(initData);
       
        // if there is no query, then we are done
        if(searchRequest.getQuery() == null) {
            pager = new SearchResultsPager(searchRequest, results, false);
            return;
        }
       
        // setup the search
        IndexManager indexMgr = RollerFactory.getRoller().getIndexManager();
       
        SearchOperation search = new SearchOperation(indexMgr);
        search.setTerm(searchRequest.getQuery());
       
        if(RollerRuntimeConfig.isSiteWideWeblog(searchRequest.getWeblogHandle())) {
            this.websiteSpecificSearch = false;
        } else {
            search.setWebsiteHandle(searchRequest.getWeblogHandle());
        }
       
        if(StringUtils.isNotEmpty(searchRequest.getWeblogCategoryName())) {
            search.setCategory(searchRequest.getWeblogCategoryName());
        }
       
        // execute search
        indexMgr.executeIndexOperationNow(search);
       
        if (search.getResultsCount() == -1) {
            // this means there has been a parsing (or IO) error
            this.errorMessage = bundle.getString("error.searchProblem");
        } else {
            Hits hits = search.getResults();
            this.hits = search.getResultsCount();
           
            // Convert the Hits into WeblogEntryData instances.
            convertHitsToEntries(hits);
        }
       
        // search completed, setup pager based on results
        pager = new SearchResultsPager(searchRequest, results, (hits > (offset+limit)));
    }
View Full Code Here

TOP

Related Classes of org.apache.roller.ui.rendering.pagers.SearchResultsPager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.