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

Toke Eskildsen commented on SOLR-2412:
--------------------------------------

The syntax for calling is kept close to SOLR-64 and SOLR-792. The essential 
commands are {{qt=exprh&efacet=true}} to activate faceting, 
{{efacet.hierarchical=true&efacet.field=mypath}} for hierarchical.

Sorting is controlled with {{efacet.sort=count|index|locale}}. If locale is 
chosen, the locale is selected with {{efacet.sort.locale=da}}. The result set 
is limited with {{efacet.hierarchical.levels=99}} and {{efacet.limit=100}} to 
control the maximum depth and the maximum number of entries at each level.

Example:
{code}
http://localhost:8983/solr/select/?q=*:*&rows=0&fl=id&indent=0n&qt=exprh&efacet=true&efacet.field=path_ss&efacet.hierarchical=true&efacet.hierarchical.levels=99&efacet.limit=10
{code}

{code}
<?xml version="1.0" encoding="UTF-8"?>
<response>

<lst name="responseHeader">
  <int name="status">0</int>
  <int name="QTime">204</int>
</lst>
<result name="response" numFound="1000000" start="0">
  <doc>
    <str name="id">1</str>
  </doc>
</result>
<lst name="efacet_counts">
  <lst name="efacet_fields">
    <lst name="path_ss">
      <str name="field">path_ss</str>
      <lst name="paths">
        <long name="recursivecount">1000000</long>
        <long name="potentialtags">1000000</long>
        <long name="totaltags">101</long>
        <long name="count">101</long>
        <int name="level">0</int>
        <lst name="sub">
          <lst name="L0_T1">
            <int name="count">1</int>
            <lst name="sub">
              <long name="recursivecount">9901</long>
              <long name="potentialtags">9901</long>
              <long name="totaltags">103</long>
              <long name="count">103</long>
              <int name="level">1</int>
              <lst name="sub">
                <lst name="L1_T1">
                  <int name="count">1</int>
                  <lst name="sub">
                    <long name="recursivecount">97</long>
                    <long name="potentialtags">97</long>
                    <long name="totaltags">97</long>
                    <long name="count">97</long>
                    <int name="level">2</int>
                    <lst name="sub">
                      <lst name="L2_T1">
                        <int name="count">1</int>
                      </lst>
...
{code}

I'm currently doing some performance (memory and speed) comparisons of SOLR-64, 
SOLR-792 and SOLR-2412, which will be added later.

> 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
>
>
> 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 is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to