similaritydelegator.html
来自「 Lucene是apache软件基金会[4] jakarta项目组的一个子项目」· HTML 代码 · 共 468 行 · 第 1/2 页
HTML
468 行
public <B>SimilarityDelegator</B>(<A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A> delegee)</PRE>
<DL>
<DD>Construct a <A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search"><CODE>Similarity</CODE></A> that delegates all methods to another.
<P>
<DT><B>Parameters:</B><DD><CODE>delegee</CODE> - the Similarity implementation to delegate to</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="lengthNorm(java.lang.String, int)"><!-- --></A><H3>
lengthNorm</H3>
<PRE>
public float <B>lengthNorm</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> fieldName, int numTerms)</PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A></CODE></B></DD>
<DD>Computes the normalization value for a field given the total number of terms contained in a field. These values, together with field boosts, are stored in an index and multipled into scores for hits on each field by the search code. <p>Matches in longer fields are less precise, so implementations of this method usually return smaller values when <code>numTokens</code> is large, and larger values when <code>numTokens</code> is small. <p>That these values are computed under <CODE>IndexWriter#addDocument(org.apache.lucene.document.Document)</CODE> and stored then using <A HREF="../../../../org/apache/lucene/search/Similarity.html#encodeNorm(float)"><CODE>Similarity.encodeNorm(float)</CODE></A>. Thus they have limited precision, and documents must be re-indexed if this method is altered.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html#lengthNorm(java.lang.String, int)">lengthNorm</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>fieldName</CODE> - the name of the field<DD><CODE>numTerms</CODE> - the total number of tokens contained in fields named <i>fieldName</i> of <i>doc</i>.<DT><B>Returns:</B><DD>a normalization factor for hits on this field of this document<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/document/AbstractField.html#setBoost(float)"><CODE>AbstractField.setBoost(float)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="queryNorm(float)"><!-- --></A><H3>
queryNorm</H3>
<PRE>
public float <B>queryNorm</B>(float sumOfSquaredWeights)</PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A></CODE></B></DD>
<DD>Computes the normalization value for a query given the sum of the squared weights of each of the query terms. This value is then multipled into the weight of each query term. <p>This does not affect ranking, but rather just attempts to make scores from different queries comparable.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html#queryNorm(float)">queryNorm</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sumOfSquaredWeights</CODE> - the sum of the squares of query term weights<DT><B>Returns:</B><DD>a normalization factor for query weights</DL>
</DD>
</DL>
<HR>
<A NAME="tf(float)"><!-- --></A><H3>
tf</H3>
<PRE>
public float <B>tf</B>(float freq)</PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A></CODE></B></DD>
<DD>Computes a score factor based on a term or phrase's frequency in a document. This value is multiplied by the <A HREF="../../../../org/apache/lucene/search/Similarity.html#idf(org.apache.lucene.index.Term, org.apache.lucene.search.Searcher)"><CODE>Similarity.idf(Term, Searcher)</CODE></A> factor for each term in the query and these products are then summed to form the initial score for a document. <p>Terms and phrases repeated in a document indicate the topic of the document, so implementations of this method usually return larger values when <code>freq</code> is large, and smaller values when <code>freq</code> is small.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html#tf(float)">tf</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>freq</CODE> - the frequency of a term within a document<DT><B>Returns:</B><DD>a score factor based on a term's within-document frequency</DL>
</DD>
</DL>
<HR>
<A NAME="sloppyFreq(int)"><!-- --></A><H3>
sloppyFreq</H3>
<PRE>
public float <B>sloppyFreq</B>(int distance)</PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A></CODE></B></DD>
<DD>Computes the amount of a sloppy phrase match, based on an edit distance. This value is summed for each sloppy phrase match in a document to form the frequency that is passed to <A HREF="../../../../org/apache/lucene/search/Similarity.html#tf(float)"><CODE>Similarity.tf(float)</CODE></A>. <p>A phrase match with a small edit distance to a document passage more closely matches the document, so implementations of this method usually return larger values when the edit distance is small and smaller values when it is large.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html#sloppyFreq(int)">sloppyFreq</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>distance</CODE> - the edit distance of this sloppy phrase match<DT><B>Returns:</B><DD>the frequency increment for this match<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/search/PhraseQuery.html#setSlop(int)"><CODE>PhraseQuery.setSlop(int)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="idf(int, int)"><!-- --></A><H3>
idf</H3>
<PRE>
public float <B>idf</B>(int docFreq, int numDocs)</PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A></CODE></B></DD>
<DD>Computes a score factor based on a term's document frequency (the number of documents which contain the term). This value is multiplied by the <A HREF="../../../../org/apache/lucene/search/Similarity.html#tf(int)"><CODE>Similarity.tf(int)</CODE></A> factor for each term in the query and these products are then summed to form the initial score for a document. <p>Terms that occur in fewer documents are better indicators of topic, so implementations of this method usually return larger values for rare terms, and smaller values for common terms.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html#idf(int, int)">idf</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>docFreq</CODE> - the number of documents which contain the term<DD><CODE>numDocs</CODE> - the total number of documents in the collection<DT><B>Returns:</B><DD>a score factor based on the term's document frequency</DL>
</DD>
</DL>
<HR>
<A NAME="coord(int, int)"><!-- --></A><H3>
coord</H3>
<PRE>
public float <B>coord</B>(int overlap, int maxOverlap)</PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A></CODE></B></DD>
<DD>Computes a score factor based on the fraction of all query terms that a document contains. This value is multiplied into scores. <p>The presence of a large portion of the query terms indicates a better match with the query, so implementations of this method usually return larger values when the ratio between these parameters is large and smaller values when the ratio between them is small.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html#coord(int, int)">coord</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>overlap</CODE> - the number of query terms matched in the document<DD><CODE>maxOverlap</CODE> - the total number of terms in the query<DT><B>Returns:</B><DD>a score factor based on term overlap with the query</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SimilarityDelegator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search"><B>PREV CLASS</B></A>
<A HREF="../../../../org/apache/lucene/search/Sort.html" title="class in org.apache.lucene.search"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="SimilarityDelegator.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?