indexwriter.html
来自「 Lucene是apache软件基金会[4] jakarta项目组的一个子项目」· HTML 代码 · 共 1,329 行 · 第 1/5 页
HTML
1,329 行
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setMaxBufferedDeleteTerms(int)">setMaxBufferedDeleteTerms</A></B>(int maxBufferedDeleteTerms)</CODE>
<BR>
Determines the minimal number of delete terms required before the buffered in-memory delete terms are applied and flushed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setMaxBufferedDocs(int)">setMaxBufferedDocs</A></B>(int maxBufferedDocs)</CODE>
<BR>
Determines the minimal number of documents required before the buffered in-memory documents are merged and a new Segment is created.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setMaxFieldLength(int)">setMaxFieldLength</A></B>(int maxFieldLength)</CODE>
<BR>
The maximum number of terms that will be indexed for a single field in a document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setMaxMergeDocs(int)">setMaxMergeDocs</A></B>(int maxMergeDocs)</CODE>
<BR>
Determines the largest number of documents ever merged by addDocument().</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setMergeFactor(int)">setMergeFactor</A></B>(int mergeFactor)</CODE>
<BR>
Determines how often segment indices are merged by addDocument().</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setSimilarity(org.apache.lucene.search.Similarity)">setSimilarity</A></B>(<A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A> similarity)</CODE>
<BR>
Expert: Set the Similarity implementation used by this IndexWriter.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setTermIndexInterval(int)">setTermIndexInterval</A></B>(int interval)</CODE>
<BR>
Expert: Set the interval between indexed terms.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setUseCompoundFile(boolean)">setUseCompoundFile</A></B>(boolean value)</CODE>
<BR>
Setting to turn on usage of a compound file.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setWriteLockTimeout(long)">setWriteLockTimeout</A></B>(long writeLockTimeout)</CODE>
<BR>
Sets the maximum time to wait for a write lock (in milliseconds) for this instance of IndexWriter.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/index/IndexWriter.html#updateDocument(org.apache.lucene.index.Term, org.apache.lucene.document.Document)">updateDocument</A></B>(<A HREF="../../../../org/apache/lucene/index/Term.html" title="class in org.apache.lucene.index">Term</A> term, <A HREF="../../../../org/apache/lucene/document/Document.html" title="class in org.apache.lucene.document">Document</A> doc)</CODE>
<BR>
Updates a document by first deleting the document(s) containing <code>term</code> and then adding the new document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/lucene/index/IndexWriter.html#updateDocument(org.apache.lucene.index.Term, org.apache.lucene.document.Document, org.apache.lucene.analysis.Analyzer)">updateDocument</A></B>(<A HREF="../../../../org/apache/lucene/index/Term.html" title="class in org.apache.lucene.index">Term</A> term, <A HREF="../../../../org/apache/lucene/document/Document.html" title="class in org.apache.lucene.document">Document</A> doc, <A HREF="../../../../org/apache/lucene/analysis/Analyzer.html" title="class in org.apache.lucene.analysis">Analyzer</A> analyzer)</CODE>
<BR>
Updates a document by first deleting the document(s) containing <code>term</code> and then adding the new document.</TD>
</TR>
</TABLE>
<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#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#toString()" title="class or interface in java.lang">toString</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>
<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="WRITE_LOCK_TIMEOUT"><!-- --></A><H3>
WRITE_LOCK_TIMEOUT</H3>
<PRE>
public static long <B>WRITE_LOCK_TIMEOUT</B></PRE>
<DL>
<DD>Default value for the write lock timeout (1,000).
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setDefaultWriteLockTimeout(long)"><CODE>setDefaultWriteLockTimeout(long)</CODE></A></DL>
</DL>
<HR>
<A NAME="WRITE_LOCK_NAME"><!-- --></A><H3>
WRITE_LOCK_NAME</H3>
<PRE>
public static final <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>WRITE_LOCK_NAME</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.lucene.index.IndexWriter.WRITE_LOCK_NAME">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="DEFAULT_MERGE_FACTOR"><!-- --></A><H3>
DEFAULT_MERGE_FACTOR</H3>
<PRE>
public static final int <B>DEFAULT_MERGE_FACTOR</B></PRE>
<DL>
<DD>Default value is 10. Change using <A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setMergeFactor(int)"><CODE>setMergeFactor(int)</CODE></A>.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.lucene.index.IndexWriter.DEFAULT_MERGE_FACTOR">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="DEFAULT_MAX_BUFFERED_DOCS"><!-- --></A><H3>
DEFAULT_MAX_BUFFERED_DOCS</H3>
<PRE>
public static final int <B>DEFAULT_MAX_BUFFERED_DOCS</B></PRE>
<DL>
<DD>Default value is 10. Change using <A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setMaxBufferedDocs(int)"><CODE>setMaxBufferedDocs(int)</CODE></A>.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.lucene.index.IndexWriter.DEFAULT_MAX_BUFFERED_DOCS">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="DEFAULT_MAX_BUFFERED_DELETE_TERMS"><!-- --></A><H3>
DEFAULT_MAX_BUFFERED_DELETE_TERMS</H3>
<PRE>
public static final int <B>DEFAULT_MAX_BUFFERED_DELETE_TERMS</B></PRE>
<DL>
<DD>Default value is 1000. Change using <A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setMaxBufferedDeleteTerms(int)"><CODE>setMaxBufferedDeleteTerms(int)</CODE></A>.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.lucene.index.IndexWriter.DEFAULT_MAX_BUFFERED_DELETE_TERMS">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="DEFAULT_MAX_MERGE_DOCS"><!-- --></A><H3>
DEFAULT_MAX_MERGE_DOCS</H3>
<PRE>
public static final int <B>DEFAULT_MAX_MERGE_DOCS</B></PRE>
<DL>
<DD>Default value is <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Integer.html#MAX_VALUE" title="class or interface in java.lang"><CODE>Integer.MAX_VALUE</CODE></A>. Change using <A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setMaxMergeDocs(int)"><CODE>setMaxMergeDocs(int)</CODE></A>.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.lucene.index.IndexWriter.DEFAULT_MAX_MERGE_DOCS">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="DEFAULT_MAX_FIELD_LENGTH"><!-- --></A><H3>
DEFAULT_MAX_FIELD_LENGTH</H3>
<PRE>
public static final int <B>DEFAULT_MAX_FIELD_LENGTH</B></PRE>
<DL>
<DD>Default value is 10,000. Change using <A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setMaxFieldLength(int)"><CODE>setMaxFieldLength(int)</CODE></A>.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.lucene.index.IndexWriter.DEFAULT_MAX_FIELD_LENGTH">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="DEFAULT_TERM_INDEX_INTERVAL"><!-- --></A><H3>
DEFAULT_TERM_INDEX_INTERVAL</H3>
<PRE>
public static final int <B>DEFAULT_TERM_INDEX_INTERVAL</B></PRE>
<DL>
<DD>Default value is 128. Change using <A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setTermIndexInterval(int)"><CODE>setTermIndexInterval(int)</CODE></A>.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.lucene.index.IndexWriter.DEFAULT_TERM_INDEX_INTERVAL">Constant Field Values</A></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="IndexWriter(java.lang.String, org.apache.lucene.analysis.Analyzer, boolean)"><!-- --></A><H3>
IndexWriter</H3>
<PRE>
public <B>IndexWriter</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> path, <A HREF="../../../../org/apache/lucene/analysis/Analyzer.html" title="class in org.apache.lucene.analysis">Analyzer</A> a, boolean 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>Constructs an IndexWriter for the index in <code>path</code>. Text will be analyzed with <code>a</code>. If <code>create</code> is true, then a new, empty index will be created in <code>path</code>, replacing the index already there, if any.
<P>
<DT><B>Parameters:</B><DD><CODE>path</CODE> - the path to the index directory<DD><CODE>a</CODE> - the analyzer to use<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<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 the directory cannot be read/written to, or if it does not exist, and <code>create</code> is <code>false</code></DL>
<HR>
<A NAME="IndexWriter(java.io.File, org.apache.lucene.analysis.Analyzer, boolean)"><!-- --></A><H3>
IndexWriter</H3>
<PRE>
public <B>IndexWriter</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> path, <A HREF="../../../../org/apache/lucene/analysis/Analyzer.html" title="class in org.apache.lucene.analysis">Analyzer</A> a, boolean 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>Constructs an IndexWriter for the index in <code>path</code>. Text will be analyzed with <code>a</code>. If <code>create</code> is true, then a new, empty index will be created in <code>path</code>, replacing the index already there, if any.
<P>
<DT><B>Parameters:</B><DD><CODE>path</CODE> - the path to the index directory<DD><CODE>a</CODE> - the analyzer to use<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<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 the directory cannot be read/written to, or if it does not exist, and <code>create</code> is <code>false</code></DL>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?