lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jón Helgi Jónsson <jonjons...@gmail.com>
Subject Summing sub categories in faceting
Date Thu, 06 Aug 2009 18:06:28 GMT
Hi, would really appreciate some help on this.

I'm doing a category browser for companies. Kind of like a yellow pages.

For each company I store each category the company is in like this:
Example for Boeing would be
03.03.02
which is an fictional id for 'Jets'

The beginning point I display all companies

My query: ?q=*:*&facet=true&facet.field=categoryID&facet.mincount=1

Desired facet result:
Shops and services (4313)         ID = 01
Home and interiour (2932)          ID = 02
Transportation (1144)                 ID = 03


I click Transportation, ID = 03

My query: ?q=*:*'&fq=categoryID:03*&facet=true&facet.field=categoryID&facet.mincount=1

Desired facet result:
Land vehicles (708)       ID = 03.01
Boats (391)                  ID = 03.02
Planes (342)                ID = 03.03

Under these categories are even more subcategories and so forth.

Using facet queries like above would give me count for every single
sub category which will be in the hundreds when I only really want the
sum of where I am in the hierarchical category tree at that.

Does this make sense?

My solution is to store multiple ID's for each company. Example for
Boeing would be to have a categoryFacet field and store 03 and 03.03
and 03.03.02, and skip the wildcard in the facet.field.

Seems kind of bloated, are there better solutions?

Thanks a bunch!

Mime
View raw message