sortfield.html

来自「 Lucene是apache软件基金会[4] jakarta项目组的一个子项目」· HTML 代码 · 共 749 行 · 第 1/3 页

HTML
749
字号
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/lucene/search/SortField.html#SortField(java.lang.String, java.util.Locale, boolean)">SortField</A></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>&nbsp;field,          <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Locale.html" title="class or interface in java.util">Locale</A>&nbsp;locale,          boolean&nbsp;reverse)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a sort, possibly in reverse, by terms in the given field sorted according to the given locale.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/lucene/search/SortField.html#SortField(java.lang.String, org.apache.lucene.search.SortComparatorSource)">SortField</A></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>&nbsp;field,          <A HREF="../../../../org/apache/lucene/search/SortComparatorSource.html" title="interface in org.apache.lucene.search">SortComparatorSource</A>&nbsp;comparator)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a sort with a custom comparison function.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/lucene/search/SortField.html#SortField(java.lang.String, org.apache.lucene.search.SortComparatorSource, boolean)">SortField</A></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>&nbsp;field,          <A HREF="../../../../org/apache/lucene/search/SortComparatorSource.html" title="interface in org.apache.lucene.search">SortComparatorSource</A>&nbsp;comparator,          boolean&nbsp;reverse)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a sort, possibly in reverse, with a custom comparison function.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== 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>&nbsp;<A HREF="../../../../org/apache/lucene/search/SortComparatorSource.html" title="interface in org.apache.lucene.search">SortComparatorSource</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/search/SortField.html#getFactory()">getFactory</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/search/SortField.html#getField()">getField</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the name of the field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Locale.html" title="class or interface in java.util">Locale</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/search/SortField.html#getLocale()">getLocale</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the Locale by which term values are interpreted.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/search/SortField.html#getReverse()">getReverse</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns whether the sort should be reversed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/search/SortField.html#getType()">getType</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the type of contents in the field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/search/SortField.html#toString()">toString</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<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="SCORE"><!-- --></A><H3>
SCORE</H3>
<PRE>
public static final int <B>SCORE</B></PRE>
<DL>
<DD>Sort by document score (relevancy).  Sort values are Float and higher values are at the front.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.lucene.search.SortField.SCORE">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="DOC"><!-- --></A><H3>
DOC</H3>
<PRE>
public static final int <B>DOC</B></PRE>
<DL>
<DD>Sort by document number (index order).  Sort values are Integer and lower values are at the front.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.lucene.search.SortField.DOC">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="AUTO"><!-- --></A><H3>
AUTO</H3>
<PRE>
public static final int <B>AUTO</B></PRE>
<DL>
<DD>Guess type of sort based on field contents.  A regular expression is used to look at the first term indexed for the field and determine if it represents an integer number, a floating point number, or just arbitrary string characters.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.lucene.search.SortField.AUTO">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="STRING"><!-- --></A><H3>
STRING</H3>
<PRE>
public static final int <B>STRING</B></PRE>
<DL>
<DD>Sort using term values as Strings.  Sort values are String and lower values are at the front.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.lucene.search.SortField.STRING">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="INT"><!-- --></A><H3>
INT</H3>
<PRE>
public static final int <B>INT</B></PRE>
<DL>
<DD>Sort using term values as encoded Integers.  Sort values are Integer and lower values are at the front.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.lucene.search.SortField.INT">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="FLOAT"><!-- --></A><H3>
FLOAT</H3>
<PRE>
public static final int <B>FLOAT</B></PRE>
<DL>
<DD>Sort using term values as encoded Floats.  Sort values are Float and lower values are at the front.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.lucene.search.SortField.FLOAT">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="CUSTOM"><!-- --></A><H3>
CUSTOM</H3>
<PRE>
public static final int <B>CUSTOM</B></PRE>
<DL>
<DD>Sort using a custom Comparator.  Sort values are any Comparable and sorting is done according to natural order.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.lucene.search.SortField.CUSTOM">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="FIELD_SCORE"><!-- --></A><H3>
FIELD_SCORE</H3>
<PRE>
public static final <A HREF="../../../../org/apache/lucene/search/SortField.html" title="class in org.apache.lucene.search">SortField</A> <B>FIELD_SCORE</B></PRE>
<DL>
<DD>Represents sorting by document score (relevancy).
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="FIELD_DOC"><!-- --></A><H3>
FIELD_DOC</H3>
<PRE>
public static final <A HREF="../../../../org/apache/lucene/search/SortField.html" title="class in org.apache.lucene.search">SortField</A> <B>FIELD_DOC</B></PRE>
<DL>
<DD>Represents sorting by document number (index order).
<P>
<DL>
</DL>
</DL>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="SortField(java.lang.String)"><!-- --></A><H3>
SortField</H3>
<PRE>
public <B>SortField</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>&nbsp;field)</PRE>
<DL>
<DD>Creates a sort by terms in the given field where the type of term value is determined dynamically (<A HREF="../../../../org/apache/lucene/search/SortField.html#AUTO"><CODE>AUTO</CODE></A>).
<P>
<DT><B>Parameters:</B><DD><CODE>field</CODE> - Name of field to sort by, cannot be <code>null</code>.</DL>
<HR>

<A NAME="SortField(java.lang.String, boolean)"><!-- --></A><H3>
SortField</H3>
<PRE>
public <B>SortField</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>&nbsp;field,                 boolean&nbsp;reverse)</PRE>
<DL>
<DD>Creates a sort, possibly in reverse, by terms in the given field where

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?