You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by si...@apache.org on 2012/03/07 21:39:48 UTC

svn commit: r1298098 - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/contrib/spellchecker/ lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/ lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/ lucene/c...

Author: simonw
Date: Wed Mar  7 20:39:47 2012
New Revision: 1298098

URL: http://svn.apache.org/viewvc?rev=1298098&view=rev
Log:
LUCENE-3807: remove file based store/load from Lookup

Modified:
    lucene/dev/branches/branch_3x/   (props changed)
    lucene/dev/branches/branch_3x/lucene/   (props changed)
    lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/   (props changed)
    lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/Lookup.java
    lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
    lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/FSTLookup.java
    lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/WFSTCompletionLookup.java
    lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.java
    lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/tst/TSTLookup.java
    lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/suggest/PersistenceTest.java
    lucene/dev/branches/branch_3x/solr/   (props changed)
    lucene/dev/branches/branch_3x/solr/core/   (props changed)
    lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/LookupFactory.java
    lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/Suggester.java
    lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/fst/FSTLookupFactory.java
    lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/fst/WFSTLookupFactory.java
    lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/jaspell/JaspellLookupFactory.java
    lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/tst/TSTLookupFactory.java

Modified: lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/Lookup.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/Lookup.java?rev=1298098&r1=1298097&r2=1298098&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/Lookup.java (original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/Lookup.java Wed Mar  7 20:39:47 2012
@@ -150,21 +150,4 @@ public abstract class Lookup {
    */
   public abstract boolean load(InputStream input) throws IOException;
   
-  /**
-   * Persist the constructed lookup data to a directory. Optional operation.
-   * @param storeDir directory where data can be stored.
-   * @return true if successful, false if unsuccessful or not supported.
-   * @throws IOException when fatal IO error occurs.
-   */
-  public abstract boolean store(File storeDir) throws IOException;
-
-  /**
-   * Discard current lookup data and load it from a previously saved copy.
-   * Optional operation.
-   * @param storeDir directory where lookup data was stored.
-   * @return true if completed successfully, false if unsuccessful or not supported.
-   * @throws IOException when fatal IO error occurs.
-   */
-  public abstract boolean load(File storeDir) throws IOException;
-  
 }

Modified: lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java?rev=1298098&r1=1298097&r2=1298098&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java (original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java Wed Mar  7 20:39:47 2012
@@ -18,8 +18,6 @@ package org.apache.lucene.search.suggest
  */
 
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -81,14 +79,6 @@ public class FSTCompletionLookup extends
    */
   private final static int sharedTailLength = 5;
 
-  /**
-   * File name for the automaton.
-   * 
-   * @see #store(File)
-   * @see #load(File)
-   */
-  private static final String FILENAME = "fst.bin";
-
   private int buckets;
   private boolean exactMatchFirst;
 
@@ -266,36 +256,14 @@ public class FSTCompletionLookup extends
     return bucket == -1 ? null : Long.valueOf(bucket);
   }
 
-  /**
-   * Deserialization from disk.
-   */
-  @Override
-  public synchronized boolean load(File storeDir) throws IOException {
-    File data = new File(storeDir, FILENAME);
-    if (!data.exists() || !data.canRead()) {
-      return false;
-    }
-    return load(new FileInputStream(data));
-  }
-
-  /**
-   * Serialization to disk.
-   */
-  @Override
-  public synchronized boolean store(File storeDir) throws IOException {
-    if (!storeDir.exists() || !storeDir.isDirectory() || !storeDir.canWrite()) {
-      return false;
-    }
-    return store(new FileOutputStream(new File(storeDir, FILENAME)));
-  }
 
   @Override
   public synchronized boolean store(OutputStream output) throws IOException {
+
     try {
-      FST<Object> fst;
-      if (this.normalCompletion == null || (fst = normalCompletion.getFST()) == null) 
+      if (this.normalCompletion == null || normalCompletion.getFST() == null) 
         return false;
-      fst.save(new OutputStreamDataOutput(output));
+      normalCompletion.getFST().save(new OutputStreamDataOutput(output));
     } finally {
       IOUtils.close(output);
     }

Modified: lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/FSTLookup.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/FSTLookup.java?rev=1298098&r1=1298097&r2=1298098&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/FSTLookup.java (original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/FSTLookup.java Wed Mar  7 20:39:47 2012
@@ -517,35 +517,6 @@ public class FSTLookup extends Lookup {
     }
   }
 
-  /**
-   * Deserialization from disk.
-   */
-  @Override
-  public synchronized boolean load(File storeDir) throws IOException {
-    File data = new File(storeDir, FILENAME);
-    if (!data.exists() || !data.canRead()) {
-      return false;
-    }
-
-    return load(new FileInputStream(data));
-  }
-
-  /**
-   * Serialization to disk.
-   */
-  @Override
-  public synchronized boolean store(File storeDir) throws IOException {
-    if (!storeDir.exists() || !storeDir.isDirectory() || !storeDir.canWrite()) {
-      return false;
-    }
-
-    if (this.automaton == null)
-      return false;
-
-    File data = new File(storeDir, FILENAME);
-    return store(new FileOutputStream(data));
-  }
-
   @Override
   public boolean store(OutputStream output) throws IOException {
     OutputStream os = new BufferedOutputStream(output);

Modified: lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/WFSTCompletionLookup.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/WFSTCompletionLookup.java?rev=1298098&r1=1298097&r2=1298098&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/WFSTCompletionLookup.java (original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/fst/WFSTCompletionLookup.java Wed Mar  7 20:39:47 2012
@@ -17,9 +17,6 @@ package org.apache.lucene.search.suggest
  * limitations under the License.
  */
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -66,14 +63,6 @@ import org.apache.lucene.util.fst.Util.M
 public class WFSTCompletionLookup extends Lookup {
   
   /**
-   * File name for the automaton.
-   * 
-   * @see #store(File)
-   * @see #load(File)
-   */
-  private static final String FILENAME = "wfst.bin";
-  
-  /**
    * FST<Long>, weights are encoded as costs: (Integer.MAX_VALUE-weight)
    */
   // NOTE: like FSTSuggester, this is really a WFSA, if you want to
@@ -129,35 +118,18 @@ public class WFSTCompletionLookup extend
     fst = builder.finish();
   }
 
-  @Override
-  public boolean store(File storeDir) throws IOException {
-    if (!storeDir.exists() || !storeDir.isDirectory() || !storeDir.canWrite()) {
-      return false;
-    }
-    return store(new FileOutputStream(new File(storeDir, FILENAME)));
-  }
-
-  @Override
-  public boolean load(File storeDir) throws IOException {
-    File data = new File(storeDir, FILENAME);
-    if (!data.exists() || !data.canRead()) {
-      return false;
-    }
-    return load(new FileInputStream(data));
-  }
   
   @Override
   public boolean store(OutputStream output) throws IOException {
     try {
-      if (fst != null) {
-        fst.save(new OutputStreamDataOutput(output));
-        return true;
+      if (fst == null) {
+        return false;
       }
+      fst.save(new OutputStreamDataOutput(output));
     } finally {
       IOUtils.close(output);
     }
-    return false;
-    
+    return true;
   }
 
   @Override

Modified: lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.java?rev=1298098&r1=1298097&r2=1298098&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.java (original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.java Wed Mar  7 20:39:47 2012
@@ -19,9 +19,6 @@ package org.apache.lucene.search.suggest
 
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -109,22 +106,11 @@ public class JaspellLookup extends Looku
     return res;
   }
 
-  public static final String FILENAME = "jaspell.dat";
   private static final byte LO_KID = 0x01;
   private static final byte EQ_KID = 0x02;
   private static final byte HI_KID = 0x04;
   private static final byte HAS_VALUE = 0x08;
  
-  
-  @Override
-  public boolean load(File storeDir) throws IOException {
-    File data = new File(storeDir, FILENAME);
-    if (!data.exists() || !data.canRead()) {
-      return false;
-    }
-    return load(new FileInputStream(data));
-  }
-  
   private void readRecursively(DataInputStream in, TSTNode node) throws IOException {
     node.splitchar = in.readChar();
     byte mask = in.readByte();
@@ -148,15 +134,6 @@ public class JaspellLookup extends Looku
     }
   }
 
-  @Override
-  public boolean store(File storeDir) throws IOException {
-    if (!storeDir.exists() || !storeDir.isDirectory() || !storeDir.canWrite()) {
-      return false;
-    }
-    File data = new File(storeDir, FILENAME);
-    return store(new FileOutputStream(data));
-  }
-  
   private void writeRecursively(DataOutputStream out, TSTNode node) throws IOException {
     if (node == null) {
       return;

Modified: lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/tst/TSTLookup.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/tst/TSTLookup.java?rev=1298098&r1=1298097&r2=1298098&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/tst/TSTLookup.java (original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/java/org/apache/lucene/search/suggest/tst/TSTLookup.java Wed Mar  7 20:39:47 2012
@@ -119,23 +119,12 @@ public class TSTLookup extends Lookup {
     return res;
   }
   
-  public static final String FILENAME = "tst.dat";
-  
   private static final byte LO_KID = 0x01;
   private static final byte EQ_KID = 0x02;
   private static final byte HI_KID = 0x04;
   private static final byte HAS_TOKEN = 0x08;
   private static final byte HAS_VALUE = 0x10;
 
-  @Override
-  public synchronized boolean load(File storeDir) throws IOException {
-    File data = new File(storeDir, FILENAME);
-    if (!data.exists() || !data.canRead()) {
-      return false;
-    }
-    return load(new FileInputStream(data));
-  }
-  
   // pre-order traversal
   private void readRecursively(DataInputStream in, TernaryTreeNode node) throws IOException {
     node.splitchar = in.readChar();
@@ -160,15 +149,6 @@ public class TSTLookup extends Lookup {
     }
   }
 
-  @Override
-  public synchronized boolean store(File storeDir) throws IOException {
-    if (!storeDir.exists() || !storeDir.isDirectory() || !storeDir.canWrite()) {
-      return false;
-    }
-    File data = new File(storeDir, FILENAME);
-    return store(new FileOutputStream(data));
-  }
-  
   // pre-order traversal
   private void writeRecursively(DataOutputStream out, TernaryTreeNode node) throws IOException {
     // write out the current node

Modified: lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/suggest/PersistenceTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/suggest/PersistenceTest.java?rev=1298098&r1=1298097&r2=1298098&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/suggest/PersistenceTest.java (original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/spellchecker/src/test/org/apache/lucene/search/suggest/PersistenceTest.java Wed Mar  7 20:39:47 2012
@@ -17,6 +17,8 @@
 package org.apache.lucene.search.suggest;
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
 import java.util.List;
 
 import org.apache.lucene.search.suggest.Lookup;
@@ -70,11 +72,11 @@ public class PersistenceTest extends Luc
 
     // Store the suggester.
     File storeDir = TEMP_DIR;
-    lookup.store(storeDir);
+    lookup.store(new FileOutputStream(new File(storeDir, "lookup.dat")));
 
     // Re-read it from disk.
     lookup = lookupClass.newInstance();
-    lookup.load(storeDir);
+    lookup.load(new FileInputStream(new File(storeDir, "lookup.dat")));
 
     // Assert validity.
     long previous = Long.MIN_VALUE;

Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/LookupFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/LookupFactory.java?rev=1298098&r1=1298097&r2=1298098&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/LookupFactory.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/LookupFactory.java Wed Mar  7 20:39:47 2012
@@ -26,4 +26,5 @@ import org.apache.solr.core.SolrCore;
  */
 public abstract class LookupFactory {
   public abstract Lookup create(NamedList params, SolrCore core);
+  public abstract String storeFileName();
 }

Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/Suggester.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/Suggester.java?rev=1298098&r1=1298097&r2=1298098&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/Suggester.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/Suggester.java Wed Mar  7 20:39:47 2012
@@ -18,6 +18,8 @@
 package org.apache.solr.spelling.suggest;
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
@@ -74,6 +76,8 @@ public class Suggester extends SolrSpell
   protected Lookup lookup;
   protected String lookupImpl;
   protected SolrCore core;
+
+  private LookupFactory factory;
   
   @Override
   public String init(NamedList config, SolrCore core) {
@@ -93,7 +97,8 @@ public class Suggester extends SolrSpell
       lookupImpl = FSTLookupFactory.class.getName();
     }
 
-    LookupFactory factory = (LookupFactory) core.getResourceLoader().newInstance(lookupImpl);
+    factory = (LookupFactory) core.getResourceLoader().newInstance(lookupImpl);
+    
     lookup = factory.create(config, core);
     String store = (String)config.get(STORE_DIR);
     if (store != null) {
@@ -106,7 +111,7 @@ public class Suggester extends SolrSpell
       } else {
         // attempt reload of the stored lookup
         try {
-          lookup.load(storeDir);
+          lookup.load(new FileInputStream(new File(storeDir, factory.storeFileName())));
         } catch (IOException e) {
           LOG.warn("Loading stored lookup data failed", e);
         }
@@ -133,16 +138,19 @@ public class Suggester extends SolrSpell
     try {
       lookup.build(dictionary);
       if (storeDir != null) {
-        if(!lookup.store(storeDir)) {
+        File target = new File(storeDir, factory.storeFileName());
+        if(!lookup.store(new FileOutputStream(target))) {
           if (sourceLocation == null) {
             assert reader != null && field != null;
             LOG.error("Store Lookup build from index on field: " + field + " failed reader has: " + reader.maxDoc() + " docs");
           } else {
             LOG.error("Store Lookup build from sourceloaction: " + sourceLocation + " failed");
-
           }
+        } else {
+          LOG.info("Stored suggest data to: " + target.getAbsolutePath());
         }
       }
+
     } catch (Exception e) {
       LOG.error("Error while building or storing Suggester data", e);
     }
@@ -153,7 +161,7 @@ public class Suggester extends SolrSpell
     LOG.info("reload()");
     if (dictionary == null && storeDir != null) {
       // this may be a firstSearcher event, try loading it
-      if (lookup.load(storeDir)) {
+      if (lookup.load(new FileInputStream(new File(storeDir, factory.storeFileName())))) {
         return;  // loaded ok
       }
       LOG.debug("load failed, need to build Lookup again");

Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/fst/FSTLookupFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/fst/FSTLookupFactory.java?rev=1298098&r1=1298097&r2=1298098&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/fst/FSTLookupFactory.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/fst/FSTLookupFactory.java Wed Mar  7 20:39:47 2012
@@ -27,7 +27,12 @@ import org.apache.solr.spelling.suggest.
  * Factory for {@link FSTCompletionLookup}
  */
 public class FSTLookupFactory extends LookupFactory {
-
+  
+  /**
+   * File name for the automaton.
+   */
+  private static final String FILENAME = "fst.bin";
+  
   /**
    * The number of separate buckets for weights (discretization). The more buckets,
    * the more fine-grained term weights (priorities) can be assigned. The speed of lookup
@@ -57,4 +62,9 @@ public class FSTLookupFactory extends Lo
 
     return new FSTCompletionLookup(buckets, exactMatchFirst);
   }
+
+  @Override
+  public String storeFileName() {
+    return FILENAME;
+  }
 }

Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/fst/WFSTLookupFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/fst/WFSTLookupFactory.java?rev=1298098&r1=1298097&r2=1298098&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/fst/WFSTLookupFactory.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/fst/WFSTLookupFactory.java Wed Mar  7 20:39:47 2012
@@ -17,6 +17,8 @@ package org.apache.solr.spelling.suggest
  * limitations under the License.
  */
 
+import java.io.File;
+
 import org.apache.lucene.search.suggest.Lookup;
 import org.apache.lucene.search.suggest.fst.*;
 import org.apache.solr.common.util.NamedList;
@@ -33,6 +35,12 @@ public class WFSTLookupFactory extends L
    * of other strings in the automaton (possibly with larger weights). 
    */
   public static final String EXACT_MATCH_FIRST = "exactMatchFirst";
+  
+  /**
+   * File name for the automaton.
+   * 
+   */
+  private static final String FILENAME = "wfst.bin";
 
   @Override
   public Lookup create(NamedList params, SolrCore core) {
@@ -42,4 +50,9 @@ public class WFSTLookupFactory extends L
 
     return new WFSTCompletionLookup(exactMatchFirst);
   }
+
+  @Override
+  public String storeFileName() {
+    return FILENAME;
+  }
 }

Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/jaspell/JaspellLookupFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/jaspell/JaspellLookupFactory.java?rev=1298098&r1=1298097&r2=1298098&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/jaspell/JaspellLookupFactory.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/jaspell/JaspellLookupFactory.java Wed Mar  7 20:39:47 2012
@@ -30,10 +30,16 @@ import org.slf4j.LoggerFactory;
  */
 public class JaspellLookupFactory extends LookupFactory {
   private static final Logger LOG = LoggerFactory.getLogger(JaspellLookup.class);
+  private static final String FILENAME = "jaspell.dat";
 
   @Override
   public Lookup create(NamedList params, SolrCore core) {
     LOG.info("init: " + params);
     return new JaspellLookup();
   }
+
+  @Override
+  public String storeFileName() {
+    return FILENAME;
+  }
 }

Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/tst/TSTLookupFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/tst/TSTLookupFactory.java?rev=1298098&r1=1298097&r2=1298098&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/tst/TSTLookupFactory.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/spelling/suggest/tst/TSTLookupFactory.java Wed Mar  7 20:39:47 2012
@@ -27,9 +27,15 @@ import org.apache.solr.spelling.suggest.
  * Factory for {@link TSTLookup}
  */
 public class TSTLookupFactory extends LookupFactory {
+  private static final String FILENAME = "tst.dat";
 
   @Override
   public Lookup create(NamedList params, SolrCore core) {
     return new TSTLookup();
   }
+
+  @Override
+  public String storeFileName() {
+    return FILENAME;
+  }
 }