Skip to content

Commit

Permalink
Fixed #3837
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Feb 13, 2019
1 parent e314415 commit d97f077
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixed
- Fixed a bug where the `users/save-user` action wasn’t deleting user photos properly.
- Fixed a bug where changes to Matrix block type fields’ settings weren’t always saving. ([#3832](https://github.com/craftcms/cms/issues/3832))
- Fixed a bug where non-searchable fields were still getting search keywords stored when using the Search Indexes utility. ([#3837](https://github.com/craftcms/cms/issues/3837))

## 3.1.9.1 - 2019-02-12

Expand Down
10 changes: 6 additions & 4 deletions src/controllers/UtilitiesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,12 @@ public function actionSearchIndexPerformAction(): Response

foreach ($fieldLayout->getFields() as $field) {
/** @var Field $field */
// Set the keywords for the content's site
$fieldValue = $element->getFieldValue($field->handle);
$fieldSearchKeywords = $field->getSearchKeywords($fieldValue, $element);
$keywords[$field->id] = $fieldSearchKeywords;
if ($field->searchable) {
// Set the keywords for the content's site
$fieldValue = $element->getFieldValue($field->handle);
$fieldSearchKeywords = $field->getSearchKeywords($fieldValue, $element);
$keywords[$field->id] = $fieldSearchKeywords;
}
}

$searchService->indexElementFields($element->id, $siteId, $keywords);
Expand Down

0 comments on commit d97f077

Please sign in to comment.