cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <>
Subject Re: Could you please tell me how to set the directory of Lucene index?
Date Wed, 09 Mar 2005 20:11:30 GMT
Hi Daniel,

If no index directory parameter is supplied to Lucene, it uses the 
Servlet work directory.
Jetty naturally deletes the contents of this on restart, hence your 

The way you set the index directory depends on what components you use 
with Lucene.

The LuceneIndexTransformer (which creates or updates indexes) can be 
told where to write the index by using the 'directory' attribute in the 
XML that you send it. eg :

   <lucene:document url="url-of-doc">
	. . .
   <lucene:document url="url-of-doc">
	. . .
   . . .

The SearchGenerator can be given an 'index' parameter, to tell it where 
the index you want to search is, eg :

<map:generate type="search">
      <map:parameter name="index" value="/path/to/index/"/>
      . . .

You would typically supply both of these parameters via an input-module 
from a global configuration.

The API documentation could be better.

If you use XSP to create or search indexes (not recommended) you can 
modify the code to pass in your directory location.


regards Jeremy

On 8 Mar 2005, at 18:31, Daniel McOrmond wrote:

> Have you tried posting your question to the Lucene users list?
> -Daniel
> On Tue, 8 Mar 2005 10:53:40 -0500, YAN HE <> wrote:
>> When I created an Lucene index by CoCoon, I found a directory named 
>> "index"
>> existed below the temporary working directory of the servlet engine 
>> (Jetty).
>> After I stopped the cocoon server, this directory was deleted. So I 
>> have to
>> recreate the index every time the cocoon server restarts. Can we 
>> store the
>> index file created in other directory and keep it when the cocoon 
>> server
>> stops? Which configuration file should we change?Or we have to change 
>> the
>> cocoon source code?

                   If email from this address is not signed
                                 IT IS NOT FROM ME

                         Always check the label, folks !!!!!

View raw message