From 4b3f18f0176e4d4f8ec045b398e3acaa1ae02ebd Mon Sep 17 00:00:00 2001 From: Marc Morera Date: Thu, 19 May 2022 00:44:19 +0200 Subject: [PATCH] Added uuid transformation to _id --- Model/Item.php | 4 ++++ Tests/Model/ItemTest.php | 1 + 2 files changed, 5 insertions(+) diff --git a/Model/Item.php b/Model/Item.php index 2fb72f8..313cde1 100644 --- a/Model/Item.php +++ b/Model/Item.php @@ -675,6 +675,10 @@ public static function getPathByField(string $field) return $field; } + if ('uuid' === $field) { + return '_id'; + } + if ('_id' === $field) { return $field; } diff --git a/Tests/Model/ItemTest.php b/Tests/Model/ItemTest.php index ad7870a..9d1d111 100644 --- a/Tests/Model/ItemTest.php +++ b/Tests/Model/ItemTest.php @@ -539,6 +539,7 @@ public function testMap() public function testPathByField() { $this->assertEquals('_id', Item::getPathByField('_id')); + $this->assertEquals('_id', Item::getPathByField('uuid')); $this->assertEquals('uuid.id', Item::getPathByField('id')); $this->assertEquals('uuid.type', Item::getPathByField('type')); $this->assertEquals('indexed_metadata.another_id', Item::getPathByField('another_id'));