Ejemplo n.º 1
0
        private object ExecuteInternal(Expression expression)
        {
            var searchBody = SearchParser.Parse(expression);

            Elastic.PostSearch(connection, new PostSearchRequest {
                Body = searchBody
            });

            //var translation = ElasticQueryTranslator.Translate(Mapping, Prefix, expression);
            //var elementType = TypeHelper.GetSequenceElementType(expression.Type);

            //Log.Debug(null, null, "Executing query against type {0}", elementType);

            //try
            //{
            //    var response = AsyncHelper.RunSync(() => requestProcessor.SearchAsync(translation.SearchRequest));
            //    if (response == null)
            //        throw new InvalidOperationException("No HTTP response received.");

            //    return translation.Materializer.Materialize(response);
            //}
            //catch (AggregateException ex)
            {
                //ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
                return(null);  // Never called, as the above code re-throws
            }
        }