From 37be7b6da6aa765991fac55c5c2d0cdb37fd24fc Mon Sep 17 00:00:00 2001 From: Caleb Forbes Davis V Date: Wed, 27 Jul 2011 16:04:41 -0500 Subject: [PATCH] updates indices to index on the slug component of the tag list - 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mediagoblin/db/indexes.py b/mediagoblin/db/indexes.py index 3440ac2a..d0e11311 100644 --- a/mediagoblin/db/indexes.py +++ b/mediagoblin/db/indexes.py @@ -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)]}} -- 2.25.1