indexmodifier.html

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

HTML
1,130
字号
<PRE>
protected <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/PrintStream.html" title="class or interface in java.io">PrintStream</A> <B>infoStream</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>

<A NAME="useCompoundFile"><!-- --></A><H3>
useCompoundFile</H3>
<PRE>
protected boolean <B>useCompoundFile</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>

<A NAME="maxBufferedDocs"><!-- --></A><H3>
maxBufferedDocs</H3>
<PRE>
protected int <B>maxBufferedDocs</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>

<A NAME="maxFieldLength"><!-- --></A><H3>
maxFieldLength</H3>
<PRE>
protected int <B>maxFieldLength</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>

<A NAME="mergeFactor"><!-- --></A><H3>
mergeFactor</H3>
<PRE>
protected int <B>mergeFactor</B></PRE>
<DL>
<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="IndexModifier(org.apache.lucene.store.Directory, org.apache.lucene.analysis.Analyzer, boolean)"><!-- --></A><H3>
IndexModifier</H3>
<PRE>
public <B>IndexModifier</B>(<A HREF="../../../../org/apache/lucene/store/Directory.html" title="class in org.apache.lucene.store">Directory</A>&nbsp;directory,                     <A HREF="../../../../org/apache/lucene/analysis/Analyzer.html" title="class in org.apache.lucene.analysis">Analyzer</A>&nbsp;analyzer,                     boolean&nbsp;create)              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>Open an index with write access.
<P>
<DT><B>Parameters:</B><DD><CODE>directory</CODE> - the index directory<DD><CODE>analyzer</CODE> - the analyzer to use for adding new documents<DD><CODE>create</CODE> - <code>true</code> to create the index or overwrite the existing one; 	<code>false</code> to append to the existing index</DL>
<HR>

<A NAME="IndexModifier(java.lang.String, org.apache.lucene.analysis.Analyzer, boolean)"><!-- --></A><H3>
IndexModifier</H3>
<PRE>
public <B>IndexModifier</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;dirName,                     <A HREF="../../../../org/apache/lucene/analysis/Analyzer.html" title="class in org.apache.lucene.analysis">Analyzer</A>&nbsp;analyzer,                     boolean&nbsp;create)              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>Open an index with write access.
<P>
<DT><B>Parameters:</B><DD><CODE>dirName</CODE> - the index directory<DD><CODE>analyzer</CODE> - the analyzer to use for adding new documents<DD><CODE>create</CODE> - <code>true</code> to create the index or overwrite the existing one; 	<code>false</code> to append to the existing index</DL>
<HR>

