public void Insert(FilterQueryLogicalOperator node) { if (_root == null) { _root = new QueryNode(node); return; } //otherwise recurse down InsertRec(_root, new QueryNode(node)); }
private string GetLogicOperator(FilterQueryLogicalOperator op) { switch (op) { case FilterQueryLogicalOperator.and: return("and"); case FilterQueryLogicalOperator.or: return("or"); default: throw new ApplicationException("Unknown logical operator"); } }
private string GetQueryForLogic(FilterQueryLogicalOperator Operator) { var stringBuilder = new StringBuilder(); stringBuilder.Append($"{{\"bool\": {{"); switch (Operator) { case FilterQueryLogicalOperator.and: stringBuilder.Append("\"must\": ["); break; case FilterQueryLogicalOperator.or: break; } return(stringBuilder.ToString()); }
public QueryNode(FilterQueryLogicalOperator op) { Operator = op; }