Search in sources :

Example 1 with SolrArticleAdapter

use of org.ambraproject.wombat.service.SolrArticleAdapter in project wombat by PLOS.

the class BrowseController method populateAuthors.

private void populateAuthors(Map<String, Object> article, Site site) throws IOException {
    ArticleSearchQuery query = SolrArticleAdapter.lookupArticlesByDoisQuery(ImmutableList.of((String) article.get("doi")));
    List<SolrArticleAdapter> solrArticles = SolrArticleAdapter.unpackSolrQuery(solrSearchApi.search(query));
    article.put("authors", solrArticles.size() > 0 ? solrArticles.get(0).getAuthors() : ImmutableList.of());
}
Also used : SolrArticleAdapter(org.ambraproject.wombat.service.SolrArticleAdapter) ArticleSearchQuery(org.ambraproject.wombat.service.remote.ArticleSearchQuery)

Aggregations

SolrArticleAdapter (org.ambraproject.wombat.service.SolrArticleAdapter)1 ArticleSearchQuery (org.ambraproject.wombat.service.remote.ArticleSearchQuery)1