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 14:03 -------
Thanks for your input Daniel.

I'd like to use a constructor where I don't care if the indexes have been 
written before or not, but that if they have been written before then I can 
specify not to start with a fresh slate.  E.g.

In my code, I'd like to write something like:
IndexWriter writer = new IndexWriter( indexpath, new StandardAnalyzer(), 
false );

Instead, because the files may not yet have been written, I have to do 
something like:

IndexWriter writer = null;
try
{
    writer = new IndexWriter( indexpath, new StandardAnalyzer(), false );
}
catch( FileNotFoundException e )
{
    writer = new IndexWriter( indexpath, new StandardAnalyzer(), true );
}

This is not an elegant way to write code.  Therefore, I suggest that either an 
additional constructor is written to avoid the throwing of exceptions when the 
recovery is so obvious, or rectify the current constructor.

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

Reply via email to