lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: two api ideas
Date Tue, 20 Apr 2004 16:05:49 GMT
Both changes sound reasonable to me.

Tim Jones wrote:
> What do you guys think of these two ideas - would they be good additions to
> the API (or maybe the sandbox)?
> 
> 
> 1. New type of SortField, allowing custom comparison function:
> 
>    public SortField (String field,      // which field to sort
>                      SortComparatorFactory comparator,  // how to sort
>                      boolean reverse)   // whether to reverse
> 
>    // returns a comparator for the given IndexReader and field
>    public interface SortComparatorFactory {
>       ScoreDocLookupComparator comparator (IndexReader reader,
>                      String fieldname)
>    }
> 
>    The thinking behind this idea is it would allow a user of the API to make
> up any type of Document comparison function they want - the ultimate "slice
> and dice" (thanks to Erik :) result sorter.  It would involve a few very
> minor changes to the existing Sort api, such as changing
> ScoreDocComparator.sortValue() to return a Comparable instead of just an
> Object; making ScoreDocComparator and ScoreDocLookupComparator public
> instead of package private.
> 
> 
> 2. New query type: FilteredQuery
> 
>    public class FilteredQuery (Query query, Filter filter)
> 
>    The thinking behind this idea is it would allow an individual query to be
> filtered, instead of just the whole search.  Probably not that common, but I
> wrote it recently to handle a query like:
> 
>    QueryX OR (QueryY filtered by FilterA)
> 
> 
> Thanks,
> 
> Tim
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message