SearchServiceImpl extends AbstractJobProducer implements SearchService, ManagedService { public SearchResult getByQuery(String query, int limit, int offset) throws SearchException { try { logger.debug("Searching index using custom query '" + query + "'"); return solrRequester.getByQuery(query, limit, offset); } catch (SolrServerException e) { throw new SearchException(e); } } SearchServiceImpl(); SolrIndexManager getSolrIndexManager(); @Override void activate(final ComponentContext cc); void deactivate(); SearchResult getByQuery(String query, int limit, int offset); Job add(MediaPackage mediaPackage); void addSynchronously(MediaPackage mediaPackage); Job delete(String mediaPackageId); boolean deleteSynchronously(String mediaPackageId); void clear(); SearchResult getByQuery(SearchQuery q); @Override SearchResult getForAdministrativeRead(SearchQuery q); void setStaticMetadataService(StaticMetadataService mdService); void unsetStaticMetadataService(StaticMetadataService mdService); void setMpeg7CatalogService(Mpeg7CatalogService mpeg7CatalogService); void setPersistence(SearchServiceDatabase persistence); void setSeriesService(SeriesService seriesService); void setWorkspace(Workspace workspace); void setAuthorizationService(AuthorizationService authorizationService); void setServiceRegistry(ServiceRegistry serviceRegistry); void setSecurityService(SecurityService securityService); void setUserDirectoryService(UserDirectoryService userDirectoryService); void setOrganizationDirectoryService(OrganizationDirectoryService organizationDirectory); @Override void updated(@SuppressWarnings("rawtypes") Dictionary properties); static final String CONFIG_SOLR_URL; static final String CONFIG_SOLR_ROOT; static final String JOB_TYPE; static final float DEFAULT_ADD_JOB_LOAD; static final float DEFAULT_DELETE_JOB_LOAD; static final String ADD_JOB_LOAD_KEY; static final String DELETE_JOB_LOAD_KEY; }
@Test public void testEmptySearchIndex() { SearchResult result = service.getByQuery(new SearchQuery().withId("foo")); assertEquals(0, result.size()); }