/** Returns the session id of this query, or null if none is assigned */ public SessionId getSessionId() { if (requestId == null) return null; return new SessionId(requestId, getRanking().getProfile()); }
Utf8String key = query.getSessionId(serverId).asUtf8String(); sessionSize = key.getByteLength(); buffer.putInt(key.getByteLength());
query.getRanking().getProperties().put(sessionIdKey, query.getSessionId().toString());
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; }
/** Returns the session id of this query, and creates and assigns it if not already present */ public SessionId getSessionId(String serverId) { if (requestId == null) requestId = UniqueRequestId.next(serverId); return new SessionId(requestId, getRanking().getProfile()); }