?? indexreader.html
字號:
the specified field of this document, if the field had the storeTermVector flag set. If termvectors had been stored with positions or offsets, a TermPositionsVector is returned.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>docNumber</CODE> - document for which the term frequency vector is returned<DD><CODE>field</CODE> - field for which the term frequency vector is returned.<DT><B>Returns:</B><DD>term frequency vector May be null if field does not exist in the specified document or term vector was not stored.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if index cannot be accessed<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/document/Field.TermVector.html" title="class in org.apache.lucene.document"><CODE>Field.TermVector</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="indexExists(java.lang.String)"><!-- --></A><H3>
indexExists</H3>
<PRE>
public static boolean <B>indexExists</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> directory)</PRE>
<DL>
<DD>Returns <code>true</code> if an index exists at the specified directory. If the directory does not exist or if there is no index in it. <code>false</code> is returned.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>directory</CODE> - the directory to check for an index<DT><B>Returns:</B><DD><code>true</code> if an index exists; <code>false</code> otherwise</DL>
</DD>
</DL>
<HR>
<A NAME="indexExists(java.io.File)"><!-- --></A><H3>
indexExists</H3>
<PRE>
public static boolean <B>indexExists</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/File.html" title="class or interface in java.io">File</A> directory)</PRE>
<DL>
<DD>Returns <code>true</code> if an index exists at the specified directory. If the directory does not exist or if there is no index in it.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>directory</CODE> - the directory to check for an index<DT><B>Returns:</B><DD><code>true</code> if an index exists; <code>false</code> otherwise</DL>
</DD>
</DL>
<HR>
<A NAME="indexExists(org.apache.lucene.store.Directory)"><!-- --></A><H3>
indexExists</H3>
<PRE>
public static boolean <B>indexExists</B>(<A HREF="../../../../org/apache/lucene/store/Directory.html" title="class in org.apache.lucene.store">Directory</A> directory) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Returns <code>true</code> if an index exists at the specified directory. If the directory does not exist or if there is no index in it.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>directory</CODE> - the directory to check for an index<DT><B>Returns:</B><DD><code>true</code> if an index exists; <code>false</code> otherwise<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if there is a problem with accessing the index</DL>
</DD>
</DL>
<HR>
<A NAME="numDocs()"><!-- --></A><H3>
numDocs</H3>
<PRE>
public abstract int <B>numDocs</B>()</PRE>
<DL>
<DD>Returns the number of documents in this index.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="maxDoc()"><!-- --></A><H3>
maxDoc</H3>
<PRE>
public abstract int <B>maxDoc</B>()</PRE>
<DL>
<DD>Returns one greater than the largest possible document number. This may be used to, e.g., determine how big to allocate an array which will have an element for every document number in an index.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="document(int)"><!-- --></A><H3>
document</H3>
<PRE>
public <A HREF="../../../../org/apache/lucene/document/Document.html" title="class in org.apache.lucene.document">Document</A> <B>document</B>(int n) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Returns the stored fields of the <code>n</code><sup>th</sup> <code>Document</code> in this index.
<P>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL>
</DD>
</DL>
<HR>
<A NAME="document(int, org.apache.lucene.document.FieldSelector)"><!-- --></A><H3>
document</H3>
<PRE>
public abstract <A HREF="../../../../org/apache/lucene/document/Document.html" title="class in org.apache.lucene.document">Document</A> <B>document</B>(int n, <A HREF="../../../../org/apache/lucene/document/FieldSelector.html" title="interface in org.apache.lucene.document">FieldSelector</A> fieldSelector) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Get the <A HREF="../../../../org/apache/lucene/document/Document.html" title="class in org.apache.lucene.document"><CODE>Document</CODE></A> at the <code>n</code><sup>th</sup> position. The <A HREF="../../../../org/apache/lucene/document/FieldSelector.html" title="interface in org.apache.lucene.document"><CODE>FieldSelector</CODE></A> may be used to determine what <A HREF="../../../../org/apache/lucene/document/Field.html" title="class in org.apache.lucene.document"><CODE>Field</CODE></A>s to load and how they should be loaded. <b>NOTE:</b> If this Reader (more specifically, the underlying <CODE>FieldsReader</CODE> is closed before the lazy <A HREF="../../../../org/apache/lucene/document/Field.html" title="class in org.apache.lucene.document"><CODE>Field</CODE></A> is loaded an exception may be thrown. If you want the value of a lazy <A HREF="../../../../org/apache/lucene/document/Field.html" title="class in org.apache.lucene.document"><CODE>Field</CODE></A> to be available after closing you must explicitly load it or fetch the Document again with a new loader.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>n</CODE> - Get the document at the <code>n</code><sup>th</sup> position<DD><CODE>fieldSelector</CODE> - The <A HREF="../../../../org/apache/lucene/document/FieldSelector.html" title="interface in org.apache.lucene.document"><CODE>FieldSelector</CODE></A> to use to determine what Fields should be loaded on the Document. May be null, in which case all Fields will be loaded.<DT><B>Returns:</B><DD>The stored fields of the <A HREF="../../../../org/apache/lucene/document/Document.html" title="class in org.apache.lucene.document"><CODE>Document</CODE></A> at the nth position<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - If there is a problem reading this document<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/document/Fieldable.html" title="interface in org.apache.lucene.document"><CODE>Fieldable</CODE></A>, <A HREF="../../../../org/apache/lucene/document/FieldSelector.html" title="interface in org.apache.lucene.document"><CODE>FieldSelector</CODE></A>, <A HREF="../../../../org/apache/lucene/document/SetBasedFieldSelector.html" title="class in org.apache.lucene.document"><CODE>SetBasedFieldSelector</CODE></A>, <A HREF="../../../../org/apache/lucene/document/LoadFirstFieldSelector.html" title="class in org.apache.lucene.document"><CODE>LoadFirstFieldSelector</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="isDeleted(int)"><!-- --></A><H3>
isDeleted</H3>
<PRE>
public abstract boolean <B>isDeleted</B>(int n)</PRE>
<DL>
<DD>Returns true if document <i>n</i> has been deleted
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="hasDeletions()"><!-- --></A><H3>
hasDeletions</H3>
<PRE>
public abstract boolean <B>hasDeletions</B>()</PRE>
<DL>
<DD>Returns true if any documents have been deleted
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="hasNorms(java.lang.String)"><!-- --></A><H3>
hasNorms</H3>
<PRE>
public boolean <B>hasNorms</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> field) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Returns true if there are norms stored for this field.
<P>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL>
</DD>
</DL>
<HR>
<A NAME="norms(java.lang.String)"><!-- --></A><H3>
norms</H3>
<PRE>
public abstract byte[] <B>norms</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> field) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Returns the byte-encoded normalization factor for the named field of every document. This is used by the search code to score documents.
<P>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE><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="norms(java.lang.String, byte[], int)"><!-- --></A><H3>
norms</H3>
<PRE>
public abstract void <B>norms</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> field, byte[] bytes, int offset) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Reads the byte-encoded normalization factor for the named field of every document. This is used by the search code to score documents.
<P>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE><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="setNorm(int, java.lang.String, byte)"><!-- --></A><H3>
setNorm</H3>
<PRE>
public final void <B>setNorm</B>(int doc, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> field, byte value) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Expert: Resets the normalization factor for the named field of the named document. The norm represents the product of the field's <CODE>boost</CODE> and its <A HREF="../../../../org/apache/lucene/search/Similarity.html#lengthNorm(java.lang.String, int)"><CODE>length normalization</CODE></A>. Thus, to preserve the length normalization values when resetting this, one should base the new value upon the old.
<P>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/index/IndexReader.html#norms(java.lang.String)"><CODE>norms(String)</CODE></A>, <A HREF="../../../../org/apache/lucene/search/Similarity.html#decodeNorm(byte)"><CODE>Similarity.decodeNorm(byte)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="doSetNorm(int, java.lang.String, byte)"><!-- --></A><H3>
doSetNorm</H3>
<PRE>
protected abs
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -