Get the node IDs according the the filter criteria.