diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-12-19 15:54:00 +0100 |
---|---|---|
committer | gjoranv <gv@oath.com> | 2019-01-21 15:09:30 +0100 |
commit | b743451d1ff4d3cc2846fccc819c1fa82156db97 (patch) | |
tree | d7f0d232d21acfeda972632a024c65e61c5ddc14 /container-search/src/main/java/com/yahoo/search/Query.java | |
parent | 7169d752f5444e7d94ea6ec0bdeae65cdc693427 (diff) |
Revert "Bratseth/search container deprecations"
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/Query.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/Query.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/Query.java b/container-search/src/main/java/com/yahoo/search/Query.java index 73335037b94..b4adca2cef1 100644 --- a/container-search/src/main/java/com/yahoo/search/Query.java +++ b/container-search/src/main/java/com/yahoo/search/Query.java @@ -982,6 +982,22 @@ public class Query extends com.yahoo.processing.Request implements Cloneable { */ public HttpRequest getHttpRequest() { return httpRequest; } + /** + * Returns the unique and stable session id of this query. + * + * @param create if true this is created if not already set + * @return the session id of this query, or null if not set and create is false + * @deprecated use getSessionId() or getSessionId(serverId) instead + */ + @Deprecated + public SessionId getSessionId(boolean create) { + if ( ! create) return getSessionId(); + + if (requestId == null) + requestId = UniqueRequestId.next(); + return new SessionId(requestId, getRanking().getProfile()); + } + /** Returns the session id of this query, or null if none is assigned */ public SessionId getSessionId() { if (requestId == null) return null; |