lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <yo...@apache.org>
Subject Re: Trimming the list of docs returned.
Date Thu, 16 Nov 2006 00:26:39 GMT
On 11/15/06, Tom <solr-list@zvents.com> wrote:
> >One hack: implement a simple query that delegates to another query and
> >encapsulates the trim value... that way hashCode/equals won't match
> >unless the trim does.
>
> Not sure what you mean by "delegates to another query". Could you
> clarify or give me a pointer?

Something like
public class TrimmedQuery extends Query {
   Query delegate;
   public TrimmedQuert(Query delegate, int trim) {
     this.delegate = delegate;
   }
   // now override hashCode + equals to include trim and implement all other
   // methods by delegating them.
}

> I was thinking in terms of just adding some guaranteed true clause to
> the end when trimming, is that similar to what you were talking about?

Yes, that should work too.

-Yonik

Mime
View raw message