Skip to content

Commit

Permalink
[BUGFIX] Reverse sort the keys in JSON array for geometries (#1384)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Meyer <[email protected]>
  • Loading branch information
beatrycze-volk and sebastian-meyer authored Dec 16, 2024
1 parent 375de46 commit 0b53feb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Classes/Common/Indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,11 @@ protected static function processLogical(Document $document, array $logicalUnit)
$solrDoc->setField('restrictions', $metadata['restrictions']);
$coordinates = json_decode($metadata['coordinates'][0]);
if (is_object($coordinates)) {
$solrDoc->setField('geom', json_encode($coordinates->features[0]));
$feature = (array) $coordinates->features[0];
$geometry = (array) $feature['geometry'];
krsort($geometry);
$feature['geometry'] = $geometry;
$solrDoc->setField('geom', json_encode($feature));
}
$autocomplete = self::processMetadata($document, $metadata, $solrDoc);
// Add autocomplete values to index.
Expand Down

0 comments on commit 0b53feb

Please sign in to comment.