>>Finally, we had a problem earlier where documents added in one instance
>>of an index would not appear in search results in another instance if
>>that second instance was opened before the document was added. Could
>>this be explained by our not calling optimize()? We had to rearchitect
>>out app to work around this :-(
I think this has to do with your Mergefactor. By default the Mergefactor is
set to 10 which means that after 10 documents have been added they are flushed to disk.
For fast indexing and batch indexing you can set this value higher which causes lucene to
store indexed documents to a Ramdirectory until the Mergefactor is hit. If you want to have your indexed document show up
immediately in search results of other instances you need to have the document flushed to disk.
This can be done by closing the IndexWriter or the more expensive approach calling optimize.
Taka Muraoka wrote:
>We are having problems with CLucene crashing during some queries,
>especially quoted phrases e.g. "hello world"
>We have tracked it down (apparently) to our not calling IndexWriter::optimize()
>after adding documents, as the demo program does. Removing the call from
>the demo causes it to crash on the same queries.
>- Despite its name, is calling optimize() *required* after adding a
>- If so, can we batch up documents or do we have to call it for each
>- What is the performance hit? It seems to be doing quite a lot of work.
> Things seem to progressively slow down as the index gets bigger.
>Finally, we had a problem earlier where documents added in one instance
>of an index would not appear in search results in another instance if
>that second instance was opened before the document was added. Could
>this be explained by our not calling optimize()? We had to rearchitect
>out app to work around this :-(
>This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
>Use IT products in your business? Tell us what you think of them. Give us
>Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
>CLucene-developers mailing list