lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Byrne <>
Subject Re: How to create a new index
Date Wed, 20 May 2009 09:53:26 GMT
You can do this with pure Java. Create a file object with the path you 
want, check if it exists, and it not, create it:

File newIndexDir = new File("/foo/bar")

if(!newFileDir.exists())   {


The 'mkdirs()' method creates any necessary parent directories.

If you want to automate the generation of the path itself, then there 
are several ways to do it, but the best way really depends on *why* 
you're generating a new index. For instance, you could just create a 
timestamped name, but that name might not be very meaningful.

Hope that helps!


KK wrote:
> How to create a new index? everytime I need to do so , I've to create a new
> directory and put the path to that, right? how to automate the creation of
> new directory?
> I'm a new user of lucene. Please help me out.
> Thanks,
> KK.
> ------------------------------------------------------------------------
> No virus found in this incoming message.
> Checked by AVG - 
> Version: 8.5.339 / Virus Database: 270.12.35/2123 - Release Date: 05/19/09 17:59:00

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message