Exemplo n.º 1
0
        protected override Expression VisitLuceneRangeQueryExpression(LuceneRangeQueryExpression expression)
        {
            var mapping = fieldMappingInfoProvider.GetMappingInfo(expression.QueryField.FieldName);

            var query = CreateRangeQuery(mapping, expression.LowerQueryType, expression.Lower, expression.UpperQueryType, expression.Upper);

            queries.Push(new BooleanQuery {
                { query, expression.Occur }
            });

            return(base.VisitLuceneRangeQueryExpression(expression));
        }
        protected virtual Expression VisitLuceneRangeQueryExpression(LuceneRangeQueryExpression expression)
        {
            var lower = VisitExpression(expression.Lower);
            var upper = VisitExpression(expression.Upper);
            var field = VisitExpression(expression.QueryField);

            if (ReferenceEquals(lower, expression.Lower) && ReferenceEquals(upper, expression.Upper) &&
                ReferenceEquals(field, expression.QueryField))
            {
                return(expression);
            }

            return(new LuceneRangeQueryExpression((LuceneQueryFieldExpression)field,
                                                  (LuceneQueryPredicateExpression)lower, expression.LowerQueryType,
                                                  (LuceneQueryPredicateExpression)upper, expression.UpperQueryType));
        }