Source:
public Map<String, SearchFilter> getSearchFilters(ArticleSearchQuery query) throws IOException { ImmutableList<String> facetFields = ImmutableList.of(JOURNAL_FACET_FIELD, ARTICLE_TYPE_FACET, AUTHOR_FACET, SUBJECT_AREA_FACET_FIELD); ArticleSearchQuery facetQuery = query.toBuilder().setRows(0).setFacetFields(facetFields).setSortOrder(null).build(); SolrSearchApi.Result results = solrSearchApi.search(facetQuery); Map<String, Map<String, Integer>> facets = results.getFacets(); SearchFilter journalFilter = searchFilterFactory.createSearchFilter(facets.get(JOURNAL_FACET_FIELD), JOURNAL); SearchFilter subjectAreaFilter = searchFilterFactory.createSearchFilter(facets.get(SUBJECT_AREA_FACET_FIELD), SUBJECT_AREA); SearchFilter authorFilter = searchFilterFactory.createSearchFilter(facets.get(AUTHOR_FACET), AUTHOR); SearchFilter articleTypeFilter = searchFilterFactory.createSearchFilter(facets.get(ARTICLE_TYPE_FACET), ARTICLE_TYPE); ArticleSearchQuery sectionFacetQuery = query.toBuilder() .setFacetFields(ImmutableList.of(SECTION_FACET)) .setRows(0) .setSortOrder(null) .setPartialSearch(true).build(); Map<String, Integer> sectionFacetResults = solrSearchApi.search(sectionFacetQuery) .getFacets().get(SECTION_FACET); SearchFilter sectionFilter = searchFilterFactory.createSearchFilter(sectionFacetResults, SECTION); Map<String, SearchFilter> filters = new HashMap<>(); filters.put(JOURNAL, journalFilter); filters.put(SUBJECT_AREA, subjectAreaFilter); filters.put(AUTHOR, authorFilter); filters.put(ARTICLE_TYPE, articleTypeFilter); filters.put(SECTION, sectionFilter); return filters; }

Target:
public Map<String, SearchFilter> getSearchFilters(ArticleSearchQuery query) throws IOException { ImmutableList<String> facetFields = ImmutableList.of(JOURNAL_FACET_FIELD, ARTICLE_TYPE_FACET_FIELD, AUTHOR_FACET_FIELD, SUBJECT_AREA_FACET_FIELD); ArticleSearchQuery facetQuery = query.toBuilder().setRows(0).setFacetFields(facetFields).setSortOrder(null).build(); SolrSearchApi.Result results = solrSearchApi.search(facetQuery); Map<String, Map<String, Integer>> facets = results.getFacets(); SearchFilter journalFilter = searchFilterFactory.createSearchFilter(facets.get(JOURNAL_FACET_FIELD), JOURNAL); SearchFilter subjectAreaFilter = searchFilterFactory.createSearchFilter(facets.get(SUBJECT_AREA_FACET_FIELD), SUBJECT_AREA); SearchFilter authorFilter = searchFilterFactory.createSearchFilter(facets.get(AUTHOR_FACET_FIELD), AUTHOR); SearchFilter articleTypeFilter = searchFilterFactory.createSearchFilter(facets.get(ARTICLE_TYPE_FACET_FIELD), ARTICLE_TYPE); ArticleSearchQuery sectionFacetQuery = query.toBuilder() .setFacetFields(ImmutableList.of(SECTION_FACET_FIELD)) .setRows(0) .setSortOrder(null) .setPartialSearch(true).build(); Map<String, Integer> sectionFacetResults = solrSearchApi.search(sectionFacetQuery) .getFacets().get(SECTION_FACET_FIELD); SearchFilter sectionFilter = searchFilterFactory.createSearchFilter(sectionFacetResults, SECTION); Map<String, SearchFilter> filters = new HashMap<>(); filters.put(JOURNAL, journalFilter); filters.put(SUBJECT_AREA, subjectAreaFilter); filters.put(AUTHOR, authorFilter); filters.put(ARTICLE_TYPE, articleTypeFilter); filters.put(SECTION, sectionFilter); return filters; }