Unit test help

2013-12-20 Thread Scott Schneider
Hello, all. I'm hoping this message gets a response... I am running Lucene's unit tests against a custom Directory subclass (from Lucene Transform) using "-Dtests.directory=org.apache.lucene.store.transform.TransformedDirectoryLuceneTestWrapper". I've been banging my head against this one fai

Re: Unexpected returning false from IndexWriter.tryDeleteDocument

2013-12-20 Thread Derek Lewis
I'll see if I can explain the scenario a bit simpler in a moment, but there's one other thing I thought worth mentioning. I'm not sure it's possible for me to fall back to Term/Query deleting. Basically, if there are two documents in the index that have the same serialId, it's as the result of the

Re: Unexpected returning false from IndexWriter.tryDeleteDocument

2013-12-20 Thread Michael McCandless
I couldn't quite follow the scenario ... but if there's any chance a merge could run in that IndexWriter it can lead to this. Could it just be a merge that was running already at the start of your deletion process? Maybe turn on IndexWriter's infoStream to see what merges are kicking off? Really

Re: Lucene Search and Disk I/O

2013-12-20 Thread wactioner
Thanks for the response! So it loads the terms index into memory, performs a binary search. Then it'll use the index to read from the term dict like reading any other file, relying on the OS's buffer cache. Makes sense. -- View this message in context: http://lucene.472066.n3.nabble.com/Lucen

Re: Unexpected returning false from IndexWriter.tryDeleteDocument

2013-12-20 Thread Derek Lewis
Hi Mike, Thanks for the response. I realize that merging could cause segments to be deleted, resulting in tryDeleteDocument returning false. However, I've been unable to figure out why the scenario I've described would cause segments to be merged. I've tried duplicating it by writing indexes wi

Re: Lucene Search and Disk I/O

2013-12-20 Thread Michael McCandless
The situation is pretty much the same as before, just different file names :) Lucene pre-loads certain "hot" structures into RAM: the terms index (.tip files), deleted documents (.del files), norms, etc. For all other files, it relies on the OS to cache any hot pages in its buffer/IO cache, and i

Re: Unexpected returning false from IndexWriter.tryDeleteDocument

2013-12-20 Thread Michael McCandless
tryDeleteDocument will return false if the IndexReader is "stale", i.e. the segment that contains the docID you are trying to delete has been merged by IndexWriter. In this case you need to fallback to deleting by Term/Query. Mike McCandless http://blog.mikemccandless.com On Fri, Dec 20, 2013

Unexpected returning false from IndexWriter.tryDeleteDocument

2013-12-20 Thread Derek Lewis
Hello, I have a problem where IndexWriter.tryDeleteDocument is returning false unexpectedly. Unfortunately, it's in production, on indexes that have since been merged and shunted around all over, and I've been unable to create a scenario that duplicates the problem in any development environments

Lucene Search and Disk I/O

2013-12-20 Thread wactioner
I had a similar question posted here a few years earlier. How does a lucene search handle disk I/O and reading from index files? I'm not sure how much the previous answer stands true. I notice that so