Rails 标记 gem/插件:有没有办法进行加权标记?

发布于 2024-12-27 11:02:09 字数 526 浏览 1 评论 0原文

我对在 Rails 3.x 应用程序中使用 actions-as-taggable-on 感兴趣: https://github.com/mbleigh/acts-as-taggable-on

快速搜索其他标记解决方案,这似乎是支持更好的解决方案之一。但我没有看到(至少在介绍性自述文件中)进行加权标签的方法。

例如,如果我有一个 Place 模型,并且我想用“酒吧、美式、啤酒、舒适”来标记“Bob's Pub”...我希望“bar”成为最能定义“Bob's Pub”的标签。这将代替类别字段。

但现在我想了一下,这似乎会增加相当多的开销,甚至可能需要一个额外的列或表来处理和存储这种计算。我的猜测是否正确,“加权标签”没有特别的实际用途?

acts-as-taggable-on 确实有上下文......因此,在将标签分配给对象时,我可以设置标签的“primary_list”,其中包含定义该对象的几个最重要的标签。

I'm interested in using acts-as-taggable-on for a Rails 3.x app:
https://github.com/mbleigh/acts-as-taggable-on

Doing a quick search for other tagging solutions, this seemed like one of the better-supported ones. But I didn't see (at least in the introductory readme) for a way to do weighted tags.

For instance, if I have a Place model and I wanted to tag "Bob's Pub" with "bar, American, beer, cozy"...I'd like "bar" to be the tag that best defines "Bob's Pub". This would be in lieu of having a category field.

But now that I think about it, that would seem to add quite a bit of overhead, perhaps even an extra column or table to handle and store that kind of calculation. Am I right in guessing that a "weighted tag" is not of particular practical use?

acts-as-taggable-on does have contexts...so when assigning tags to an object, I could set a "primary_list" of tags which would contain several of the most important tags that define the object.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文