indexmodifier.html

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

HTML
1,130
字号

<A NAME="optimize()"><!-- --></A><H3>
optimize</H3>
<PRE>
public void <B>optimize</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>Merges all segments together into a single segment, optimizing an index for search.
<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#optimize()"><CODE>IndexWriter.optimize()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setInfoStream(java.io.PrintStream)"><!-- --></A><H3>
setInfoStream</H3>
<PRE>
public void <B>setInfoStream</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/PrintStream.html" title="class or interface in java.io">PrintStream</A>&nbsp;infoStream)</PRE>
<DL>
<DD>If non-null, information about merges and a message when <A HREF="../../../../org/apache/lucene/index/IndexModifier.html#getMaxFieldLength()"><CODE>getMaxFieldLength()</CODE></A> is reached will be printed to this. <p>Example: <tt>index.setInfoStream(System.err);</tt>
<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#setInfoStream(java.io.PrintStream)"><CODE>IndexWriter.setInfoStream(PrintStream)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getInfoStream()"><!-- --></A><H3>
getInfoStream</H3>
<PRE>
public <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>getInfoStream</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><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/IndexModifier.html#setInfoStream(java.io.PrintStream)"><CODE>setInfoStream(PrintStream)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setUseCompoundFile(boolean)"><!-- --></A><H3>
setUseCompoundFile</H3>
<PRE>
public void <B>setUseCompoundFile</B>(boolean&nbsp;useCompoundFile)</PRE>
<DL>
<DD>Setting to turn on usage of a compound file. When on, multiple files for each segment are merged into a single file once the segment creation is finished. This is done regardless of what directory is in use.
<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#setUseCompoundFile(boolean)"><CODE>IndexWriter.setUseCompoundFile(boolean)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getUseCompoundFile()"><!-- --></A><H3>
getUseCompoundFile</H3>
<PRE>
public boolean <B>getUseCompoundFile</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><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/IndexModifier.html#setUseCompoundFile(boolean)"><CODE>setUseCompoundFile(boolean)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setMaxFieldLength(int)"><!-- --></A><H3>
setMaxFieldLength</H3>
<PRE>
public void <B>setMaxFieldLength</B>(int&nbsp;maxFieldLength)</PRE>
<DL>
<DD>The maximum number of terms that will be indexed for a single field in a document.  This limits the amount of memory required for indexing, so that collections with very large files will not crash the indexing process by running out of memory.<p/> Note that this effectively truncates large documents, excluding from the index terms that occur further in the document.  If you know your source documents are large, be sure to set this value high enough to accomodate the expected size.  If you set it to Integer.MAX_VALUE, then the only limit is your memory, but you should anticipate an OutOfMemoryError.<p/> By default, no more than 10,000 terms will be indexed for a field.
<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#setMaxFieldLength(int)"><CODE>IndexWriter.setMaxFieldLength(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getMaxFieldLength()"><!-- --></A><H3>
getMaxFieldLength</H3>
<PRE>
public int <B>getMaxFieldLength</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><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/IndexModifier.html#setMaxFieldLength(int)"><CODE>setMaxFieldLength(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setMaxBufferedDocs(int)"><!-- --></A><H3>
setMaxBufferedDocs</H3>
<PRE>
public void <B>setMaxBufferedDocs</B>(int&nbsp;maxBufferedDocs)</PRE>
<DL>
<DD>Determines the minimal number of documents required before the buffered in-memory documents are merging and a new Segment is created. Since Documents are merged in a <A HREF="../../../../org/apache/lucene/store/RAMDirectory.html" title="class in org.apache.lucene.store"><CODE>RAMDirectory</CODE></A>, large value gives faster indexing.  At the same time, mergeFactor limits the number of files open in a FSDirectory. <p>The default value is 10.
<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/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if maxBufferedDocs is smaller than 2<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/index/IndexWriter.html#setMaxBufferedDocs(int)"><CODE>IndexWriter.setMaxBufferedDocs(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getMaxBufferedDocs()"><!-- --></A><H3>
getMaxBufferedDocs</H3>
<PRE>
public int <B>getMaxBufferedDocs</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><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/IndexModifier.html#setMaxBufferedDocs(int)"><CODE>setMaxBufferedDocs(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setMergeFactor(int)"><!-- --></A><H3>
setMergeFactor</H3>
<PRE>
public void <B>setMergeFactor</B>(int&nbsp;mergeFactor)</PRE>
<DL>
<DD>Determines how often segment indices are merged by addDocument().  With smaller values, less RAM is used while indexing, and searches on unoptimized indices are faster, but indexing speed is slower.  With larger values, more RAM is used during indexing, and while searches on unoptimized indices are slower, indexing is faster.  Thus larger values (&gt; 10) are best for batch index creation, and smaller values (&lt; 10) for indices that are interactively maintained. <p>This must never be less than 2.  The default value is 10.
<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#setMergeFactor(int)"><CODE>IndexWriter.setMergeFactor(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getMergeFactor()"><!-- --></A><H3>
getMergeFactor</H3>
<PRE>
public int <B>getMergeFactor</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><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/IndexModifier.html#setMergeFactor(int)"><CODE>setMergeFactor(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
public void <B>close</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 this index, writing all pending changes to disk.
<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 has been closed before already<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="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public <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>toString</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>

<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/IndexModifier.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/lucene/index/IndexFileNameFilter.html" title="class in org.apache.lucene.index"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/lucene/index/IndexReader.html" title="class in org.apache.lucene.index"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="IndexModifier.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &copy; 2000-2007 Apache Software Foundation.  All Rights Reserved.
</BODY>
</HTML>

⌨️ 快捷键说明

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