This is definitely helpful.
We can get rid of quite a bit of custom code we wrote and manually merge
with each release.
 
CC-


-----Original Message-----
From: Doug Cutting [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 11, 2005 5:30 PM
To: [email protected]
Subject: sorting search results

Currently query filters generate a Lucene Query.  But Lucene's search
methods have other parameters besides a query.  In particular, these can
also be passed a Filter and a Sort.  In part as a work-around, Nutch
automatically converts Lucene query clauses with zero boost into filters.
But there is currently no way to generate sorted results using Nutch's
search API.

To remedy this I propose that the QueryFilter API be changed to something
like:

public class SearchParameters {
   public BooleanQuery getQuery();
   public void setQuery(BooleanQuery clauses);

   public Filter getFilter();
   public void setFilter(Filter filter);

   public Sort getSort();
   public void getSort(Sort sort);
}

public interface QueryFilter {
   SearchParameters filter(Query input, SearchParameters output)
     throws QueryException;
}

If no one objects I will make this change and update all QueryFilters in
SVN.  Then I will add a SortQueryFilter that permits clauses like
"sort:date", and a DateRangeQueryFilter that uses Lucene's RangeFilter
(generally much more efficient than a RangeQuery).

Thoughts?

Doug


Reply via email to