Skip to content

Commit

Permalink
Fix analyzer settings
Browse files Browse the repository at this point in the history
  • Loading branch information
lenvanessen committed Sep 23, 2022
1 parent 89c3543 commit 1137714
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/services/Indexes.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,16 +461,21 @@ public function buildMapping(): array
$mapping = [];

$predefinedAttributes = [
'title' => 'text',
'slug' => 'text',
'postDate' => 'date'
'title' => [
'type' => 'text',
'analyzer' => 'standard',
],
'slug' => [
'type' => 'text',
'analyzer' => 'standard',
],
'postDate' => [
'type' => 'date',
],
];

foreach ($predefinedAttributes as $attribute => $type) {
$mapping[$fieldPrefix . 'attribute_' . $attribute] = [
'type' => $type,
'analyzer' => 'standard',
];
foreach ($predefinedAttributes as $attribute => $config) {
$mapping[$fieldPrefix . 'attribute_' . $attribute] = $config;
}

/**
Expand Down

0 comments on commit 1137714

Please sign in to comment.