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