protected function getConfig($file = null)
    {
        // Config
        $appConfig = $this->getServiceLocator()->get('Config');

        if (!isset($appConfig['sphinxsearch'])) {
            throw new \InvalidArgumentException('Config not found with name: "sphinxsearch"');
        } else {
            $config = new Config($appConfig['sphinxsearch'], true); // defaults
            if (!is_null($file)) {
                $fileConfig = Factory::fromFile($file, true);
                if (!isset($fileConfig['sphinxsearch'])) {
                    throw new \InvalidArgumentException('Config not found with name: "sphinxsearch"');
                }
                $config->merge($fileConfig['sphinxsearch']);
            }
        }

        return $config;
    }