scoredoccomparator.html
来自「 Lucene是apache软件基金会[4] jakarta项目组的一个子项目」· HTML 代码 · 共 335 行
HTML
335 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2_04) on Wed Feb 14 11:49:17 EST 2007 -->
<TITLE>
ScoreDocComparator (Lucene 2.1.0 API)
</TITLE>
<META NAME="keywords" CONTENT="org.apache.lucene.search.ScoreDocComparator interface">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="ScoreDocComparator (Lucene 2.1.0 API)";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" 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_top_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/ScoreDocComparator.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/FieldCache.IntParser.html" title="interface in org.apache.lucene.search"><B>PREV CLASS</B></A>
<A HREF="../../../../org/apache/lucene/search/Searchable.html" title="interface 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="ScoreDocComparator.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 | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.lucene.search</FONT>
<BR>
Interface ScoreDocComparator</H2>
<HR>
<DL>
<DT>public interface <B>ScoreDocComparator</B></DL>
<P>
Expert: Compares two ScoreDoc objects for sorting. <p>Created: Feb 3, 2004 9:00:16 AM
<P>
<P>
<DL>
<DT><B>Since:</B></DT> <DD>lucene 1.4</DD><DT><B>Version:</B></DT> <DD>$Id: ScoreDocComparator.java 472959 2006-11-09 16:21:50Z yonik $</DD><DT><B>Author:</B></DT> <DD>Tim Jones (Nacimiento Software)</DD></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../../org/apache/lucene/search/ScoreDocComparator.html" title="interface in org.apache.lucene.search">ScoreDocComparator</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/search/ScoreDocComparator.html#INDEXORDER">INDEXORDER</A></B></CODE>
<BR>
Special comparator for sorting hits according to index order (document number).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../../org/apache/lucene/search/ScoreDocComparator.html" title="interface in org.apache.lucene.search">ScoreDocComparator</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/search/ScoreDocComparator.html#RELEVANCE">RELEVANCE</A></B></CODE>
<BR>
Special comparator for sorting hits according to computed relevance (document score).</TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/search/ScoreDocComparator.html#compare(org.apache.lucene.search.ScoreDoc, org.apache.lucene.search.ScoreDoc)">compare</A></B>(<A HREF="../../../../org/apache/lucene/search/ScoreDoc.html" title="class in org.apache.lucene.search">ScoreDoc</A> i, <A HREF="../../../../org/apache/lucene/search/ScoreDoc.html" title="class in org.apache.lucene.search">ScoreDoc</A> j)</CODE>
<BR>
Compares two ScoreDoc objects and returns a result indicating their sort order.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/search/ScoreDocComparator.html#sortType()">sortType</A></B>()</CODE>
<BR>
Returns the type of sort.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Comparable.html" title="class or interface in java.lang">Comparable</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/search/ScoreDocComparator.html#sortValue(org.apache.lucene.search.ScoreDoc)">sortValue</A></B>(<A HREF="../../../../org/apache/lucene/search/ScoreDoc.html" title="class in org.apache.lucene.search">ScoreDoc</A> i)</CODE>
<BR>
Returns the value used to sort the given document.</TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="RELEVANCE"><!-- --></A><H3>
RELEVANCE</H3>
<PRE>
public static final <A HREF="../../../../org/apache/lucene/search/ScoreDocComparator.html" title="interface in org.apache.lucene.search">ScoreDocComparator</A> <B>RELEVANCE</B></PRE>
<DL>
<DD>Special comparator for sorting hits according to computed relevance (document score).
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="INDEXORDER"><!-- --></A><H3>
INDEXORDER</H3>
<PRE>
public static final <A HREF="../../../../org/apache/lucene/search/ScoreDocComparator.html" title="interface in org.apache.lucene.search">ScoreDocComparator</A> <B>INDEXORDER</B></PRE>
<DL>
<DD>Special comparator for sorting hits according to index order (document number).
<P>
<DL>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ 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="compare(org.apache.lucene.search.ScoreDoc, org.apache.lucene.search.ScoreDoc)"><!-- --></A><H3>
compare</H3>
<PRE>
public int <B>compare</B>(<A HREF="../../../../org/apache/lucene/search/ScoreDoc.html" title="class in org.apache.lucene.search">ScoreDoc</A> i, <A HREF="../../../../org/apache/lucene/search/ScoreDoc.html" title="class in org.apache.lucene.search">ScoreDoc</A> j)</PRE>
<DL>
<DD>Compares two ScoreDoc objects and returns a result indicating their sort order.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>i</CODE> - First ScoreDoc<DD><CODE>j</CODE> - Second ScoreDoc<DT><B>Returns:</B><DD><code>-1</code> if <code>i</code> should come before <code>j</code><br><code>1</code> if <code>i</code> should come after <code>j</code><br><code>0</code> if they are equal<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Comparator.html" title="class or interface in java.util"><CODE>Comparator</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="sortValue(org.apache.lucene.search.ScoreDoc)"><!-- --></A><H3>
sortValue</H3>
<PRE>
public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Comparable.html" title="class or interface in java.lang">Comparable</A> <B>sortValue</B>(<A HREF="../../../../org/apache/lucene/search/ScoreDoc.html" title="class in org.apache.lucene.search">ScoreDoc</A> i)</PRE>
<DL>
<DD>Returns the value used to sort the given document. The object returned must implement the java.io.Serializable interface. This is used by multisearchers to determine how to collate results from their searchers.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>i</CODE> - Document<DT><B>Returns:</B><DD>Serializable object<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/search/FieldDoc.html" title="class in org.apache.lucene.search"><CODE>FieldDoc</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="sortType()"><!-- --></A><H3>
sortType</H3>
<PRE>
public int <B>sortType</B>()</PRE>
<DL>
<DD>Returns the type of sort. Should return <code>SortField.SCORE</code>, <code>SortField.DOC</code>, <code>SortField.STRING</code>, <code>SortField.INTEGER</code>, <code>SortField.FLOAT</code> or <code>SortField.CUSTOM</code>. It is not valid to return <code>SortField.AUTO</code>. This is used by multisearchers to determine how to collate results from their searchers.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>One of the constants in SortField.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/search/SortField.html" title="class in org.apache.lucene.search"><CODE>SortField</CODE></A></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/ScoreDocComparator.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/FieldCache.IntParser.html" title="interface in org.apache.lucene.search"><B>PREV CLASS</B></A>
<A HREF="../../../../org/apache/lucene/search/Searchable.html" title="interface 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="ScoreDocComparator.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 | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <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 + -
显示快捷键?