Nothing is wrong. When the maximum relevance score is greater than one, all hit scores are normalized (making the highest score 1.0). When the maximum score is less than 1, normalization does not occur. The more complex the query, the more likely that the raw (non-normalized) score will be less than one. Use searcher.explain() to get the details.
HTH, Terry ----- Original Message ----- From: "uddam chukmol" <[EMAIL PROTECTED]> To: "Lucene Users List" <[EMAIL PROTECTED]> Sent: Friday, June 04, 2004 8:39 AM Subject: why the score is not always 1.0 when comparing two identical strings? > hi, > > i'm not so convinced by the way Lucene compute the score. > > I tried to compare two string by using a program. In the program, i index the first string as if i indexed a document and use the queryParser with the same analyzer that I used to index the first string to analyze my second string and to form a query from it. > > I run the program for the first time with the first string as: > "This is the text to index with Lucene CREATE TABLE Elements ( TYPELEMENT varchar (255) NULL , CLEELEMENT varchar (255) NULL , LIBELEM varchar (255) NULL , CODENTITE varchar (255) NULL , CLEENTITE varchar (255) NULL , DONNNEEA1 varchar (255) NULL , DONNEEB1 varchar (255) NULL , DONNEEA2 varchar (255) NULL , DONNEEB2 varchar (255) NULL , DONNEEA3 varchar (255) NULL , DONNEEB3 varchar (255) NULL , DONNEEA4 varchar (255) NULL , DONNEEB4 varchar (255) NULL , DONNEEA5 varchar (255) NULL , DONNEEB5 varchar (255) NULL , TOP1 varchar (255) NULL , TOP2 varchar (255) NULL , TOP3 varchar (255) NULL , TOP4 varchar (255) NULL , TOP5 varchar (255) NULL , QTE1 varchar (255) NULL , QTE2 varchar (255) NULL , QTE3 varchar (255) NULL , MONTANT1 varchar (255) NULL , MONTANT2 varchar (255) NULL , MONTANT3 varchar (255) NULL , DATE1 varchar (255) NULL , DATE2 varchar (255) NULL , DATE3 varchar (255) NULL , STATUT varchar (255) NULL , DATPRISENCPTSTAT varchar (255) NULL )". > > I used the same string as to form my query and i got the final score of these two string which is 1.0. > > Then something suprised me when i changed to two strings into "All work and no play makes Jack a dull boy" and compared them by using one as a document and other to form the query. The result was just not 1.0. it was 0.3033.. instead. > > I used Eclipse as my Java Editor. Any conflict with Lucene? > > Any idea/suggestion of what went wrong over here? > > Uddam > > > --------------------------------- > Do you Yahoo!? > Friends. Fun. Try the all-new Yahoo! Messenger --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
