Either-or. It would be a plugin in either case, but it could be published in a separate gem. I think it belongs in the core distro though, since full-text search is a full Mongo feature now.
Tangentially, I have a little custom plugin I use to let me define indexes on the model. Would this be useful in master to people? The idea is that I have:
class Page
include MongoMapper::Document
key :url, String, alias: :u
# ...
indexes do
ensure_index :u, unique: true
ensure_index :dm
ensure_index :a
ensure_index :src
ensure_index [[:ls, 1], [:u, 1]]
end
end
Additionally, I add a ::index! method to MongoMapper::Document, so that I can index my models when convenient (deploy, app boot, etc, as appropriate)
I remember that once upon a time, MM had inline indexes on fields, but that was deprecated as it produced somewhat undesirable behavior. However, it seems like it might be useful to have a DSL to define indexes that could be lazy-invoked by the application as is most appropriate. Thoughts?