use of org.alfresco.repo.search.impl.lucene.JSONResult in project alfresco-repository by Alfresco.
the class SolrQueryHTTPClient method postSolrQuery.
protected JSONResult postSolrQuery(HttpClient httpClient, String url, JSONObject body, SolrJsonProcessor<?> jsonProcessor, String spellCheckParams) throws UnsupportedEncodingException, IOException, HttpException, URIException, JSONException {
JSONObject json = postQuery(httpClient, url, body);
if (spellCheckParams != null) {
SpellCheckDecisionManager manager = new SpellCheckDecisionManager(json, url, body, spellCheckParams);
if (manager.isCollate()) {
json = postQuery(httpClient, manager.getUrl(), body);
}
json.put("spellcheck", manager.getSpellCheckJsonValue());
}
JSONResult results = jsonProcessor.getResult(json);
if (s_logger.isDebugEnabled()) {
s_logger.debug("Sent :" + url);
s_logger.debug(" with: " + body.toString());
s_logger.debug("Got: " + results.getNumberFound() + " in " + results.getQueryTime() + " ms");
}
return results;
}
use of org.alfresco.repo.search.impl.lucene.JSONResult in project alfresco-repository by Alfresco.
the class SolrSQLHttpClient method postSolrQuery.
protected ResultSet postSolrQuery(HttpClient httpClient, String url, JSONObject body, SolrJsonProcessor<?> jsonProcessor) throws IOException, JSONException {
JSONObject json = postQuery(httpClient, url, body);
JSONResult results = jsonProcessor.getResult(json);
LOGGER.debug("Sent : {}", url);
LOGGER.debug("with: {}", body);
LOGGER.debug("Got: {} in {} ms", results.getNumberFound(), results.getQueryTime());
return (ResultSet) results;
}
Aggregations