You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Ken Kinder <kk...@gmail.com> on 2006/06/14 22:54:49 UTC
Out-of-order distinct
I've poked around on google and the archives quite a bite, but I can't
find exactly what I need. Say I have a query that would normally
return a set of documents:
1 002 (text...)
2 001 (text...)
3 001 (text...)
4 002 (text...)
5 004 (text...)
I'd like that modified to be:
1 002 (text...)
2 001 (text...)
5 004 (text...)
So the ordering is the same, but I only want the first 001 in the
result set -- skip all the rest.
Does this make sense? Is there a way to do it?
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Out-of-order distinct
Posted by Grant Ingersoll <gs...@syr.edu>.
You could implement your own HitCollector interface and remove lower
scoring duplicates as you come across them by using a Map or something
to keep track as you go.
Ken Kinder wrote:
> I've poked around on google and the archives quite a bite, but I can't
> find exactly what I need. Say I have a query that would normally
> return a set of documents:
>
> 1 002 (text...)
> 2 001 (text...)
> 3 001 (text...)
> 4 002 (text...)
> 5 004 (text...)
>
> I'd like that modified to be:
>
> 1 002 (text...)
> 2 001 (text...)
> 5 004 (text...)
>
> So the ordering is the same, but I only want the first 001 in the
> result set -- skip all the rest.
>
> Does this make sense? Is there a way to do it?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
--
Grant Ingersoll
Sr. Software Engineer
Center for Natural Language Processing
Syracuse University
School of Information Studies
335 Hinds Hall
Syracuse, NY 13244
http://www.cnlp.org
Voice: 315-443-5484
Fax: 315-443-6886
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org