Skip to content

Commit

Permalink
IBX-8378: Fixed handling non-indexable field types
Browse files Browse the repository at this point in the history
For more details see https://issues.ibexa.co/browse/IBX-8378 and #250

Key changes:

* Skipped mapping non-searchable fields

* Aligned PHPStan baseline with the latest release
  • Loading branch information
vidarl authored Jul 9, 2024
1 parent 2fb300d commit 19ff229
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ignore-lte-php7.4-errors.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parameters:
ignoreErrors:
-
message: "#^Anonymous function should return array but returns array\\<string\\>\\|false\\.$#"
message: "#^Anonymous function should return array\\<string\\> but returns array\\<string\\>\\|false\\.$#"
count: 1
path: tests/lib/Search/ResultExtractor/AggregationResultExtractor/TermAggregationResultExtractorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function mapFields(Content $content, $languageCode)
}

foreach ($contentType->fieldDefinitions as $fieldDefinition) {
if ($fieldDefinition->id !== $field->fieldDefinitionId) {
if ($fieldDefinition->id !== $field->fieldDefinitionId || !$fieldDefinition->isSearchable) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private function doMapFields(Content $content, ContentType $contentType, $langua
}

foreach ($contentType->fieldDefinitions as $fieldDefinition) {
if ($fieldDefinition->id !== $field->fieldDefinitionId) {
if ($fieldDefinition->id !== $field->fieldDefinitionId || !$fieldDefinition->isSearchable) {
continue;
}

Expand All @@ -140,7 +140,7 @@ private function doMapFields(Content $content, ContentType $contentType, $langua
continue;
}

if (!$indexField->type instanceof FieldType\FullTextField || !$fieldDefinition->isSearchable) {
if (!$indexField->type instanceof FieldType\FullTextField) {
continue;
}

Expand Down

0 comments on commit 19ff229

Please sign in to comment.