cousine/mebla — Issue #15: mebla support for inheritance
Author: manojn
Created: 2012-01-19 19:03:13+00:00
State: open

Mebla does not seem to be indexing documents that are part of an inheritance hierarchy.

For instance if you have the following models in mongoid

class Shape
include Mongoid::Document
include Mongoid::Mebla
field :name, type: String
field :x, type: Integer
field :y, type: Integer
search_in :name
end

class Circle < Shape
field :radius, type: Float
end

Then it should be possible to do the following
1. Create a Circle and then do a Circle.Search("name: foo") # this should only return Circles that match the search
2. Create a Circle and do Shape.Search("name: circleobject") # this should return all shapes that match the search
--
Currently only Shapes get indexed.
If you want Circle to be indexed then you need a separate search_in on the Circle class. Even then you cannot search on the Shape model.
--
Is there a way to get mebla to support inheritance that is supported in mongoid?