Tag: solr6

如何在SolrJ中插入有多个子Bean的Bean对象

我有一个Bean类活动,它关联配置文件列表和用户Bean。 现在如果我试图通过SOLRJ在Solr中插入这个Activity bean,它会给我空指针exception。 以下代码导致exception: public boolean insert (T bean) { try { UpdateResponse response = solrClient.addBean(bean); System.out.println(“insert bean ElapsedTime: ” + response.getElapsedTime()); solrClient.commit(); return true; } catch (IOException | SolrServerException e) { e.printStackTrace(); } return false; }