Hi Erik,
In a newer version of the out lucene integration we have a solution, where it can be configured after which number of changes at the index (deletes and adds) the optimize method will be called.
Is that a better way, or did you mean that we can omit the call completeley?


Thanks, Stefan

Erik Hatcher wrote:

Darren, one comment on your code below...

On Oct 5, 2004, at 10:44 AM, Darren Hartford wrote:

Hey all,
Made some small modifications to the 'org.apache.slide.TextContentIndexer' to create a 'LuceneNodeIndexer'.


The only real thing that was changed was the indexed content:
=====
         // Create document
         Document doc = new Document();

doc.add(Field.Keyword(URI_FIELD, uri.toString()));
Enumeration em = readProperties(revisionDescriptor, revisionContent);
while(em.hasMoreElements()){
NodeProperty prop = (NodeProperty)em.nextElement();
doc.add(Field.Keyword(prop.getName(),prop.getValue().toString()));
System.out.println("create index: -" + prop.getName() + "- with value: " + prop.getValue().toString());
}


            indexWriter.addDocument(doc);
            indexWriter.optimize();


I'm not sure where the indexWriter.optimize() call is (I'm just a lurker on the Slide list at this point), but it very likely should not be called every time a document is added. Lucene internally optimizes itself, based on various factors, periodically when documents are added. You can force it using the optimize call, but that should only be used at a different time.

    Erik
    co-author of the upcoming Lucene in Action (Manning) book



======

This seems to be working good (only for newly added documents or properties that are updated).

How do I get the SearchMethod to take advantage of this new index?

-D

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to