@Override public Collection<? extends Representation> lookup(String field, Set<String> includeFields, List<String> search, String... languages) throws IllegalStateException { Entityhub entityhub = getSearchService(); if(entityhub == null){ throw new IllegalStateException("The Entityhub is currently not active"); } FieldQuery query = EntitySearcherUtils.createFieldQuery(entityhub.getQueryFactory(), field, includeFields, search, languages); QueryResultList<Representation> results; try { results = entityhub.find(query); } catch (EntityhubException e) { throw new IllegalStateException("Exception while searchign for "+ search+'@'+Arrays.toString(languages)+"in the Entityhub", e); } return results.results(); }
@Override public Collection<? extends Representation> lookup(String field, Set<String> includeFields, List<String> search, String... languages) throws IllegalStateException { //build the query and than return the result Site site = getSearchService(); if(site == null){ throw new IllegalStateException("ReferencedSite "+siteId+" is currently not available"); } FieldQuery query = EntitySearcherUtils.createFieldQuery(site.getQueryFactory(), field, includeFields, search, languages); if(limit != null){ query.setLimit(limit); } QueryResultList<Representation> results; try { results = site.find(query); } catch (SiteException e) { throw new IllegalStateException("Exception while searchign for "+ search+'@'+Arrays.toString(languages)+"in the ReferencedSite "+ site.getId(), e); } return results.results(); }