Package org.apache.roller.weblogger.business.search.operations

Examples of org.apache.roller.weblogger.business.search.operations.SearchOperation


        this.entryCount = WebloggerRuntimeConfig.getIntProperty("site.newsfeeds.defaultEntries");
       
        // setup the search
        IndexManager indexMgr = WebloggerFactory.getWeblogger().getIndexManager();
       
        SearchOperation search = new SearchOperation(indexMgr);
        search.setTerm(feedRequest.getTerm());
       
        if(WebloggerRuntimeConfig.isSiteWideWeblog(feedRequest.getWeblogHandle())) {
            this.websiteSpecificSearch  = false;
        } else {
            search.setWebsiteHandle(feedRequest.getWeblogHandle());
        }
       
        if(StringUtils.isNotEmpty(feedRequest.getWeblogCategoryName())) {
            search.setCategory(feedRequest.getWeblogCategoryName());
        }
       
        // execute search
        indexMgr.executeIndexOperationNow(search);
       
        if (search.getResultsCount() > -1) {
            Hits hits = search.getResults();
            this.hits = search.getResultsCount();
           
            // Convert the Hits into WeblogEntryData instances.
            convertHitsToEntries(hits);
        }
       
View Full Code Here


        }
       
        // setup the search
        IndexManager indexMgr = WebloggerFactory.getWeblogger().getIndexManager();
       
        SearchOperation search = new SearchOperation(indexMgr);
        search.setTerm(searchRequest.getQuery());
       
        if(WebloggerRuntimeConfig.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 = I18nMessages.getMessages(searchRequest.getLocaleInstance()).getString("error.searchProblem");
        } else {
            Hits hits = search.getResults();
            this.hits = search.getResultsCount();
           
            // Convert the Hits into WeblogEntryData instances.
            convertHitsToEntries(hits);
        }
       
View Full Code Here

        this.entryCount = WebloggerRuntimeConfig.getIntProperty("site.newsfeeds.defaultEntries");
       
        // setup the search
        IndexManager indexMgr = WebloggerFactory.getWeblogger().getIndexManager();
       
        SearchOperation search = new SearchOperation(indexMgr);
        search.setTerm(feedRequest.getTerm());
       
        if(WebloggerRuntimeConfig.isSiteWideWeblog(feedRequest.getWeblogHandle())) {
            this.websiteSpecificSearch  = false;
        } else {
            search.setWebsiteHandle(feedRequest.getWeblogHandle());
        }
       
        if(StringUtils.isNotEmpty(feedRequest.getWeblogCategoryName())) {
            search.setCategory(feedRequest.getWeblogCategoryName());
        }
       
        // execute search
        indexMgr.executeIndexOperationNow(search);
       
        if (search.getResultsCount() > -1) {
            Hits hits = search.getResults();
            this.hits = search.getResultsCount();
           
            // Convert the Hits into WeblogEntryData instances.
            convertHitsToEntries(hits);
        }
       
View Full Code Here

        }
       
        // setup the search
        IndexManager indexMgr = WebloggerFactory.getWeblogger().getIndexManager();
       
        SearchOperation search = new SearchOperation(indexMgr);
        search.setTerm(searchRequest.getQuery());
       
        if(WebloggerRuntimeConfig.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 = I18nMessages.getMessages(searchRequest.getLocaleInstance()).getString("error.searchProblem");
        } else {
            Hits hits = search.getResults();
            this.hits = search.getResultsCount();
           
            // Convert the Hits into WeblogEntryData instances.
            convertHitsToEntries(hits);
        }
       
