Slightly Off-topic: How to decide whether or not to add a document?

2009-08-04 Thread ohaya
Hi, I have an app to initially create a Lucene index, and to populate it with documents. I'm now working on that app to insert new documents into that Lucene index. In general, this new app, which is based loosely on the demo apps (e.g., IndexFiles.java), is working, i.e., I can run it with

Re: Slightly Off-topic: How to decide whether or not to add a document?

2009-08-04 Thread Ian Lea
A few suggestions: . Queue the docs once they are complete using something like JMS. . Get the document producers to write to e.g. xxx.tmp and rename to e.g. xxx.txt at the end . Get the document producers to write to a tmp folder and move to e.g. input/ when done . Find a file, store size,

Re: Slightly Off-topic: How to decide whether or not to add a document?

2009-08-04 Thread ohaya
Hi Ian, Thanks for the quick response. I forgot to mention, but in our case, the producers is part of a commercial package, so we don't have a way to get them to change anything, so I think the 1st 3 suggestions are not feasible for us. I have considered something like the 4th suggestion

Re: Slightly Off-topic: How to decide whether or not to add a document?

2009-08-04 Thread ohaya
Ian, One question about the 4th alternative: I was wondering how you implemented the sleep() in Java, esp. in such a way as not to mess up any of the Lucene stuff (in case there's threading)? Right now, my indexer/inserter app doesn't explicitly do any threading stuff. Thanks, Jim

Re: Slightly Off-topic: How to decide whether or not to add a document?

2009-08-04 Thread Ian Lea
Jim The sleep is simply try { Thread.sleep(millis); } catch (InterruptedException ie) { } No threading issues that I'm aware of, despite the method living in the Thread class. But you're right about it possibly impacting performance, if you've got to sleep for a

Re: Slightly Off-topic: How to decide whether or not to add a document?

2009-08-04 Thread ohaya
Hi Ian, Ok, thanks for the additional info. I've implemented check for both file.lastModified and file.length(), and it seems to work in my dev environment (Windows), so I'll have to test on a real system. Thanks again, Jim Ian Lea ian@gmail.com wrote: Jim The sleep is

Re: Slightly Off-topic: How to decide whether or not to add a document?

2009-08-04 Thread Amin Mohammed-Coleman
I've been working on a indexing solution using Spring integration and lucene. the example project uses jms to create work items (index add or update) and then a service that polls for work to do. I should have this complete soon and will be putting it on google code. Not much of help right now