private function searchCompletion($partial, $filter, &$ofs, &$matches, &$numMatches)
    {
        $ret = $partial;
        $i = strlen($ret);

        $numMatches = 0;
        $matches = array();
        $ofs = 0;

        $autocomplete = $filter->getResultFor($ret);

        foreach ($autocomplete as $value) {
            // If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle)
            if (0 === strpos($value, $ret) && $i !== strlen($value)) {
                $matches[$numMatches++] = $value;
            }
        }
    }