private SearchEngineResponse<SolrTopicDetectionItem> search(SolrQuery query) {
        SearchEngineResponse<SolrTopicDetectionItem> response = new SearchEngineResponse<SolrTopicDetectionItem>();
////        query.setRows(450);
////        query.setFacet(true);
////        query.addFacetField("sentiment");
////        query.setFacetLimit(4);
//
////        query.set(FacetParams.FACET_DATE, "creationDate");
////        query.set(FacetParams.FACET_DATE_START, "NOW/DAY-5YEARS");
////        query.set(FacetParams.FACET_DATE_END, "NOW/DAY");
////        query.set(FacetParams.FACET_DATE_GAP, "+1YEAR");
//
        QueryResponse rsp;

        System.out.println("query:  " + query.toString());
        try {
            rsp = server.query(query);
        } catch (SolrServerException e) {
            logger.info(e.getMessage());
            return null;
        }

        response.setNumFound(rsp.getResults().getNumFound());

        List<SolrTopicDetectionItem> solrTopicDetectionItems = rsp.getBeans(SolrTopicDetectionItem.class);
        if (solrTopicDetectionItems != null) {
            Logger.getRootLogger().info("got: " + solrTopicDetectionItems.size() + " topicDetectionItems from Solr");
        }

        response.setResults(solrTopicDetectionItems);

        return response;
    }
private SearchEngineResponse < SolrTopicDetectionItem > search ( SolrQuery query ) { SearchEngineResponse < SolrTopicDetectionItem > response = new SearchEngineResponse < SolrTopicDetectionItem > ( ) ; QueryResponse rsp ; System . out . println ( "query:  " + query . toString ( ) ) ; try { rsp = server . query ( query ) ; } catch ( SolrServerException e ) { logger . info ( e . getMessage ( ) ) ; return null ; } response . setNumFound ( rsp . getResults ( ) . getNumFound ( ) ) ; List < SolrTopicDetectionItem > solrTopicDetectionItems = rsp . getBeans ( SolrTopicDetectionItem . class ) ; if ( solrTopicDetectionItems != null ) { Logger . getRootLogger ( ) . info ( "got: " + solrTopicDetectionItems . size ( ) + " topicDetectionItems from Solr" ) ; } response . setResults ( solrTopicDetectionItems ) ; return response ; }
}