lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mufaddal Khumri" <MKhu...@allegromedical.com>
Subject Index location
Date Mon, 29 Aug 2005 16:29:03 GMT
Hi,

I have been trying to control where lucene creates the search index for
my web application.

I am tweaking the following code in order to specify the location for
the index, but it seems that lucene is creating the index in the
location from where my CreateIndex.class is invoked.

Here is the code:

public class CreateSearchIndex
{  
  // ....
  // .....
  public static void main(String[] args)
  {    
    try
    {      
	  String indexPath = 
        "/xyz/default-site/WEB-INF/products-search-index";
        initIndex(indexPath);
    }
    catch(Exception ex)
    {
      ex.printStackTrace();
    }
  }

  // ...
  // ...
	
  public void initIndex(String indexPath) throws IOException
  {
     fsWriter = new IndexWriter(indexPath, analyzer, true);
  }
}

I invoke the above class via an ant task from the default-site directory
and my index gets created in the same directory. I want to create it in
the default-site/WEB-INF directory instead? Any pointers as to where I
might be going wrong?

Thanks,
Mufaddal.


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


Mime
View raw message