Merge pull request #4063 from edx/dhm/mongo_tweaks

Fix wiki search query
This commit is contained in:
Don Mitchell
2014-06-12 10:07:03 -04:00
2 changed files with 2 additions and 2 deletions

View File

@@ -1018,7 +1018,7 @@ class MongoModuleStore(ModuleStoreWriteBase):
:param wiki_slug: the course wiki root slug
:return: list of course locations
"""
courses = self.collection.find({'definition.data.wiki_slug': wiki_slug})
courses = self.collection.find({'_id.category': 'course', 'definition.data.wiki_slug': wiki_slug})
# the course's run == its name. It's the only xblock for which that's necessarily true.
return [Location._from_deprecated_son(course['_id'], course['_id']['name']) for course in courses]

View File

@@ -25,7 +25,7 @@ fs.files:
Index needed thru 'category' by `_get_all_content_for_course` and others. That query also takes a sort
which can be `uploadDate`, `display_name`,
# again, uploadDate may also be a freq sort.
```
ensureIndex({'_id.tag': 1, '_id.org': 1, '_id.course': 1, '_id.category': 1})
```