private IndexQueryServerSide GetIndexQuery(DocumentsOperationContext context, HttpMethod method) { var indexQuery = IndexQueryServerSide.Create(HttpContext, GetStart(), GetPageSize(Database.Configuration.Core.MaxPageSize), context); if (method == HttpMethod.Post && string.IsNullOrWhiteSpace(indexQuery.Query)) { string queryString; var request = context.Read(RequestBodyStream(), "QueryInPostBody"); if (request.TryGet("Query", out queryString) == false) { throw new InvalidDataException("Missing 'Query' property in the POST request body"); } indexQuery.Query = queryString; } return(indexQuery); }