aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/indexes.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-08-10 19:53:37 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-08-10 19:53:37 -0500
commit852d5bb2387706c11925fa0c2abe4a1f34708f16 (patch)
treedf5e6a3108d2ba007112b558ff65bbfabd88020c /mediagoblin/db/indexes.py
parent6b9ee0ca13b99ee20f9d0c680a950c6a7494a5a0 (diff)
parent6d794f268bb1f5d3cc56c5f0dc902571d48ebeac (diff)
downloadmediagoblin-852d5bb2387706c11925fa0c2abe4a1f34708f16.tar.lz
mediagoblin-852d5bb2387706c11925fa0c2abe4a1f34708f16.tar.xz
mediagoblin-852d5bb2387706c11925fa0c2abe4a1f34708f16.zip
Merge branch 'master' into processing
Diffstat (limited to 'mediagoblin/db/indexes.py')
-rw-r--r--mediagoblin/db/indexes.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/mediagoblin/db/indexes.py b/mediagoblin/db/indexes.py
index a832e013..30d43c98 100644
--- a/mediagoblin/db/indexes.py
+++ b/mediagoblin/db/indexes.py
@@ -90,6 +90,21 @@ MEDIAENTRY_INDEXES = {
# Indexing on uploaders and when media entries are created.
# Used for showing a user gallery, etc.
'index': [('uploader', ASCENDING),
+ ('created', DESCENDING)]},
+
+ 'state_uploader_tags_created': {
+ # Indexing on processed?, media uploader, associated tags, and timestamp
+ # Used for showing media items matching a tag search, most recent first.
+ 'index': [('state', ASCENDING),
+ ('uploader', ASCENDING),
+ ('tags.slug', DESCENDING),
+ ('created', DESCENDING)]},
+
+ 'state_tags_created': {
+ # Indexing on processed?, media tags, and timestamp (across all users)
+ # This is used for a front page tag search.
+ 'index': [('state', ASCENDING),
+ ('tags.slug', DESCENDING),
('created', DESCENDING)]}}