Index: contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java
===================================================================
--- contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java	(revision 886213)
+++ contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java	(working copy)
@@ -32,6 +32,7 @@
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.store.AlreadyClosedException;
 import org.apache.lucene.store.Directory;
 
 /**
@@ -73,6 +74,7 @@
   private float bEnd = 1.0f;
 
   private IndexSearcher searcher;
+  private boolean closed = false;
 
   // minimum score for hits generated by the spell checker query
   private float minScore = 0.5f;
@@ -99,11 +101,12 @@
    * Use a different index as the spell checker index or re-open
    * the existing index if <code>spellIndex</code> is the same value
    * as given in the constructor.
-   * 
+   * @throws AlreadyClosedException if the Spellchecker is already closed
    * @param spellIndex
    * @throws IOException
    */
   public void setSpellIndex(Directory spellIndex) throws IOException {
+    ensureOpen();
     this.spellIndex = spellIndex;
     if (!IndexReader.indexExists(spellIndex)) {
         IndexWriter writer = new IndexWriter(spellIndex, null, true, IndexWriter.MaxFieldLength.UNLIMITED);
@@ -145,6 +148,7 @@
    * @param word the word you want a spell check done on
    * @param numSug the number of suggested words
    * @throws IOException
+   * @throws AlreadyClosedException if the Spellchecker is already closed
    * @return String[]
    */
   public String[] suggestSimilar(String word, int numSug) throws IOException {
@@ -169,14 +173,15 @@
    * words are restricted to the words present in this field.
    * @param morePopular return only the suggest words that are as frequent or more frequent than the searched word
    * (only if restricted mode = (indexReader!=null and field!=null)
-   * @throws IOException
+   * @throws IOException if the underlying index throws an {@link IOException}
+   * @throws AlreadyClosedException if the Spellchecker is already closed
    * @return String[] the sorted list of the suggest words with these 2 criteria:
    * first criteria: the edit distance, second criteria (only if restricted mode): the popularity
    * of the suggest words in the field of the user index
    */
   public String[] suggestSimilar(String word, int numSug, IndexReader ir,
       String field, boolean morePopular) throws IOException {
-
+    ensureOpen();
     float min = this.minScore;
     final int lengthWord = word.length();
 
@@ -297,8 +302,10 @@
   /**
    * Removes all terms from the spell check index.
    * @throws IOException
+   * @throws AlreadyClosedException if the Spellchecker is already closed
    */
   public void clearIndex() throws IOException {
+    ensureOpen();
     IndexWriter writer = new IndexWriter(spellIndex, null, true, IndexWriter.MaxFieldLength.UNLIMITED);
     writer.close();
     
@@ -311,9 +318,11 @@
    * Check whether the word exists in the index.
    * @param word
    * @throws IOException
+   * @throws AlreadyClosedException if the Spellchecker is already closed
    * @return true iff the word exists in the index
    */
   public boolean exist(String word) throws IOException {
+    ensureOpen();
     return searcher.docFreq(new Term(F_WORD, word)) > 0;
   }
 
@@ -322,9 +331,11 @@
    * @param dict Dictionary to index
    * @param mergeFactor mergeFactor to use when indexing
    * @param ramMB the max amount or memory in MB to use
+   * @throws AlreadyClosedException if the Spellchecker is already closed
    * @throws IOException
    */
   public void indexDictionary(Dictionary dict, int mergeFactor, int ramMB) throws IOException {
+    ensureOpen();
     IndexWriter writer = new IndexWriter(spellIndex, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED);
     writer.setMergeFactor(mergeFactor);
     writer.setRAMBufferSizeMB(ramMB);
@@ -409,4 +420,19 @@
       }
     }
   }
+  
+  private void ensureOpen(){
+    if(closed){
+      throw new AlreadyClosedException("Spellchecker has been closed");
+    }
+  }
+
+  /**
+   * Close the IndexSearcher used by this SpellChecker
+   */
+  public void close() throws IOException {
+    searcher.close();
+    closed = true;
+    searcher = null;
+  }
 }
