开发者

Similar Items in MongoDb

MongoDB Question:

I would like to find similar bookmarks of other users.

Let's say I have a collection "UserFavorites" and each document is something like: {'user_id': 'joe', bookmark_ids: [1,2,3,4,5,6]}

I would like to offer user "joe" other people's favorites based on interest similarities.

Something like $all_bookmarks = Find all people who have the most similar bookmarks to user "joe";

$display_bookmarks_to_joe = Group same bookmarks from within $all_bookmarks and assign scores (how many times same item appeared in $all_bookmarks) then display the top 20 to joe

I know this is not an easy task and involves lots of schema design. Does 开发者_开发百科anyone have any suggestions, or have a URL I could study ?

Thank you !


What you want is a recommendation engine.

There's a great article here about building one in Ruby:

http://www.igvita.com/2007/01/15/svd-recommendation-system-in-ruby/

If you use this approach, you could probably use MongoDB's geo-spatial indexing to perform searches quickly on the 2d data structure.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