lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Venu Durgam <>
Subject Re: clustering results
Date Sat, 10 Apr 2004 13:47:28 GMT

Thanks for the poiner.
I am not sure how sort can filter out results.
sort will just sort the results right ?

lets say if i had below results

if you sort by domain name, results might be
If i want to have one result per domain. no sorting, just filtering out some results.

can this still be achieved using sort? If not any other ways of doing this ?


Erik Hatcher <> wrote:
On Apr 9, 2004, at 8:16 PM, Michael A. Schoen wrote:
> I have an index of urls, and need to display the top 10 results for a 
> given query, but want to display only 1 result per domain. It seems 
> that using either Hits or a HitCollector, I'll need to access the doc, 
> grab the domain field (I'll have it parse ahead of time) and only 
> take/display documents that are unique.
> A significant percentage of the time I expect I may have to access 
> thousands of results before I find 10 in unique domains. Is there a 
> faster approach that won't require accessing thousands of documents?

I have examples of this that I can post when I have more time, but a 
quick pointer... check out the overloaded 
methods which accept a Sort. You can do really really interesting 
slicing and dicing, I think, using it. Try this one on for size:

new Sort(new SortField[]{
new SortField("category"),
new SortField("pubmonth", SortField.INT, true)

Be clever indexing the piece you want to group on - I think you may 
find this the solution you're looking for.


To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message