Skip to content

Commit

Permalink
map meta attributes as keyword by default
Browse files Browse the repository at this point in the history
close #52
  • Loading branch information
limenet committed Jan 22, 2024
1 parent 233eeec commit 768a214
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/Index/AbstractIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,19 @@ public function __construct(

public function getMapping(): array
{
return [];
return [
'properties' => [
DocumentInterface::META_ID => [
'type' => 'keyword',
],
DocumentInterface::META_TYPE => [
'type' => 'keyword',
],
DocumentInterface::META_SUB_TYPE => [
'type' => 'keyword',
],
],
];
}

public function getSettings(): array
Expand Down
2 changes: 1 addition & 1 deletion src/Index/IndexInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function getBatchSize(): int;
* Defines the mapping to be used for this index.
* Passed 1:1 to Elasticsearch.
*
* @return array<array<mixed>>
* @return array{properties:array<string,mixed>}
*/
public function getMapping(): array;

Expand Down

0 comments on commit 768a214

Please sign in to comment.