View Full Code Here

         imgr.executeIndexOperationNow(
             new AddEntryOperation(WebloggerFactory.getWeblogger(), (IndexManagerImpl)imgr, wd2));

        Thread.sleep(1000);

        SearchOperation search = new SearchOperation(imgr);
        search.setTerm("Enterprise");
        imgr.executeIndexOperationNow(search);
        assertEquals(2, search.getResultsCount());

        SearchOperation search2 = new SearchOperation(imgr);
        search2.setTerm("Tholian");
        imgr.executeIndexOperationNow(search2);
        assertEquals(1, search2.getResultsCount());

        // Clean up
        imgr.removeEntryIndexOperation(wd1);
        imgr.removeEntryIndexOperation(wd2);

        SearchOperation search3 = new SearchOperation(imgr);
        search3.setTerm("Enterprise");
        imgr.executeIndexOperationNow(search3);
        assertEquals(0, search3.getResultsCount());
    }   
View Full Code Here

        this.entryCount = WebloggerRuntimeConfig.getIntProperty("site.newsfeeds.defaultEntries");
       
        // setup the search
        IndexManager indexMgr = WebloggerFactory.getWeblogger().getIndexManager();
       
        SearchOperation search = new SearchOperation(indexMgr);
        search.setTerm(feedRequest.getTerm());
       
        if(WebloggerRuntimeConfig.isSiteWideWeblog(feedRequest.getWeblogHandle())) {
            this.websiteSpecificSearch  = false;
        } else {
            search.setWebsiteHandle(feedRequest.getWeblogHandle());
        }
       
        if(StringUtils.isNotEmpty(feedRequest.getWeblogCategoryName())) {
            search.setCategory(feedRequest.getWeblogCategoryName());
        }
       
        // execute search
        indexMgr.executeIndexOperationNow(search);
       
        if (search.getResultsCount() > -1) {
            Hits hits = search.getResults();
            this.hits = search.getResultsCount();
           
            // Convert the Hits into WeblogEntryData instances.
            convertHitsToEntries(hits);
        }
       
View Full Code Here

        }
       
        // setup the search
        IndexManager indexMgr = WebloggerFactory.getWeblogger().getIndexManager();
       
        SearchOperation search = new SearchOperation(indexMgr);
        search.setTerm(searchRequest.getQuery());
       
        if(WebloggerRuntimeConfig.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 = I18nMessages.getMessages(searchRequest.getLocaleInstance()).getString("error.searchProblem");
        } else {
            Hits hits = search.getResults();
            this.hits = search.getResultsCount();
           
            // Convert the Hits into WeblogEntryData instances.
            convertHitsToEntries(hits);
        }
       
View Full Code Here

         imgr.executeIndexOperationNow(
             new AddEntryOperation(WebloggerFactory.getWeblogger(), (IndexManagerImpl)imgr, wd2));

        Thread.sleep(1000);

        SearchOperation search = new SearchOperation(imgr);
        search.setTerm("Enterprise");
        imgr.executeIndexOperationNow(search);
        assertEquals(2, search.getResultsCount());

        SearchOperation search2 = new SearchOperation(imgr);
        search2.setTerm("Tholian");
        imgr.executeIndexOperationNow(search2);
        assertEquals(1, search2.getResultsCount());

        // Clean up
        imgr.removeEntryIndexOperation(wd1);
        imgr.removeEntryIndexOperation(wd2);

        SearchOperation search3 = new SearchOperation(imgr);
        search3.setTerm("Enterprise");
        imgr.executeIndexOperationNow(search3);
        assertEquals(0, search3.getResultsCount());
    }   
View Full Code Here

        }
       
        // setup the search
        IndexManager indexMgr = WebloggerFactory.getWeblogger().getIndexManager();
       
        SearchOperation search = new SearchOperation(indexMgr);
        search.setTerm(searchRequest.getQuery());
       
        if(WebloggerRuntimeConfig.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 = I18nMessages.getMessages(searchRequest.getLocaleInstance()).getString("error.searchProblem");
        } else {
            Hits hits = search.getResults();
            this.hits = search.getResultsCount();
           
            // Convert the Hits into WeblogEntryData instances.
            convertHitsToEntries(hits);
        }
       
View Full Code Here

TOP

Related Classes of org.apache.roller.weblogger.business.search.operations.SearchOperation

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.