> From: Che Dong [mailto:[EMAIL PROTECTED]] > > here is example for sort result with score multi by rank field; > > scorer.score(new HitCollector() { > public final void collect(int doc, float score) { > [ ... ] > String rank = reader.doc(doc).getField("rank").stringValue();
The problem is that a call to getField() makes searches an order of magnitude slower. Doing this efficiently is possible, but requires more than what you present. For more information, see: http://www.mail-archive.com/[email protected]/msg00825.html > I think if Search have a abstract layer for Sorter and use > Searcher like > search(Query,Filter,Sorter) will make lucene convenience for more > applications. This would be great, if done efficiently. Unfortunately, any interface which sorts Document objects is bound to be slow. One could devise an API that sorts hits by the value of a field. It would need to cache all of the values of that field so that they could be efficiently randomly accessed. I would welcome such a contribution. Doug -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
