public override void Visit(GroupNode node) {
            if (node.Field != null) {
                // using a field not in the free list
                if (!_freeFields.Contains(node.Field.Field))
                    UsesPremiumFeatures = true;

                if (node.Field.Field.StartsWith("data.")) {
                    UsesDataFields = true;

                    var lt = node.Left as TermNode;
                    var rt = node.Right as TermNode;
                    string termType = GetTermType(lt?.TermMin, lt?.TermMax, lt?.Term, rt?.TermMin, rt?.TermMax, rt?.Term);
                    node.Field.Field = "idx." + node.Field.Field.ToLower().Substring(5) + "-" + termType;
                }
            }

            base.Visit(node);
        }
        public override void Visit(GroupNode node) {
            _writer.WriteLine("Group:");
            _writer.Indent++;

            if (node.Field != null)
                node.Field.Accept(this, false);

            _writer.WriteIf(node.Left != null, "Left - ");
            if (node.Left != null)
                node.Left.Accept(this, false);

            _writer.WriteIf(node.Right != null, "Right - ");
            if (node.Right != null)
                node.Right.Accept(this, false);

            _writer.WriteLineIf(node.Operator != null, "Operator: {0}", node.Operator);
            _writer.WriteLineIf(node.HasParens, "Parens: true");

            _writer.Indent--;
        }
        public override void Visit(GroupNode node) {
            if (node.Field != null)
                node.Field.Accept(this, false);

            if (node.HasParens)
                _builder.Append("(");

            if (node.Left != null)
                node.Left.Accept(this, false);

            if (!String.IsNullOrEmpty(node.Operator))
                _builder.Append(" " + node.Operator + " ");
            else if (node.Right != null)
                _builder.Append(" ");

            if (node.Right != null)
                node.Right.Accept(this, false);

            if (node.HasParens)
                _builder.Append(")");
        }
        public override void Visit(GroupNode node) {
            if (node.Field != null && !_freeFields.Contains(node.Field.Field))
                UsesPremiumFeatures = true;

            base.Visit(node);
        }
 public virtual void Visit(GroupNode node) {}
        public void Visit(GroupNode node)
        {
            if (String.IsNullOrEmpty(node.Field))
                return;

            var childTerms = new List<string>();
            var leftTermNode = node.Left as TermNode;
            if (leftTermNode != null && leftTermNode.Field == null)
                childTerms.Add(leftTermNode.Term);

            var leftTermRangeNode = node.Left as TermRangeNode;
            if (leftTermRangeNode != null && leftTermRangeNode.Field == null) {
                childTerms.Add(leftTermRangeNode.Min);
                childTerms.Add(leftTermRangeNode.Max);
            }

            var rightTermNode = node.Right as TermNode;
            if (rightTermNode != null && rightTermNode.Field == null)
                childTerms.Add(rightTermNode.Term);

            var rightTermRangeNode = node.Right as TermRangeNode;
            if (rightTermRangeNode != null && rightTermRangeNode.Field == null) {
                childTerms.Add(rightTermRangeNode.Min);
                childTerms.Add(rightTermRangeNode.Max);
            }

            node.Field = GetCustomFieldName(node.Field, childTerms.ToArray()) ?? node.Field;
        }