<A NAME="IndexModifier(java.io.File, org.apache.lucene.analysis.Analyzer, boolean)"><!-- --></A><H3>
IndexModifier</H3>
<PRE>
public <B>IndexModifier</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>&nbsp;file,                     <A HREF="../../../../org/apache/lucene/analysis/Analyzer.html" title="class in org.apache.lucene.analysis">Analyzer</A>&nbsp;analyzer,                     boolean&nbsp;create)              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>Open an index with write access.
<P>
<DT><B>Parameters:</B><DD><CODE>file</CODE> - the index directory<DD><CODE>analyzer</CODE> - the analyzer to use for adding new documents<DD><CODE>create</CODE> - <code>true</code> to create the index or overwrite the existing one; 	<code>false</code> to append to the existing index</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="init(org.apache.lucene.store.Directory, org.apache.lucene.analysis.Analyzer, boolean)"><!-- --></A><H3>
init</H3>
<PRE>
protected void <B>init</B>(<A HREF="../../../../org/apache/lucene/store/Directory.html" title="class in org.apache.lucene.store">Directory</A>&nbsp;directory,                    <A HREF="../../../../org/apache/lucene/analysis/Analyzer.html" title="class in org.apache.lucene.analysis">Analyzer</A>&nbsp;analyzer,                    boolean&nbsp;create)             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>Initialize an IndexWriter.
<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="assureOpen()"><!-- --></A><H3>
assureOpen</H3>
<PRE>
protected void <B>assureOpen</B>()</PRE>
<DL>
<DD>Throw an IllegalStateException if the index is closed.
<P>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="createIndexWriter()"><!-- --></A><H3>
createIndexWriter</H3>
<PRE>
protected void <B>createIndexWriter</B>()                          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>Close the IndexReader and open an IndexWriter.
<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="createIndexReader()"><!-- --></A><H3>
createIndexReader</H3>
<PRE>
protected void <B>createIndexReader</B>()                          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>Close the IndexWriter and open an IndexReader.
<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="flush()"><!-- --></A><H3>
flush</H3>
<PRE>
public void <B>flush</B>()           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>Make sure all changes are written to disk.
<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="addDocument(org.apache.lucene.document.Document, org.apache.lucene.analysis.Analyzer)"><!-- --></A><H3>
addDocument</H3>
<PRE>
public void <B>addDocument</B>(<A HREF="../../../../org/apache/lucene/document/Document.html" title="class in org.apache.lucene.document">Document</A>&nbsp;doc,                        <A HREF="../../../../org/apache/lucene/analysis/Analyzer.html" title="class in org.apache.lucene.analysis">Analyzer</A>&nbsp;docAnalyzer)                 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>Adds a document to this index, using the provided analyzer instead of the one specific in the constructor.  If the document contains more than <A HREF="../../../../org/apache/lucene/index/IndexModifier.html#setMaxFieldLength(int)"><CODE>setMaxFieldLength(int)</CODE></A> terms for a given field, the remainder are discarded.
<P>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the index is closed<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/IndexWriter.html#addDocument(org.apache.lucene.document.Document, org.apache.lucene.analysis.Analyzer)"><CODE>IndexWriter.addDocument(Document, Analyzer)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="addDocument(org.apache.lucene.document.Document)"><!-- --></A><H3>
addDocument</H3>
<PRE>
public void <B>addDocument</B>(<A HREF="../../../../org/apache/lucene/document/Document.html" title="class in org.apache.lucene.document">Document</A>&nbsp;doc)                 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>Adds a document to this index.  If the document contains more than <A HREF="../../../../org/apache/lucene/index/IndexModifier.html#setMaxFieldLength(int)"><CODE>setMaxFieldLength(int)</CODE></A> terms for a given field, the remainder are discarded.
<P>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the index is closed<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/IndexWriter.html#addDocument(org.apache.lucene.document.Document)"><CODE>IndexWriter.addDocument(Document)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="deleteDocuments(org.apache.lucene.index.Term)"><!-- --></A><H3>
deleteDocuments</H3>
<PRE>
public int <B>deleteDocuments</B>(<A HREF="../../../../org/apache/lucene/index/Term.html" title="class in org.apache.lucene.index">Term</A>&nbsp;term)                    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>Deletes all documents containing <code>term</code>. This is useful if one uses a document field to hold a unique ID string for the document.  Then to delete such a document, one merely constructs a term with the appropriate field and the unique ID string as its text and passes it to this method.  Returns the number of documents deleted.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the number of documents deleted<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the index is closed<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#deleteDocuments(org.apache.lucene.index.Term)"><CODE>IndexReader.deleteDocuments(Term)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="deleteDocument(int)"><!-- --></A><H3>
deleteDocument</H3>
<PRE>
public void <B>deleteDocument</B>(int&nbsp;docNum)                    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>Deletes the document numbered <code>docNum</code>.
<P>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the index is closed<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#deleteDocument(int)"><CODE>IndexReader.deleteDocument(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="docCount()"><!-- --></A><H3>
docCount</H3>
<PRE>
public int <B>docCount</B>()</PRE>
<DL>
<DD>Returns the number of documents currently in this index.
<P>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the index is closed<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/index/IndexWriter.html#docCount()"><CODE>IndexWriter.docCount()</CODE></A>, <A HREF="../../../../org/apache/lucene/index/IndexReader.html#numDocs()"><CODE>IndexReader.numDocs()</CODE></A></DL>
</DD>
</DL>
<HR>

⌨️ 快捷键说明

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