如何通过属性来处理相关对象?
我有一个 Ruby on Rails 模型,其中有很多 HABTM 关系。本质上,我正在为客户制作一个以滑板为主题的视频共享网站。每个视频通过 HABTM 都有许多属性:位置、滑板者、标签、位置、音乐、设备、地点、区域等...并且它还有一些重要的类属性:标题、描述等
...我的客户希望每个视频播放器使用所有前面提到的描述性数据提供“相关视频”提要。此外,信息应该被加权(相似的标题优先于相似的标签)。
我试图找到一种实现 Google SiteSearch 来处理繁重工作的好方法,但找不到好的搜索词语法,即:
inurl: example.com/videos related:example.com/videos/4638872
不幸的是,这实际上不起作用......
I have a Ruby on Rails model that has quite a few HABTM relationships. Essentially, i'm making a video sharing site themed around skateboarding for a client. Each video has many attirbutes through HABTM: Location, Skateboarders, tags, location, music, equipment, spot, region, etc... And it also has a few class attributes that are significant: Title, description, etc...
The idea here is my client would like a "Related Videos" feed by each video player, using all of the formerly mentioned descriptive data. Furthermore, the information should be weighted (similar titles take precedence over similar tags).
I was trying to find a good way implement Google SiteSearch to handle the grunt work, but can't find a good search term syntax ie:
inurl: example.com/videos related:example.com/videos/4638872
Which doesn't actually work, unfortunately...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
那么,您正在寻找一个搜索词来查找您的视频吗?我不太确定这个问题,但如果是这样,这对你有用吗?
So, you are looking for a search term to use in order to locate your videos ? I'm not so sure about the question, but if so, would this work for you ?
通过使用 ferret 进行关键字爆炸搜索解决了这个问题。
Solved this by using ferret to do a keyword explode search.