Ejemplo n.º 1
0
        private Query CreateRangeQuery(IFieldMappingInfo mapping, QueryType lowerQueryType, Expression lowerBoundExpression, QueryType upperQueryType, Expression upperBoundExpression)
        {
            var lowerBound = lowerBoundExpression == null ? null : EvaluateExpression(lowerBoundExpression);
            var upperBound = upperBoundExpression == null ? null : EvaluateExpression(upperBoundExpression);

            var lowerRange = (lowerQueryType == QueryType.LessThan || lowerQueryType == QueryType.GreaterThan) ? RangeType.Exclusive : RangeType.Inclusive;
            var upperRange = (upperQueryType == QueryType.LessThan || upperQueryType == QueryType.GreaterThan) ? RangeType.Exclusive : RangeType.Inclusive;

            return(mapping.CreateRangeQuery(lowerBound, upperBound, lowerRange, upperRange));
        }
Ejemplo n.º 2
0
        private Query CreateRangeQuery(IFieldMappingInfo mapping, QueryType queryType, LuceneQueryPredicateExpression lowerBoundExpression, LuceneQueryPredicateExpression upperBoundExpression)
        {
            var lowerBound = lowerBoundExpression == null ? null : EvaluateExpression(lowerBoundExpression);
            var upperBound = upperBoundExpression == null ? null : EvaluateExpression(upperBoundExpression);

            var lowerRange = RangeType.Inclusive;
            var upperRange = (queryType == QueryType.LessThan || queryType == QueryType.GreaterThan) ? RangeType.Exclusive : RangeType.Inclusive;

            if (upperBoundExpression == null)
            {
                lowerRange = upperRange;
                upperRange = RangeType.Inclusive;
            }

            return(mapping.CreateRangeQuery(lowerBound, upperBound, lowerRange, upperRange));
        }
        private Query CreateRangeQuery(IFieldMappingInfo mapping, QueryType queryType, LuceneQueryPredicateExpression lowerBoundExpression, LuceneQueryPredicateExpression upperBoundExpression)
        {
            var lowerBound = lowerBoundExpression == null ? null : EvaluateExpression(lowerBoundExpression);
            var upperBound = upperBoundExpression == null ? null : EvaluateExpression(upperBoundExpression);

            var lowerRange = RangeType.Inclusive;
            var upperRange = (queryType == QueryType.LessThan || queryType == QueryType.GreaterThan) ? RangeType.Exclusive : RangeType.Inclusive;

            if (upperBoundExpression == null)
            {
                lowerRange = upperRange;
                upperRange = RangeType.Inclusive;
            }

            return mapping.CreateRangeQuery(lowerBound, upperBound, lowerRange, upperRange);
        }
        private Query CreateRangeQuery(IFieldMappingInfo mapping, QueryType lowerQueryType, Expression lowerBoundExpression, QueryType upperQueryType, Expression upperBoundExpression)
        {
            var lowerBound = lowerBoundExpression == null ? null : EvaluateExpression(lowerBoundExpression);
            var upperBound = upperBoundExpression == null ? null : EvaluateExpression(upperBoundExpression);

            var lowerRange = (lowerQueryType == QueryType.LessThan || lowerQueryType == QueryType.GreaterThan) ? RangeType.Exclusive : RangeType.Inclusive;
            var upperRange = (upperQueryType == QueryType.LessThan || upperQueryType == QueryType.GreaterThan) ? RangeType.Exclusive : RangeType.Inclusive;

            return mapping.CreateRangeQuery(lowerBound, upperBound, lowerRange, upperRange);
        }