lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: spellcheck - additional setter methods
Date Tue, 27 Mar 2007 19:31:11 GMT
Karin,

Could you please add this to Lucene's JIRA as an Enhancement?
I can just add the setters now, but other Lucene developers are making changes to how mergeFactor
and maxBufferedDocs work.  Those two parameters may also get deprecated in the process, so
it would be better to wait for those changes to happen first.

Otis
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Simpy -- http://www.simpy.com/  -  Tag  -  Search  -  Share

----- Original Message ----
From: "kayomailer-lucene@yahoo.es" <kayomailer-lucene@yahoo.es>
To: java-dev@lucene.apache.org
Sent: Tuesday, March 27, 2007 5:38:28 AM
Subject: 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



---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message