Closed jywarren closed 6 years ago
I'd like to give this a shot if that's okay?
I've got a working prototype for this feature committed here https://github.com/derek-allen/plots2/commit/2b5a25b29d3f72cd8d23a3d68d6b7b34dfb5fbde
This caches related tag results for a week the first time it is called.
I'm not sure where and how exactly the related tags should be displayed exactly so I put them here in its own partial. I'd like to use the same partial that's part of the logic driving the sidebar tags, but its highly coupled to the relationships defined in node_tag, though if you want to keep the functionality the same as the sidebars, I can try to generalize it for both cases.
Let me know which direction I should take this. Thanks!
Oh wow! Please open a PR, this looks really good!
On Thu, Jul 26, 2018, 10:16 PM Derek Allen notifications@github.com wrote:
I've got a working prototype for this feature committed here derek-allen@ 2b5a25b https://github.com/derek-allen/plots2/commit/2b5a25b29d3f72cd8d23a3d68d6b7b34dfb5fbde
This caches related tag results for a week the first time it is called.
I'm not sure where and how exactly the related tags should be displayed exactly so I put them here in its own partial. I'd like to use the same partial that's part of the logic driving the sidebar tags, but its highly coupled to the relationships defined in node_tag, though if you want to keep the functionality the same as the sidebars, I can try to generalize it for both cases.
Let me know which direction I should take this. Thanks!
[image: prototype-related-tags] https://user-images.githubusercontent.com/40677825/43297616-08796d46-9118-11e8-8879-25a4e40cdd35.png
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/3143#issuecomment-408290696, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ50K_vj89Epu8C8PjTN0XWdxlZNjks5uKnfkgaJpZM4VdbgZ .
We'd like to try to show related tags on each
/tag/_____
page, based on what other tags are most often used alongside. (building off of #3064 and #13)This could, in code, be something like:
A
tag.related
method in https://github.com/publiclab/plots2/blob/master/app/models/tag.rb :node_tag
recordsnid
valuesnode_tag
records which contain thesenid
stid
s according to how often they occur in this set ofnode_tag
sThen, on our tag page template:
Tag
name
values of the returned related tagsHowever, if we find this is too slow to do for every page load, we could cache the result weekly... or start to restrict it to only the past year, or limit to a maximum of 100 or 500
node_tag
s