Upgrading Lucene 2.0.0 TermQuery to 4.2 QueryParser

2013-04-03 Thread Lewis John Mcgibbney
Hi, I'm currently embarking upon a non trivial upgrade of some legacy 2.0.0 code and encounter the following IndexSearcher searcher = null; try { searcher = new IndexSearcher(indexFilePath); Term productIdTerm = new Term("product_id", productId);

Necessary to close() IndexSearcher in 4.X?

2013-04-03 Thread Lewis John Mcgibbney
Hi, I am encountering many situations where searcher.close() is present in finally blocks such as } finally { if (searcher != null) { try { searcher.close(); } catch (Exception ignore) { } searc

Re: Necessary to close() IndexSearcher in 4.X?

2013-04-03 Thread Lewis John Mcgibbney
ndexReader open as long as possible as it is very expensive to open/close them all the time. > > Uwe > > - > Uwe Schindler > H.-H.-Meier-Allee 63, D-28213 Bremen > http://www.thetaphi.de > eMail: u...@thetaphi.de > > >> -Original Message- >> From: Lewis

Re: Upgrading Lucene 2.0.0 TermQuery to 4.2 QueryParser

2013-04-03 Thread Lewis John Mcgibbney
taphi.de > eMail: u...@thetaphi.de > > >> -Original Message- >> From: Lewis John Mcgibbney [mailto:lewis.mcgibb...@gmail.com] >> Sent: Thursday, April 04, 2013 3:39 AM >> To: java-user@lucene.apache.org >> Subject: Upgrading Lucene 2.0.0 TermQuery to 4.2 Qu