Re: Closing directory in LuceneTestCase causes stacktrace

2012-06-28 Thread Brendan Grainger
Oops, I finally see it sorry. I could have sworn that this: writer.close(); searcher.close(); directory.close(); was this! writer.close(); searcher.close(); reader.close(); directory.c

Re: Closing directory in LuceneTestCase causes stacktrace

2012-06-28 Thread Robert Muir
That doesnt fix it, that hides your bug. Please re-read what I wrote. If your application code looks like this test then you are leaking file handles. close your indexreader! On Thu, Jun 28, 2012 at 10:39 PM, Brendan Grainger wrote: > Hi Robert, > > Looks like this fixes it: > >                

Re: Closing directory in LuceneTestCase causes stacktrace

2012-06-28 Thread Brendan Grainger
Hi Robert, Looks like this fixes it: MockDirectoryWrapper directory = newDirectory(); directory.setNoDeleteOpenFile(false); // Don't emulate windows Thanks Brendan Grainger brendan.grain...@gmail.com www.kuripai.com On Jun 28, 2012, at 8:57 PM, Robert Muir wrote

Re: Closing directory in LuceneTestCase causes stacktrace

2012-06-28 Thread Brendan Grainger
Hi Robert, I am trying to close the Directory on the very last line of the method which is where the exception is being thrown: assertEquals("cool cat", doc.get("contents")); writer.close(); searcher.close(); direct

Re: Closing directory in LuceneTestCase causes stacktrace

2012-06-28 Thread Robert Muir
On Thu, Jun 28, 2012 at 8:22 PM, Brendan Grainger wrote: > > Interestingly, if I change the *** line above to use the deprecated > constructor taking just the directory it works fine: > its not interesting at all, its the typical contract of a java method. he who opens it closes it. I'll quote

Re: Closing directory in LuceneTestCase causes stacktrace

2012-06-28 Thread Brendan Grainger
I am closing the directory and that's the line where the exception about the open files is being thrown: public class MetaphoneReplacementAnaylyzerTest extends LuceneTestCase { @Test public void testKoolKat() throws Exception { Analyzer an

Closing directory in LuceneTestCase causes stacktrace

2012-06-28 Thread Brendan Grainger
Hi, I'm trying to brush up on some of the *cough* newer APIs (we've been using 2.9.2 up until now). Anyway, I have the test below which a modified version of one of the tests in Lucene In Action, but uses LuceneTestCase as a base class. public class MetaphoneReplacementAnaylyzerTest extends Lu

Re: Lucene Query About Sorting

2012-06-28 Thread Karthik Muthuswami
On Jun 26, 2012, at 5:32 AM, Apostolis Xekoukoulotakis wrote: > I am just new here. > > When you make a query, you create an ordering of the documents based on > this query. > If you have a second ordering, you have to decide what to do with those 2 > orderings. You have to decide how to join th

Re: Question about chinese and WildcardQuery

2012-06-28 Thread Paco Avila
Thanks for the info. 2012/6/28 Li Li > in Chinese, there isn't word boundary between words. it writes like: > Iamok. you should tokenize it to I am ok > if you want to search *amo*, you should view I am ok as one token. In > Chinese, fuzzy search is not very useful. even use Standard Analyzer, >