adds index for tag searches by an uploader
authorCaleb Forbes Davis V <caldavis@gmail.com>
Mon, 11 Jul 2011 04:36:21 +0000 (23:36 -0500)
committerCaleb Forbes Davis V <caldavis@gmail.com>
Mon, 11 Jul 2011 04:36:21 +0000 (23:36 -0500)
mediagoblin/db/indexes.py

index d379a52b98d2734c93ed5acefa451aed56639c7a..57bd33cdff94a36bb7890b030a85ccdbfec428db 100644 (file)
@@ -88,6 +88,13 @@ MEDIAENTRY_INDEXES = {
         # Indexing on uploaders and when media entries are created.
         # Used for showing a user gallery, etc.
         'index': [('uploader', ASCENDING),
+                  ('created', DESCENDING)]},
+
+    'uploader_tags_created': {
+        # Indexing on the media uploader, the associated tags, and timestamp
+        # Used for showing media items matching a tag search, most recent first.
+        'index': [('uploader', ASCENDING),
+                  ('tags', DESCENDING),
                   ('created', DESCENDING)]}}