예제 #1
0
        public override HttpRequestMessage CreateRequest(JsonOperationContext ctx, ServerNode node, out string url)
        {
            var path = new StringBuilder(node.Url)
                       .Append("/databases/")
                       .Append(node.Database)
                       .Append("/queries?op=suggest&query-hash=")
                       .Append(_query.GetQueryHash(ctx));

            var request = new HttpRequestMessage
            {
                Method  = HttpMethod.Post,
                Content = new BlittableJsonContent(stream =>
                {
                    using (var writer = new BlittableJsonTextWriter(ctx, stream))
                    {
                        writer.WriteSuggestionQuery(_conventions, ctx, _query);
                    }
                }
                                                   )
            };

            url = path.ToString();
            return(request);
        }
예제 #2
0
 public void WriteContent(BlittableJsonTextWriter writer, JsonOperationContext context)
 {
     writer.WriteSuggestionQuery(_conventions, context, _query);
 }