开发者

how to index mongomapper 1 to many with sunspot / solr as its an objectId filed and not an integer?

I have a mongomapper 开发者_JS百科product and a category model and a category has many products.

I am trying to use facets using the categories like this. (seems to work in AR)

searchable do
      text :name
      integer :category_id, :references => ::Category
    end

Problem is category_id is an ObjectId not integer so i get :

undefined method `to_i' for BSON::ObjectId(.... error when trying to index products.

Any one done this before ?

Any ideas how to do this ?

Thanks rick

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