public static Document getDocumentFromScoredResult(Lumongo.ScoredResult scoredResult) { if (scoredResult.hasResultDocument()) { Lumongo.ResultDocument rd = scoredResult.getResultDocument(); return getDocumentFromResultDocument(rd); } return null; }
private String getCSVDocumentResponse(List<String> fields, QueryResponse qr) throws Exception { StringBuilder responseBuilder = new StringBuilder(); // headersBuilder String header = buildHeaderForCSV(fields); responseBuilder.append(header); // records qr.getResultsList().stream().filter(Lumongo.ScoredResult::hasResultDocument).forEach(sr -> { Document document = ResultHelper.getDocumentFromResultDocument(sr.getResultDocument()); try { appendDocument(fields, responseBuilder, null, document); } catch (Exception e) { log.error("Failed to get the CSV.", e); } }); return responseBuilder.toString(); }
Document document = ResultHelper.getDocumentFromResultDocument(fetchResponse.getResultDocument()); String docString; if (pretty) {
org.bson.Document mongoDocument = ResultHelper.getDocumentFromResultDocument(rd); if (mongoDocument != null) { rd = filterDocument(rd, fieldsToReturn, fieldsToMask, mongoDocument);
responseBuilder.append(","); Document document = ResultHelper.getDocumentFromResultDocument(sr.getResultDocument()); responseBuilder.append("\"document\": ");
org.bson.Document mongoDoc = ResultHelper.getDocumentFromResultDocument(resultDocument); if (mongoDoc != null) { if (!highlighterList.isEmpty()) {