You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by ka...@yahoo.es on 2007/03/27 11:38:28 UTC

spellcheck - additional setter methods

Hi spellcheck developers,

as users might not always have the administrative power to change
their ulimit settings (on *nix systems), it might be useful to include 
two new parameters 
indexMergeFactor and indexMaxBufferedDocs
  and their respective setter methods in 


org.apache.lucene.search.spell.SpellChecker

 

Especially, as the spellcheck just finishes with an invalid index without
any further message or warning if the ulimit settings don't suffice. 
Below is the code i would suggest.

Thanks,
karin



Code changes:
first the additional attributes and setter methods:
    private int indexMergeFactor = 300;
    private int indexMaxBufferedDocs = 150;


    /**
     *  Set the merge factor for indexing; default 300
     */
    public void setIndexMergeFactor(int mf) {
        indexMergeFactor = mf;
    }

    /**
     *  Set max no. of docs buffered for indexing; default 150
     */
    public void setIndexMaxBufferedDocs(int mbd) {
        indexMaxBufferedDocs = mbd;
    }

here the changes to  public void indexDictionary (Dictionary dict) throws IOException :
replace the hard coded values
        writer.setMergeFactor(300);
        writer.setMaxBufferedDocs(150);
with:
        writer.setMergeFactor(indexMergeFactor);
        writer.setMaxBufferedDocs(indexMaxBufferedDocs);




 





 		
---------------------------------

LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com