aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/indexes.py
diff options
context:
space:
mode:
authorCaleb Forbes Davis V <caldavis@gmail.com>2011-07-10 23:36:21 -0500
committerCaleb Forbes Davis V <caldavis@gmail.com>2011-07-10 23:36:21 -0500
commit272469daf5eb53f2302ae3948dde4e40eaf12497 (patch)
tree366d8671fbef8e4bfc0e0a970376b117a81f2cf4 /mediagoblin/db/indexes.py
parent04a95150646247abd13992b5c103a6d780d8861b (diff)
downloadmediagoblin-272469daf5eb53f2302ae3948dde4e40eaf12497.tar.lz
mediagoblin-272469daf5eb53f2302ae3948dde4e40eaf12497.tar.xz
mediagoblin-272469daf5eb53f2302ae3948dde4e40eaf12497.zip
adds index for tag searches by an uploader
Diffstat (limited to 'mediagoblin/db/indexes.py')
-rw-r--r--mediagoblin/db/indexes.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mediagoblin/db/indexes.py b/mediagoblin/db/indexes.py
index d379a52b..57bd33cd 100644
--- a/mediagoblin/db/indexes.py
+++ b/mediagoblin/db/indexes.py
@@ -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)]}}