Implements query by name