public override string ToQueryString(IEscapeQuerySyntax escapeSyntaxParser)
{
var children = GetChildren();
if (children == null || children.Count == 0)
return "";
StringBuilder sb = new StringBuilder();
string filler = "";
foreach (IQueryNode child in children)
{
sb.Append(filler).Append(child.ToQueryString(escapeSyntaxParser));
filler = " ";
}
// in case is root or the parent is a group node avoid parenthesis
if ((Parent != null && Parent is GroupQueryNode)
|| IsRoot)
return sb.ToString();
else
return "( " + sb.ToString() + " )";
}