<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_queryset(self):
 """ Optionally restricts the returned nodes by filtering against a `search` query parameter in the URL. """

        # retrieve all nodes which are published and accessible to current user
        # and use joins to retrieve related fields
        queryset = super(NodeList, self).get_queryset().select_related('status', 'user', 'layer')
        # query string params
        search = self.request.query_params.get('search', None)
        layers = self.request.query_params.get('layers', None)
        if search is not None:
            search_query = (
                Q(name__icontains=search) |
                Q(slug__icontains=search) |
                Q(description__icontains=search) |
                Q(address__icontains=search)
            )
            # add instructions for search to queryset
            queryset = queryset.filter(search_query)
        if layers is not None:
            # look for nodes that are assigned to the specified layers
            queryset = queryset.filter(Q(layer__slug__in=layers.split(',')))
        return queryset