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 14:03:41 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 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: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message