 mongoose = require('mongoose')
 Grid = require 'gridfs-stream'
 errors = require './errors'
+PROJECT = {original:1, name:1, version:1, description: 1, slug:1, kind: 1}
 
 module.exports = class Handler
   # subclasses should override these properties

          res.send matchedObjects
          res.end()
      if term
        filter.project = project if req.query.project
        @modelClass.textSearch term, filter, callback
      else
        args = [filter.filter]
        args.push project if req.query.project
        @modelClass.find(args...).limit(100).exec callback

  versions: (req, res, id) ->

    unless @modelClass.schema.uses_coco_search
      return @sendNotFoundError(res)

    term = req.query.term
    matchedObjects = []
    filters = [{filter: {index: true}}]
