if (repository == null) {
return Response.status(Status.SERVICE_UNAVAILABLE).build();
}
// Create the search expression and the query
SearchQuery query = new SearchQueryImpl(site);
try {
query.withFulltext(true, URLDecoder.decode(terms, "utf-8"));
query.withVersion(Resource.LIVE);
query.withOffset(offset);
query.withLimit(limit);
} catch (UnsupportedEncodingException e) {
throw new WebApplicationException(e);
}
// Return the result