document.html

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

HTML
701
字号
<CODE>&nbsp;<A HREF="../../../../org/apache/lucene/document/Field.html" title="class in org.apache.lucene.document">Field</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/document/Document.html#getFields(java.lang.String)">getFields</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;name)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array of <A HREF="../../../../org/apache/lucene/document/Field.html" title="class in org.apache.lucene.document"><CODE>Field</CODE></A>s with the given name.</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/document/Document.html#getValues(java.lang.String)">getValues</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;name)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array of values of the field specified as the method parameter.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/document/Document.html#removeField(java.lang.String)">removeField</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;name)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes field with the specified name from the document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/document/Document.html#removeFields(java.lang.String)">removeFields</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;name)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes all fields with the given name from the document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/document/Document.html#setBoost(float)">setBoost</A></B>(float&nbsp;boost)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets a boost factor for hits on any field of this document.</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/document/Document.html#toString()">toString</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prints the fields of a document for human consumption.</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 =========== -->


<!-- ========= 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="Document()"><!-- --></A><H3>
Document</H3>
<PRE>
public <B>Document</B>()</PRE>
<DL>
<DD>Constructs a new document with no fields.
<P>
</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="setBoost(float)"><!-- --></A><H3>
setBoost</H3>
<PRE>
public void <B>setBoost</B>(float&nbsp;boost)</PRE>
<DL>
<DD>Sets a boost factor for hits on any field of this document.  This value will be multiplied into the score of all hits on this document. <p>Values are multiplied into the value of <A HREF="../../../../org/apache/lucene/document/Fieldable.html#getBoost()"><CODE>Fieldable.getBoost()</CODE></A> of each field in this document.  Thus, this method in effect sets a default boost for the fields of this document.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/document/Fieldable.html#setBoost(float)"><CODE>Fieldable.setBoost(float)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getBoost()"><!-- --></A><H3>
getBoost</H3>
<PRE>
public float <B>getBoost</B>()</PRE>
<DL>
<DD>Returns the boost factor for hits on any field of this document. <p>The default value is 1.0. <p>Note: This value is not stored directly with the document in the index. Documents returned from <A HREF="../../../../org/apache/lucene/index/IndexReader.html#document(int)"><CODE>IndexReader.document(int)</CODE></A> and <A HREF="../../../../org/apache/lucene/search/Hits.html#doc(int)"><CODE>Hits.doc(int)</CODE></A> may thus not have the same value present as when this document was indexed.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/document/Document.html#setBoost(float)"><CODE>setBoost(float)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="add(org.apache.lucene.document.Fieldable)"><!-- --></A><H3>
add</H3>
<PRE>
public final void <B>add</B>(<A HREF="../../../../org/apache/lucene/document/Fieldable.html" title="interface in org.apache.lucene.document">Fieldable</A>&nbsp;field)</PRE>
<DL>
<DD><p>Adds a field to a document.  Several fields may be added with the same name.  In this case, if the fields are indexed, their text is treated as though appended for the purposes of search.</p> <p> Note that add like the removeField(s) methods only makes sense  prior to adding a document to an index. These methods cannot be used to change the content of an existing index! In order to achieve this, a document has to be deleted from an index and a new changed version of that document has to be added.</p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="removeField(java.lang.String)"><!-- --></A><H3>
removeField</H3>
<PRE>
public final void <B>removeField</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;name)</PRE>
<DL>
<DD><p>Removes field with the specified name from the document. If multiple fields exist with this name, this method removes the first field that has been added. If there is no field with the specified name, the document remains unchanged.</p> <p> Note that the removeField(s) methods like the add method only make sense  prior to adding a document to an index. These methods cannot be used to change the content of an existing index! In order to achieve this, a document has to be deleted from an index and a new changed version of that document has to be added.</p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="removeFields(java.lang.String)"><!-- --></A><H3>
removeFields</H3>
<PRE>
public final void <B>removeFields</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;name)</PRE>
<DL>
<DD><p>Removes all fields with the given name from the document. If there is no field with the specified name, the document remains unchanged.</p> <p> Note that the removeField(s) methods like the add method only make sense  prior to adding a document to an index. These methods cannot be used to change the content of an existing index! In order to achieve this, a document has to be deleted from an index and a new changed version of that document has to be added.</p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getField(java.lang.String)"><!-- --></A><H3>
getField</H3>
<PRE>
public final <A HREF="../../../../org/apache/lucene/document/Field.html" title="class in org.apache.lucene.document">Field</A> <B>getField</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;name)</PRE>
<DL>
<DD>Returns a field with the given name if any exist in this document, or null.  If multiple fields exists with this name, this method returns the first value added. Do not use this method with lazy loaded fields.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getFieldable(java.lang.String)"><!-- --></A><H3>
getFieldable</H3>
<PRE>
public <A HREF="../../../../org/apache/lucene/document/Fieldable.html" title="interface in org.apache.lucene.document">Fieldable</A> <B>getFieldable</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;name)</PRE>
<DL>
<DD>Returns a field with the given name if any exist in this document, or null.  If multiple fields exists with this name, this method returns the first value added.
<P>
<DD><DL>
</DL>
</DD>

⌨️ 快捷键说明

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