lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Pither <>
Subject Split results based on the value of a field
Date Thu, 04 Sep 2003 16:29:15 GMT

I have a requirement whereupon I'd like to pull search results back and 
split them up based on some keyword field. So for example, says there's 
a field named 'category',  I'd like to be able to have the results 
displayed as such:

Search Results for Category A:

Search Results for Category B:

The two ways I can think to do this are:
1) A post-process of the results collecting the first x amount of hits 
for each category.
2) Running a different search per category.

This is probably a long shot, but I was wondering if the search itself 
has the means to filter out documents based on a limit of occurances of 
a value for a given search field.  So for example if there are 5 
categories, and we only want to show 5 results per category, then the 
maximum amount of hits returned would be 25. This is because the value 
'Category A' for the field 'category' can only appear 5 times and so 
forth.  Can anyone think of a way to achieve this?


View raw message