If you modify all scores to 100%, why can't you just ignore them? Anyhow, if all you want to modify is idf(), using the modified similarity class only at search time is ok. For further pointers and explanations take a look at http://lucene.apache.org/java/docs/scoring.html
Regards, Doron jreeman <[EMAIL PROTECTED]> wrote on 02/03/2007 05:49:23: > > Hello > > The original message explaining why I wanted to overide DefaultSimilarity is > here : > > http://www.nabble.com/forum/ViewPost.jtp?post=9268781&framed=y > http://www.nabble.com/forum/ViewPost.jtp?post=9268781&framed=y > > Si I overided DefaultSimilarity like this : > > package org.apache.lenya.lucene.index; > > import org.apache.lucene.search.DefaultSimilarity; > > public class PersonalSimilarity extends DefaultSimilarity { > public float idf(int docFreq, int numDocs) > { > return 1; > } > > } > > And I use it like this : > > PersonalSimilarity ds = new PersonalSimilarity(); > searcher.setSimilarity(ds); > > After that, all the hit have the same score. > > But my new question is : do I need to use this PersonalSimilarity for the > IndexWriter because currently it yet works fine only in the Searcher. > > -- > View this message in context: http://www.nabble.com/Overriding- > Similarity-tf2128934.html#a9269838 > Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]