DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26196>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26196

IndexWriter problem when create set to false





------- Additional Comments From [EMAIL PROTECTED]  2004-03-04 17:38 -------
Thank you Doug, you've almost hit the nail on the head, and I say almost 
because the boolean currently passed in does something subtly different to 
what the name suggests.  May I suggest the name is changed to reflect what it 
actually does "refresh".  I say this because the method is implemented as 
follows:

public IndexWriter(String d, Analyzer a, boolean create) throws IOException {
    if( create )
    {
        // if the directory doesn't exist, throw an FileNotFoundException
        // if the files are there, delete them and start again
    }
    else
    {
        // if the directory doesn't exist, throw an FileNotFoundException
        // if the files arn't there, then throw an exception, otherwise work 
with them
    }
    ...
}

... Other constructors to follow suite


What I'm suggesting is:



public IndexWriter(String d, Analyzer a, boolean refresh) throws IOException {
    if( refresh )
    {
        // if the directory doesn't exist, throw an FileNotFoundException
        // if the files are there, delete them and start again
    }
    else
    {
        // if the directory doesn't exist, throw an FileNotFoundException
        // if the files arn't there, then fine, start a fresh
    }
    ...
}

... Other constructors to follow suite

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to