Skip to content

Commit

Permalink
Merge pull request #91 from designmynight/es-7
Browse files Browse the repository at this point in the history
fix: Put mapping should not send document type
  • Loading branch information
jmosul authored Sep 9, 2019
2 parents 42c9655 + 457c110 commit 81e748a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
5 changes: 2 additions & 3 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,11 @@ public function update($query, $bindings = [])

/**
* @param string $index
* @param string $type
* @param array $body
*/
public function updateIndex(string $index, string $type, array $body): void
public function updateIndex(string $index, array $body): void
{
$this->indices()->putMapping(compact('index', 'type', 'body'));
$this->indices()->putMapping(compact('index', 'body'));
}

/**
Expand Down
11 changes: 4 additions & 7 deletions src/Database/Schema/Grammars/ElasticsearchGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,10 @@ public function compileUpdate(Blueprint $blueprint, Fluent $command, Connection
return function (Blueprint $blueprint, Connection $connection): void {
$connection->updateIndex(
$blueprint->getAlias(),
$blueprint->getDocumentType(),
[
$blueprint->getDocumentType() => array_merge(
['properties' => $this->getColumns($blueprint)],
$blueprint->getMeta()
),
]
array_merge(
['properties' => $this->getColumns($blueprint)],
$blueprint->getMeta()
)
);
};
}
Expand Down

0 comments on commit 81e748a

Please sign in to comment.