private List<OntologyTerm> searchById(String fieldId, String id, Integer firstResult, Integer maxResults) throws SolrServerException { SolrQuery query = new SolrQuery(fieldId + ":\"" + id + "\""); if (firstResult != null) query.setStart(firstResult); if (maxResults != null) query.setRows(maxResults); if (FieldName.CHILDREN_ID.equalsIgnoreCase(fieldId)){ return processParentsHits(search(query, new String[] {OntologyFieldNames.PARENT_ID, OntologyFieldNames.PARENT_NAME, OntologyFieldNames.PARENT_SYNONYMS}), id); } else if (FieldName.PARENT_ID.equalsIgnoreCase(fieldId)) { return processChildrenHits(search(query, new String[] {OntologyFieldNames.CHILD_ID, OntologyFieldNames.CHILD_NAME, OntologyFieldNames.CHILDREN_SYNONYMS}), id); } else { return processParentsHits(search(query, new String[] {OntologyFieldNames.PARENT_ID, OntologyFieldNames.PARENT_NAME, OntologyFieldNames.PARENT_SYNONYMS}), id); } }