You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by ka...@hispeed.ch on 2010/07/07 17:49:02 UTC

Counting occurences with Lucene

Hello everbody,
I have a running project in which I'd like to realize an overview table of the search results (similar to faceted searching).
Currently I've tried different approaches to do this:

DataTable in HitCollector to count occurences
Faceted Booleanqueries

Now in both cases I have a problem:
I have multiple fields I'd like to count:
- Main category (numerical value between 0 and 50)
- Subcategories (string values, 5-15 per result)

With the DataTable method I can count both categories, but if the results reach a big number it get's miserably slow.
With the Faceted Booleanqueries I cannot search for the subcategories (I would have to search for thousands of different strings).

Does anybody have an Idea how to solve this?

Concerning the usage in the end:
I'd like to display an overview like:
Maincategory 1 [50 Hits]
 - Subcategory 1 [20 Hits]
 - Subcategory 2 [10 Hits]
 ... Top 10 subcategories
... all Maincategories

Any help would be greatly appreciated.
Best Regards