Hey,
you are right FSDirectory is abstract, yet the fact that it doesn't
declare an abstract method doesn't make it wrong. Please use the
static factory methods FSDirectory.open(File) to create an instance.
This factory will create a reasonable default for your platform. see
the javadoc for detail
This is from Lucene's CHANGES.txt:
LUCENE-773: Deprecate the FSDirectory.getDirectory(*) methods that
take a boolean "create" argument. Instead you should use
IndexWriter's "create" argument to create a new index.
(Mike McCandless)
So you should create the FSDir with
FSDirect
In general it is much nicer to say "I did not make myself clear" than "you
are not getting me"
If you look on the java doc page for FSDirectory it tells you what do do
instead of the deprecated method:
getDirectory(File file, boolean create)
Deprecated. Use IndexWriter's create flag
A directory that your program can modify . I assume that
you are running on a unix-like system and the directory you've
specified is protected from modification by whatever user
your process is identified as.
But two other things:
1> do you really want to create a new index as the "true" indicates
That *should* work. Can you post more of your code?
Particularly the index creation code where you instantiate
your index.
Also, what assurance do you have that fsd1 exists? Although
even if it doesn't exist the exception seems odd.
Instead of just giving the name of the exception, please post
Thank you for your reply. With addIndexes this works perfectly but when i
change it to:
writer.addIndexesNoOptimize(new Directory[] { fsd1});
It throws an exception saying it doesn't have a method with this parameters.
I need a fast merge and with the optimization this is not possible and i
want
FSDirectory fsd1 = FSDirectory.getDirectory("e:/Index1");
FSDirectory fsd2 = FSDirectory.getDirectory("e:/Index2");
FSDirectory fsd3 = FSDirectory.getDirectory("e:/Index3");
FSDirectory fsd4 = FSDirectory.getDirectory("e:/Index4");
FSDirectory