Alan Wang wrote:
I am trying to sort the search result with "lastModified" field. So I index
"lastModified " as Integer and Keyword into index and search with
search(Qurey query, Filter filter, int n, Sort sort) method. Just modified
in net.nutch.searcher.LuceneQueryOptimizer.optimize.
return searcher.search(query, filter, numHits,


new Sort( new SortField[]{
new SortField("lastModified", SortField.INT, true)
}
));


The result sure changed, and largely sorted by time. But it didn't exactly
sorted by lastModified. The results looks ugly, :(.

I can see two sources of problems:

1. You should sort by the "date" field, not "lastModified", since that's not indexed, and sorting requires an indexed field.

2. Not all pages have a lastModified value. You should change MoreIndexingFilter to always add a date. If no last modified is specified, then use the fetch date, fo.getFetchDate().

If you get this working, please send a patch. Even if it's a hack, it's a start for others.

Thanks,

Doug


------------------------------------------------------- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728 _______________________________________________ Nutch-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nutch-developers

Reply via email to