@@ -0,0 +1,2475 @@
+package uk.ac.ebi.quickgo.ontology.service.search;%0A%0Aimport uk.ac.ebi.quickgo.common.search.solr.AbstractSolrQueryResultConverter;%0Aimport uk.ac.ebi.quickgo.ontology.common.document.OntologyDocument;%0Aimport uk.ac.ebi.quickgo.ontology.model.OBOTerm;%0Aimport uk.ac.ebi.quickgo.ontology.service.converter.ECODocConverter;%0Aimport uk.ac.ebi.quickgo.ontology.service.converter.GODocConverter;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport org.apache.solr.client.solrj.beans.DocumentObjectBinder;%0Aimport org.apache.solr.common.SolrDocumentList;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport static java.util.Objects.requireNonNull;%0A%0A/**%0A * Converts the Solr results into %7B@link OBOTerm%7D instances.%0A */%0Apublic class SolrQueryResultConverter extends AbstractSolrQueryResultConverter%3COBOTerm%3E %7B%0A    private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());%0A%0A    private GODocConverter goDocConverter;%0A    private ECODocConverter ecoDocConverter;%0A    private DocumentObjectBinder documentObjectBinder;%0A%0A    public SolrQueryResultConverter(DocumentObjectBinder documentObjectBinder,%0A            GODocConverter goDocConverter,%0A            ECODocConverter ecoDocConverter) %7B%0A        this.documentObjectBinder = requireNonNull(documentObjectBinder);%0A        this.goDocConverter = requireNonNull(goDocConverter);%0A        this.ecoDocConverter = requireNonNull(ecoDocConverter);%0A    %7D%0A%0A    @Override protected List%3COBOTerm%3E convertResults(SolrDocumentList results) %7B%0A        assert results != null : %22Results list cannot be null%22;%0A%0A        List%3COntologyDocument%3E solrTermDocs = documentObjectBinder.getBeans(OntologyDocument.class, results);%0A%0A        List%3COBOTerm%3E domainTerms = new ArrayList%3C%3E(solrTermDocs.size());%0A%0A        for (OntologyDocument ontologyDoc : solrTermDocs) %7B%0A            switch (ontologyDoc.ontologyType) %7B%0A                case %22GO%22:%0A                    domainTerms.add(goDocConverter.convert(ontologyDoc));%0A                    break;%0A                case %22ECO%22:%0A                    domainTerms.add(ecoDocConverter.convert(ontologyDoc));%0A                    break;%0A                default:%0A                    LOGGER.error(%22Unable to convert Solr document (%7B%7D) --%3E domain DTO %7B%7D%22,%0A                            ontologyDoc.id, ontologyDoc.ontologyType);%0A            %7D%0A        %7D%0A%0A        assert domainTerms.size() == results.size() : %22Number of converted terms does not match number of solr docs%22;%0A%0A        return domainTerms;%0A    %7D%0A%7D

Add SolrQueryResultConverter class to be able to convert the ontology results correctly.