code: func (p *PreparedQuery) execute(query *structs.PreparedQuery,
  	reply *structs.PreparedQueryExecuteResponse,
  	forceConnect bool) error {
  	state := p.srv.fsm.State()
  
  	// If we're requesting Connect-capable services, then switch the
  	// lookup to be the Connect function.
  	f := state.CheckServiceNodes
  	if query.Service.Connect || forceConnect {
  		f = state.CheckConnectServiceNodes
  	}
  
  	_, nodes, err := f(nil, query.Service.Service)
  	if err != nil {
  		return err
  	}
  
  	// Filter out any unhealthy nodes.
  	nodes = nodes.FilterIgnore(query.Service.OnlyPassing,
  		query.Service.IgnoreCheckIDs)
  
  	// Apply the node metadata filters, if any.
  	if len(query.Service.NodeMeta) > 0 {
  		nodes = nodeMetaFilter(query.Service.NodeMeta, nodes)
  	}
  
  	// Apply the service metadata filters, if any.
  	if len(query.Service.ServiceMeta) > 0 {
  		nodes = serviceMetaFilter(query.Service.ServiceMeta, nodes)
  	}
  
  	// Apply the tag filters, if any.
  	if len(query.Service.Tags) > 0 {
  		nodes = tagFilter(query.Service.Tags, nodes)
  	}
  
  	// Capture the nodes and pass the DNS information through to the reply.
  	reply.Service = query.Service.Service
  	reply.Nodes = nodes
  	reply.DNS = query.DNS
  
  	// Stamp the result for this datacenter.
  	reply.Datacenter = p.srv.config.Datacenter
  
  	return nil
  }
docs: // execute runs a prepared query in the local DC without any failover. We don't
  // apply any sorting options or ACL checks at this level - it should be done up above.