On Tuesday 15 July 2003 02:03, Che Dong wrote: > Hi All: > In lucene 1.3 rc1 release included a Similarity for custom scoring. Is it > possible implement a docID based or (some field value based )scoring beside > DefautlSimilarity?
Similarity is based on things that can be found in the index, and not on things that are obtained by retrieving stored fields of documents. In general, retrieving stored values during search is bad for search performance. When you want to sort by docId you could: - first collect all document numbers matching the query, evt. raise an exception when there are too many hits, - then retrieve all documents in document nr order, together with the docId stored field values. (iirc you also get documents in doc nr order when you use your own results collector.) - finally sort your results by retrieved docId. Since one normally needs to retrieve some stored fields anyway, this doesn't hurt performance. Kind regards, Ype Kingma --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
