static private Slime toSlime(String rankProfile, String summaryClass, String docType, SessionId sessionId, List<FastHit> hits) {
Slime slime = new Slime();
Cursor root = slime.setObject();
if (summaryClass != null) {
root.setString("class", summaryClass);
}
if (sessionId != null) {
root.setData("sessionid", sessionId.asUtf8String().getBytes());
}
if (docType != null) {
root.setString("doctype", docType);
}
if (rankProfile != null) {
root.setString("ranking", rankProfile);
}
Cursor gids = root.setArray("gids");
for (FastHit hit : hits) {
gids.addData(hit.getGlobalId().getRawId());
}
return slime;
}