From d724042d961c0df2b3173c244f4667670a74ca01 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 20 Nov 2023 13:28:41 +0100 Subject: [PATCH] Add index on publishedAt and tags --- src/Document/Post.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Document/Post.php b/src/Document/Post.php index b67fbce1c..f181bedb4 100644 --- a/src/Document/Post.php +++ b/src/Document/Post.php @@ -26,6 +26,7 @@ */ #[ODM\Document(repositoryClass: PostRepository::class)] #[ODM\UniqueIndex(keys: ['slug' => 1], options: ['unique' => true])] +#[ODM\Index(['order' => 'desc', 'tags.name' => 'asc'])] #[Unique(fields: ['slug'], message: 'post.slug_unique', errorPath: 'title')] class Post {