public List<AppStoreEntry> search(String keyword) {
    List<AppStoreEntry> apps = new ArrayList<AppStoreEntry>();
    SolrClient solr = getSolrClient();
    SolrQuery query = new SolrQuery();
    if (keyword.length()==0) {
      query.setQuery("*:*");
      query.setFilterQueries("type_s:AppStoreEntry");
    } else {
      query.setQuery(keyword);
      query.setFilterQueries("type_s:AppStoreEntry");
    }
    query.setRows(40);
    QueryResponse response;
    try {
      response = solr.query(query);
      Iterator<SolrDocument> list = response.getResults().listIterator();
      while (list.hasNext()) {
        SolrDocument d = list.next();
        AppStoreEntry entry = new AppStoreEntry();
        entry.setId(d.get("id").toString());
        entry.setOrg(d.get("org_s").toString());
        entry.setName(d.get("name_s").toString());
        entry.setDesc(d.get("desc_s").toString());
        entry.setLike(Integer.parseInt(d.get("like_i").toString()));
        entry.setDownload(Integer.parseInt(d.get("download_i").toString()));
        apps.add(entry);
      }
    } catch (SolrServerException | IOException e) {
      LOG.error("Error in searching for applications: ", e);
    }
    return apps;
  }
@Test
  void testSearch() throws Exception {
    Application example = new Application();
    example.setOrganization("jenkins-ci.org");
    example.setName("jenkins");
    example.setDescription("World leading open source automation system.");
    example.setIcon("/css/img/feather.png");
    spy.register(example);
    List<AppStoreEntry> results = spy.search("name_s:jenkins");
    int expected = 1;
    int actual = results.size();
    assertEquals(expected, actual);
  }