lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 26196] - IndexWriter problem when create set to false
Date Thu, 04 Mar 2004 17:38:08 GMT
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 nick.west@intercea.co.uk  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: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message