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

ehatcher edited comment on SOLR-792 at 9/27/08 3:01 AM:
------------------------------------------------------------

This patch is a simple implementation to do a fixed two-level faceting, using 
the SimpleFacets functions.  This is just the start.  The idea is to make the 
actual faceting implementation pluggable, support arbitrary levels, perhaps 
also support nested facet queries, not just facet fields.

With this patch, this query, on Solr's example data set, returns the data below:

http://localhost:8983/solr/select?q=*:*&rows=0&facet=on&facet.field=cat&facet.tree=cat,inStock&wt=json&indent=on

{code}
 "facet_counts":{
  "facet_queries":{},
  "facet_fields":{
        "cat":[
         "electronics",14,
         "memory",3,
         "card",2,
         "connector",2,
         "drive",2,
         "graphics",2,
         "hard",2,
         "monitor",2,
         "search",2,
         "software",2,
         "camera",1,
         "copier",1,
         "multifunction",1,
         "music",1,
         "printer",1,
         "scanner",1]},
  "facet_dates":{},
  "trees":[
        "cat,inStock",[
         "electronics",[
          "true",10,
          "false",4],
         "memory",[
          "true",3,
          "false",0],
         "card",[
          "false",2,
          "true",0],
         "connector",[
          "false",2,
          "true",0],
         "drive",[
          "true",2,
          "false",0],
         "graphics",[
          "false",2,
          "true",0],
         "hard",[
          "true",2,
          "false",0],
         "monitor",[
          "true",2,
          "false",0],
         "search",[
          "true",2,
          "false",0],
         "software",[
          "true",2,
          "false",0],
         "camera",[
          "true",1,
          "false",0],
         "copier",[
          "true",1,
          "false",0],
         "multifunction",[
          "true",1,
          "false",0],
         "music",[
          "true",1,
          "false",0],
         "printer",[
          "true",1,
          "false",0],
         "scanner",[
          "true",1,
          "false",0]]]}}
{code}

      was (Author: ehatcher):
    This patch is a simple implementation to do a fixed two-level faceting, 
using the SimpleFacets functions.  This is just the start.  The idea is to make 
the actual faceting implementation pluggable, support arbitrary levels, perhaps 
also support nested facet queries, not just facet fields.

With this patch, this query, on Solr's example data set, returns the data below:

http://localhost:8983/solr/select?q=*:*&rows=0&facet=on&facet.field=cat&facet.tree=cat,inStock&wt=json&indent=on


 "facet_counts":{
  "facet_queries":{},
  "facet_fields":{
        "cat":[
         "electronics",14,
         "memory",3,
         "card",2,
         "connector",2,
         "drive",2,
         "graphics",2,
         "hard",2,
         "monitor",2,
         "search",2,
         "software",2,
         "camera",1,
         "copier",1,
         "multifunction",1,
         "music",1,
         "printer",1,
         "scanner",1]},
  "facet_dates":{},
  "trees":[
        "cat,inStock",[
         "electronics",[
          "true",10,
          "false",4],
         "memory",[
          "true",3,
          "false",0],
         "card",[
          "false",2,
          "true",0],
         "connector",[
          "false",2,
          "true",0],
         "drive",[
          "true",2,
          "false",0],
         "graphics",[
          "false",2,
          "true",0],
         "hard",[
          "true",2,
          "false",0],
         "monitor",[
          "true",2,
          "false",0],
         "search",[
          "true",2,
          "false",0],
         "software",[
          "true",2,
          "false",0],
         "camera",[
          "true",1,
          "false",0],
         "copier",[
          "true",1,
          "false",0],
         "multifunction",[
          "true",1,
          "false",0],
         "music",[
          "true",1,
          "false",0],
         "printer",[
          "true",1,
          "false",0],
         "scanner",[
          "true",1,
          "false",0]]]}}
  
> Tree Faceting Component
> -----------------------
>
>                 Key: SOLR-792
>                 URL: https://issues.apache.org/jira/browse/SOLR-792
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Erik Hatcher
>            Assignee: Erik Hatcher
>            Priority: Minor
>         Attachments: SOLR-792.patch
>
>
> A component to do multi-level faceting.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to