public function searchPoints($metricId, $search, $by, $limit = 1, $num = 1000, $page = 1)
    {
        $points = $this->indexPoints($metricId, $num, $page)['data'];

        $filtered = array_filter(
            $points,
            function ($point) use ($search, $by) {

                if (array_key_exists($by, $point)) {
                    if (strpos($point[$by], $search) !== false) {
                        return $point;
                    }
                    if ($point[$by] === $search) {
                        return $point;
                    }
                }

                return false;
            }
        );

        if ($limit == 1) {
            return array_shift($filtered);
        }

        return array_slice($filtered, 0, $limit);
    }