Skip to content

Commit

Permalink
Add to indexation
Browse files Browse the repository at this point in the history
  • Loading branch information
lenvanessen committed Sep 23, 2022
1 parent 1137714 commit ec2580f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/services/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ public function indexElementAttributes(ElementInterface $element, array $fieldHa
$keywords['attribute_' . $attribute] = $element->getSearchKeywords($attribute);
}

if(isset($element->postDate) && $element->postDate instanceof \DateTime) {
$keywords['attribute_postDate'] = $element->postDate->format(\DateTime::ATOM);
}

// Update the custom fields' keywords
foreach ($updateFields as $field) {
$fieldValue = $element->getFieldValue($field->handle);
Expand Down

0 comments on commit ec2580f

Please sign in to comment.