// Exists creates a new Elasticsearch filter {"exists": {"field": field}}
542082
func Exists(field *gentypes.FieldType) interface{} {
	//u.Debugf("exists?  nested?%v  for %s", field.Nested(), field.String())
	if field.Nested() {
		/*
			"nested": {
				"query": {
				    "term": {
				        "map_actioncounts.k": "Web hit"
				    }
				},
				"path": "map_actioncounts"
			}
		*/
		return &nested{&NestedQuery{
			Query: Term(field.Path+".k", field.Field),
			Path:  field.Path,
		}}
		//Nested(field.Path, &term{map[string][]string{"k": field.Field}})
	}
	return &exists{map[string]string{"field": field.Field}}
}
1286305
func (s *Etcd) Exists(key string) (bool, error) {
	_, err := s.Get(key)
	if err != nil {
		if err == store.ErrKeyNotFound {
			return false, nil
		}
		return false, err
	}
	return true, nil
}
81025
func (c *Client) Exists(path string) (bool, error) {
	if strings.HasPrefix(path, "s3://") {
		s3Conn, err := s3ConnectionInformation(path, c.Region)
		if err != nil {
			return false, err
		}
		return existsS3(s3Conn)
	}
	return existsLocal(path)
}
258984
func (s *Set) Exists(v string) bool {
	pos := sort.SearchStrings(s.items, v)
	return pos < len(s.items) && s.items[pos] == v
}
88905
func (r *MiekgDNSResolver) Exists(name string) (bool, error) {
	req := new(dns.Msg)
	req.SetQuestion(name, dns.TypeA)

	res, err := r.exchange(req)
	if err != nil {
		return false, err
	}

	return len(res.Answer) > 0, nil
}
140546
func (a *Driver) Exists(id string) bool {
	if _, err := os.Lstat(path.Join(a.rootPath(), "layers", id)); err != nil {
		return false
	}
	return true
}
1327828
func (db *Database) Exists() error {
	resp := &struct {
		Error  string `json:"error"`
		DBName string `json:"db_name"`
	}{}
	body, err := db.Req.Get("", nil)
	if err != nil {
		return err
	}
	err = json.Unmarshal(body, resp)
	if err != nil {
		return err
	}
	if resp.Error != "" {
		return errors.New(resp.Error)
	}

	return nil
}
1249994
func (r *RequestContext) Exists(key string) bool {
	r.mutex.RLock()
	_, exists := r.store[key]
	r.mutex.RUnlock()
	return exists
}
690186
func (db *RedisDB) Exists(k string) bool {
	db.master.Lock()
	defer db.master.Unlock()
	return db.exists(k)
}
719108
func (v *TreeVertex) Exists(id string) bool {
	return v.Find(id) != nil
}
1317610
func (l *Layer0) Exists(id string) bool {
	id = l.realID(id)
	return l.Driver.Exists(id)
}
833869
func (s *Service) Exists() (bool, error) {
	if s.NoConf() {
		return false, s.errorf(nil, "no conf expected")
	}

	same, err := s.check()
	if err != nil {
		return false, errors.Trace(err)
	}
	return same, nil
}
754998
func (s *StoreToPodLister) Exists(pod *api.Pod) (bool, error) {
	_, exists, err := s.Store.Get(pod)
	if err != nil {
		return false, err
	}
	return exists, nil
}
705824
func (h *Handle) Exists() bool {
	h.Lock()
	defer h.Unlock()
	return h.dbExists
}
477861
func (h *fs) Exists(file string) bool {
	_, err := h.Stat(file)
	return err == nil
}
1334143
func (h *PortRuleL7) Exists(rules L7Rules) bool {
	for _, existingRule := range rules.L7 {
		if h.Equal(existingRule) {
			return true
		}
	}

	return false
}
559547
func (t *Topic) Exists() (bool, error) {
	return t.kz.exists(t.metadataPath())
}