Index: contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java
===================================================================
--- contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java	(revision 659019)
+++ contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java	(working copy)
@@ -303,14 +303,16 @@
   }
 
   /**
-   * Index a Dictionary
-   * @param dict the dictionary to index
+   * Indexes the data from the given {@link Dictionary}.
+   * @param dict Dictionary to index
+   * @param mergeFactor mergeFactor to use when indexing
+   * @param ramMB the max amount or memory in MB to use
    * @throws IOException
    */
-  public void indexDictionary(Dictionary dict) throws IOException {
+  public void indexDictionary(Dictionary dict, int mergeFactor, int ramMB) throws IOException {
     IndexWriter writer = new IndexWriter(spellIndex, true, new WhitespaceAnalyzer());
-    writer.setMergeFactor(300);
-    writer.setMaxBufferedDocs(150);
+    writer.setMergeFactor(mergeFactor);
+    writer.setRAMBufferSizeMB(ramMB);
 
     Iterator iter = dict.getWordsIterator();
     while (iter.hasNext()) {
@@ -338,6 +340,15 @@
     searcher = new IndexSearcher(this.spellIndex);
   }
 
+  /**
+   * Indexes the data from the given {@link Dictionary}.
+   * @param dict the dictionary to index
+   * @throws IOException
+   */
+  public void indexDictionary(Dictionary dict) throws IOException {
+    indexDictionary(dict, 300, 10);
+  }
+
   private int getMin(int l) {
     if (l > 5) {
       return 3;
