Sleimanx2\Plastic\Map\Builder::create PHP Method

create() public method

Create a map on your elasticsearch index.
public create ( string $type, Closure $callback, string $index = null )
$type string
$callback Closure
$index string
    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);
    }