lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gol...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/search Similarity.java
Date Wed, 13 Oct 2004 18:42:20 GMT
goller      2004/10/13 11:42:20

  Modified:    src/java/org/apache/lucene/search Similarity.java
  Log:
  Improved Javadoc: Formula for score computation
  corrected.
  
  Revision  Changes    Path
  1.16      +27 -4     jakarta-lucene/src/java/org/apache/lucene/search/Similarity.java
  
  Index: Similarity.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/Similarity.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Similarity.java	10 Oct 2004 18:43:18 -0000	1.15
  +++ Similarity.java	13 Oct 2004 18:42:20 -0000	1.16
  @@ -40,14 +40,15 @@
    *    <td valign="middle" align="center">
    *    <big><big><big><big><big>&Sigma;</big></big></big></big></big></td>
    *    <td valign="middle"><small>
  - *    {@link #tf(int) tf}(t in d) *
  - *    {@link #idf(Term,Searcher) idf}(t) *
  + *    ( {@link #tf(int) tf}(t in d) *
  + *    {@link #idf(Term,Searcher) idf}(t)^2 *
  + *    {@link Query#getBoost getBoost}(t in q) *
    *    {@link Field#getBoost getBoost}(t.field in d) *
  - *    {@link #lengthNorm(String,int) lengthNorm}(t.field in d)
  + *    {@link #lengthNorm(String,int) lengthNorm}(t.field in d) )
    *    </small></td>
    *    <td valign="middle" rowspan="2">&nbsp;*
    *    {@link #coord(int,int) coord}(q,d) *
  - *    {@link #queryNorm(float) queryNorm}(q)
  + *    {@link #queryNorm(float) queryNorm}(sumOfSqaredWeights)
    *    </td>
    *  </tr>
    *  <tr>
  @@ -56,6 +57,28 @@
    *    </td>
    *  </tr>
    * </table>
  + * 
  + * <p> where
  + * 
  + * <table cellpadding="0" cellspacing="0" border="0">
  + *  <tr>
  + *    <td valign="middle" align="right" rowspan="2">sumOfSqaredWeights =<br></td>
  + *    <td valign="middle" align="center">
  + *    <big><big><big><big><big>&Sigma;</big></big></big></big></big></td>
  + *    <td valign="middle"><small>
  + *    ( {@link #idf(Term,Searcher) idf}(t) *
  + *    {@link Query#getBoost getBoost}(t in q) )^2
  + *    </small></td>
  + *  </tr>
  + *  <tr>
  + *   <td valign="top" align="right">
  + *    <small>t in q</small>
  + *    </td>
  + *  </tr>
  + * </table>
  + * 
  + * <p> Note that the above formula is motivated by the cosine-distance or dot-product
  + * between document and query vector, which is implemented by {@link DefaultSimilarity}.
    *
    * @see #setDefault(Similarity)
    * @see IndexWriter#setSimilarity(Similarity)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message