[ 
https://issues.apache.org/jira/browse/SOLR-2412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13960116#comment-13960116
 ] 

J.L. Hill commented on SOLR-2412:
---------------------------------

Any suggestions on parsing the output? 
The hierarchical faceting seems to be working as described, but in my test 
3-level hierarchy, converting the query xml  to a php array, it comes out being 
13-levels deep. Parsing is complicated by the text strings of facet field being 
keys in the array. I have been trying to build a recursive function to parse 
the output, but after three days of trying, I am thinking there must be a 
better way to my desired result, which would be like a common html <ul> tree 
display. For a failed example of what I am trying:

function facetTree($array, $tree="") {

    $notToTree = array('recursivecount', 'potentialtags', 'totaltags', 'count', 
'level', 'sub');   
    $tree .= "<ul>";
    foreach($array as $k=>$v) {
        if(!in_array($k, $notToTree)) { $tree .= '<li>'.$k."</li>"; }
        if(is_array($v)) {
            $tree .= facetTree($v, $tree);
        }
    }
    $tree .= "</ul>";
    return $tree;
}

Any suggestions appreciated.


> Multipath hierarchical faceting
> -------------------------------
>
>                 Key: SOLR-2412
>                 URL: https://issues.apache.org/jira/browse/SOLR-2412
>             Project: Solr
>          Issue Type: New Feature
>          Components: SearchComponents - other
>    Affects Versions: 4.0
>         Environment: Fast IO when huge hierarchies are used
>            Reporter: Toke Eskildsen
>              Labels: contrib, patch
>         Attachments: SOLR-2412.patch, SOLR-2412.patch, SOLR-2412.patch, 
> SOLR-2412.patch, SOLR-2412.patch, SOLR-2412.patch, SOLR-2412.patch
>
>
> Hierarchical faceting with slow startup, low memory overhead and fast 
> response. Distinguishing features as compared to SOLR-64 and SOLR-792 are
>   * Multiple paths per document
>   * Query-time analysis of the facet-field; no special requirements for 
> indexing besides retaining separator characters in the terms used for faceting
>   * Optional custom sorting of tag values
>   * Recursive counting of references to tags at all levels of the output
> This is a shell around LUCENE-2369, making it work with the Solr API. The 
> underlying principle is to reference terms by their ordinals and create an 
> index wide documents to tags map, augmented with a compressed representation 
> of hierarchical levels.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to