updates indices to index on the slug component of the tag list
authorCaleb Forbes Davis V <caldavis@gmail.com>
Wed, 27 Jul 2011 21:04:41 +0000 (16:04 -0500)
committerCaleb Forbes Davis V <caldavis@gmail.com>
Wed, 27 Jul 2011 21:04:41 +0000 (16:04 -0500)
- uses dot notation to reach into the JSON-style MediaEntry tags
  field object to index on the slug property of each tag

mediagoblin/db/indexes.py

index 3440ac2a8e862583d21b23e7efe46db61c1bc6cd..d0e11311f5fada374151494902b55d0adf6cc398 100644 (file)
@@ -95,14 +95,14 @@ MEDIAENTRY_INDEXES = {
         # Used for showing media items matching a tag search, most recent first.
         'index': [('state', ASCENDING),
                   ('uploader', ASCENDING),
-                  ('tags', DESCENDING),
+                  ('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', DESCENDING),
+                  ('tags.slug', DESCENDING),
                   ('created', DESCENDING)]}}