public function create($type, Closure $callback, $index = null)
    {
        if (!is_string($type)) {
            throw new InvalidArgumentException('type should be a string');
        }

        if ($index and !is_string($index)) {
            throw new InvalidArgumentException('index should be a string');
        }

        $blueprint = $this->createBlueprint($type, $closure = null, $index);

        $blueprint->create();

        $callback($blueprint);

        $this->build($blueprint);
    }
public function create($type, Closure $callback, $index = null)
    {
        if (!is_string($type)) {
            throw new InvalidArgumentException('type should be a string');
        }

        if ($index and !is_string($index)) {
            throw new InvalidArgumentException('index should be a string');
        }

        $blueprint = $this->createBlueprint($type, $closure = null, $index);

        $blueprint->create();

        $callback($blueprint);

        $this->build($blueprint);
    }
public function create ( $ type , Closure $ callback , $ index = null ) { if ( ! is_string ( $ type ) ) { throw new InvalidArgumentException ( 'type should be a string' ) ; } if ( $ index and ! is_string ( $ index ) ) { throw new InvalidArgumentException ( 'index should be a string' ) ; } $ blueprint = $ this -> createBlueprint ( $ type , $ closure = null , $ index ) ; $ blueprint -> create ( ) ; $ callback ( $ blueprint ) ; $ this -> build ( $ blueprint ) ; }
Create a map on your elasticsearch index.

@param string  $type
@param string  $index
@param Closure $callback
Create a map on your elasticsearch index .