Index: contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java
===================================================================
--- contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java	(revision 656098)
+++ contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java	(working copy)
@@ -305,19 +305,21 @@
   }
 
   /**
-   * 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 {
     if (IndexReader.isLocked(spellIndex)){
       IndexReader.unlock(spellIndex);
     }
     IndexWriter writer = new IndexWriter(spellIndex, new WhitespaceAnalyzer(),
         !IndexReader.indexExists(spellIndex));
-    writer.setMergeFactor(300);
-    writer.setMaxBufferedDocs(150);
-
+    writer.setMergeFactor(mergeFactor);
+    writer.setRAMBufferSizeMB(ramMB);
+    
     Iterator iter = dict.getWordsIterator();
     while (iter.hasNext()) {
       String word = (String) iter.next();
@@ -349,6 +351,15 @@
     searcher.close();
     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) {
