mirror of https://github.com/apache/lucene.git
- Enhanced Javadocs: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18833
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@149971 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
33bd900902
commit
0f61096562
|
@ -192,15 +192,25 @@ public class IndexWriter {
|
|||
return count;
|
||||
}
|
||||
|
||||
/** 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>By default, no more than 10,000 terms will be indexed for a field. */
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public int maxFieldLength = 10000;
|
||||
|
||||
/** Adds a document to this index.*/
|
||||
/**
|
||||
* Adds a document to this index. If the document contains more than
|
||||
* {@link #maxFieldLength} terms for a given field, the remainder are
|
||||
* discarded.
|
||||
*/
|
||||
public void addDocument(Document doc) throws IOException {
|
||||
DocumentWriter dw =
|
||||
new DocumentWriter(ramDirectory, analyzer, similarity, maxFieldLength);
|
||||
|
|
Loading…
Reference in New Issue