コード例 #1
0
 public static QueryBase GetDefaultQuery(this MissingNode node, IQueryVisitorContext context)
 {
     return(new BoolQuery {
         MustNot = new QueryContainer[] {
             new ExistsQuery {
                 Field = node.GetFullName()
             }
         }
     });
 }
コード例 #2
0
        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);
        }