lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leslie Hughes <Leslie.Hug...@watercorporation.com.au>
Subject IndexWriter and Directory create param
Date Tue, 10 Jun 2003 06:14:12 GMT
Hi,

I'm doing something like:-

Directory dir = FSDirectory.getDirectory("myindex", true);
IndexWriter writer = new IndexWriter(dir, myAnalyser, true);

which gives me a nice clean index. But what if the create params are
different? If I open a directory with create=false then create a writer on
it with create = true will this give problems? Maybe I should do something
like

boolean flag = true/false;
Directory dir = FSDirectory.getDirectory("myindex", flag);
IndexWriter writer = new IndexWriter(dir, myAnalyser, false);


Whilst I'm on the subject, there doesn't appear to be a standard way of
creating a Directory, FSDir has a getDirectory whilst RAMDir uses a
constructor - shouldn't there be a standard method on the Directory
interface (like there is with close)? Or maybe a configurable
DirectoryFactory?


Ideas?

Bye

Les




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


Mime
View raw message