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 problem.
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:index
analyzer="org.apache.lucene.analysis.standard.StandardAnalyzer"
directory="/path/to/index/"
create="true"
merge-factor="20">
<lucene:document url="url-of-doc">
. . .
</lucene:document>
<lucene:document url="url-of-doc">
. . .
</lucene:document>
. . .
</lucene:index>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/"/>
. . .
</map:generate>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.
HTH
regards Jeremy
On 8 Mar 2005, at 18:31, Daniel McOrmond wrote:
Have you tried posting your question to the Lucene users list?
[email protected]
-Daniel
On Tue, 8 Mar 2005 10:53:40 -0500, YAN HE <[EMAIL PROTECTED]> 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 MEAlways check the label, folks !!!!! --------------------------------------------------------
smime.p7s
Description: S/MIME cryptographic signature
