none
How to add hierarchical refiner for a managed meta data in FAST SP2010 implementation RRS feed

  • Question

  • Hi ,

    We also are trying to implement solution for a getting the hierarchical refiner in the search results for a managed metadata. We have a Managed Metadata called Department and it has the hierarchical data associated in taxonomy. We need to display the refinement with one level up in the hierarchy. For example Departments are the managed metadata and Divisions are the parent to the meta data Department. The documents are associated with Department. We want the division to be displayed in the refinement and it should display all the search results with the division.

    Any help would be greatly appreciated.

    Thanks

    JOhn


    John

    Monday, June 25, 2012 3:29 PM

All replies

  • We're doing exactly this, using a flat navigator with the department code, along with a tree structure that holds the relationships between departments and a jQueryUI plugin for showing tree views of data. We do not show the document counts, but that should be trivial to add.

    Two screenshots, showing the top-level tree, and how it looks after navigating into it (we modified the plugin to hide the siblings of expanded nodes):

    Wednesday, June 27, 2012 8:26 AM
  • Hi Raymond,

    what kind of fieldtype are used for your Department? We are using Managed Metadata and have exactly the same objective. Is there a possibility to share the code?

    Thanks

    Sven

    Sunday, July 1, 2012 8:38 AM
  • We're using simple multi-valued string fields, where we have a sequence of department codes. The format of a department code is a sequence of up to 3 "words", representing the organization unit, its parent and its grandparent. For the lowest-level node in the (expanded) example above, the contents of this field would be something like

    CSO;CSO GBS;CSO GBS ITC;GBS ITC SUB;ITC SUB DM

    while the navigators returned as part of the search result would, for a hit at the lowest level, include information for each of these (but the lowest levels would be more likely to be cut off, since the search engine is only returning a limited number of navigator values).

    In our implementation, we have a web service that returns the entire organization tree as a nested structure, in the form of a json-encoded string. Our search interface combines this with the navigator data, and builds a tree where empty nodes and sub-trees are removed. Finally, the resulting Javascript structure is handed off to the "dynatree" jquery plugin, which handles the rest.

    Given that we already have everything we need, we have also implemented a custom search interface control for navigating through the organization structure and adding query terms that match particular organization units.

    The tree structure as returned by our web service consists of s single root node, which has a long name (that we can use for a tooltip), a short name (that we use as a value), an optional value that I cannot remember the use for, and a list of children. We convert this into a structure that dynatree can use with something like this:

    function cvtorgtree(orgtree)
    {
      var ret = [];
      var i;
      assert(!!orgtree);
      for (i = 0; i < orgtree.length; i++) {
        var node = orgtree[i];
        ret[ret.length] = {tooltip: node[0],
                   title: node[1],
                   children: cvtorgtree(node.length == 4?node[3]:node[2])
                  };
      }
      ret.sort(function(a,b) {return a.title === b.title ? 0 : (a.title <= b.title ? -1 : 1);});
      return ret;
    }

    --- which could be written more compactly, I guess.

    For setting up dynatree, we use something like

    function dt_init_orgtree(where, what)
    {
      $(where).dynatree({
        onActivate: function(node) {
          // A DynaTreeNode object is passed to the activation handler
          // Note: we also get this event, if persistence is on, and the page is reloaded.

          var value = node.data.title;
          addtoplevelterm("Organization",
                  value,
                  "xmorganization", value);
          popdown_advanced();
        },
        autoCollapse: true,
        children: cvtorgtree(what)});
    }

    which is called with an argument "where" which can be used as a jQuery selector, and an argument "what" which is a (possibly pruned) organization tree.

    Note: addtoplevelterm(displayname, displayvalue, internalname, internalvalue) has the effect of adding <internalname>:<internalvalue> as a top-level term to the current query, while displaying <displayname>:<displayvalue> to the user. popdown_advanced() is used to close down part of the user interface after a selection has been made.

    The dynatree plugin can be found via link.

    Wednesday, July 4, 2012 1:25 PM
  • hi Raymon,

    do you have any experinece to use the hierarchical structure of the term store manager taxnomy to build up hierarchical refiners?

    Thanks in advance

    M.

    CSO;CSO GBS;CSO GBS ITC;GBS ITC SUB;ITC SUB DM

    cat1;cat1 cat2;cat1 cat2 cat3;cat2 cat3 cat4;cat3 cat 4

    Wednesday, July 25, 2012 9:34 AM