public static function factory($index, $driver = null)
	{
		if (null === $driver) {
			$driver = Config::get('search.default', 'zend');
		}
		
		switch ($driver) {
			case 'algolia':
				return new Index\Algolia($index, 'algolia');
				
			case 'elasticsearch':
				return new Index\Elasticsearch($index, 'elasticsearch');
				
			case 'zend':
			default:
				return new Index\Zend($index, 'zend');
		}
	}
public static function factory($index, $driver = null)
	{
		if (null === $driver) {
			$driver = Config::get('search.default', 'zend');
		}
		
		switch ($driver) {
			case 'algolia':
				return new Index\Algolia($index, 'algolia');
				
			case 'elasticsearch':
				return new Index\Elasticsearch($index, 'elasticsearch');
				
			case 'zend':
			default:
				return new Index\Zend($index, 'zend');
		}
	}
public static function factory ( $ index , $ driver = null ) { if ( null === $ driver ) { $ driver = Config :: get ( 'search.default' , 'zend' ) ; } switch ( $ driver ) { case 'algolia' : return new Index \ Algolia ( $ index , 'algolia' ) ; case 'elasticsearch' : return new Index \ Elasticsearch ( $ index , 'elasticsearch' ) ; case 'zend' : default : return new Index \ Zend ( $ index , 'zend' ) ; } }
Return an instance of the correct index driver for the
given index name.

@param string $index
@param string $driver

@return \Mmanos\Search\Index
Return an instance of the correct index driver for the given index name .