public static QueryBase GetDefaultQuery(this MissingNode node, IQueryVisitorContext context) { return(new BoolQuery { MustNot = new QueryContainer[] { new ExistsQuery { Field = node.GetFullName() } } }); }
public override void Visit(MissingNode node, IQueryVisitorContext context) { var validationInfo = context.GetValidationInfo(); string field = null; if (!String.IsNullOrEmpty(node.Field)) { field = String.Equals(validationInfo.QueryType, QueryType.Query) ? node.GetFullName() : node.Field; if (!field.StartsWith("@")) { validationInfo.ReferencedFields.Add(field); } } AddOperation(validationInfo, "missing", field); }