Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ayo Adesina 439 posts 1032 karma points
    Jun 15, 2015 @ 16:02
    Ayo Adesina
    0

    Looping through list of IPublishedContent nodes to order them by Rank. c#

    Hi guys,

    I have two list of Nodes (IPublishedContent)

    The first list is a list of Articles

    The second list is a list of Tags

    In Umbraco one of the properties on the Article Nodes has a Multi Node Tree Picker where the user can select multiple nodes from the content tree (the tags - also nodes in the tree)

    In my application code I can get the list of Tag nodes from Umbraco - no problem.

    However I would like to order them by 'Popularity' i.e the most used first.

    Any Ideas on how can I do this?

    I know Umbraco has a built in Tag Feature, but for other technical reasons I can't use this.

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Jun 15, 2015 @ 16:34
    Ismail Mayat
    0

    Ayo,

    I would use gatheringnode data and inject into the index the tags for each document so the node ids in index as actual tag values. Next I would use bobobrowse.net faceting and create facets then you can sort those tags as well as show usage. For more information on gatheringnode see http://thecogworks.co.uk/blog/posts/2012/november/examiness-hints-and-tips-from-the-trenches-part-2/ and on bobo with umbraco see http://24days.in/umbraco/2014/search-with-bobo/

    So bit of coding but that will be lightening quick as it uses the index.

    Regards

    Ismail

  • Ayo Adesina 439 posts 1032 karma points
    Jun 15, 2015 @ 17:01
    Ayo Adesina
    0

    Thanks for your reply Ismail.

    Just so I am clear..I'm hoping you can answer a few more questions..

    when does the gathing node data event fire? every time someone clicks save and publish?

    You said " tags for each document so the node ids in index as actual tag values"

    Do you mean I should check what the user has selected, get all the Id's and then insert them as 'real' Umbraco tags?

    By doing this, will I also be saving them against the document?

    The second part around bobo, - I'm not to sure about how to with bobo reading now....

    Thanks Ayo

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Jun 16, 2015 @ 08:25
    Ismail Mayat
    0

    Ayo, The gatheringnode does fire when someone publishes, so at that point you can replace the ids with node name, although thinking about it you could just replace the , with space and keep the id. Use bobo to facet and with the returned result set replace the ids with actual name of tag. I do recall if facet text has space it will split it. Have a bit of play see what works best.

    Bobo is very very quick its used on faceting on linkedin the original was written in java but the link i sent has link to the .net port. I have played with it but I know a few people who have used it with great success.

    Regards

    Ismail

  • Ayo Adesina 439 posts 1032 karma points
    Jun 18, 2015 @ 18:08
    Ayo Adesina
    0

    Hi Ismail,

    I have used gathering node data to get all the text values of my multi-node picker and inject them in to the index, its working very well for searching.

    But I'm still unclear how to insert them as Umbraco Tags.

    I posted a question about it here : https://our.umbraco.org/forum/developers/api-questions/66621-insert-umbraco-tags-via-gathering-node-data

    but I haven't had had a reply, can you give me any advice?

    I'm tempted to do the ranking of the tags in the controller and cache the result, update it every hour or something...

    Speed is important in this implementation, what do you think?

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Jun 18, 2015 @ 18:39
    Ismail Mayat
    0

    As stated earlier use bobo seehttp://24days.in/umbraco/2014/search-with-bobo/

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft