Cannot I search documents added by IndexWriter after commit?

2011-07-05 Thread Gabriele Kahlout
@Test public void testUpdate() throws IOException, ParserConfigurationException, SAXException, ParseException { Analyzer analyzer = getAnalyzer(); QueryParser parser = new QueryParser(Version.LUCENE_32, content, analyzer); Query allQ = parser.parse(*:*);

Re: Cannot I search documents added by IndexWriter after commit?

2011-07-05 Thread Michael McCandless
After your writer.commit you need to reopen your searcher to see the changes. Mike McCandless http://blog.mikemccandless.com On Tue, Jul 5, 2011 at 1:48 PM, Gabriele Kahlout gabri...@mysimpatico.com wrote:    @Test    public void testUpdate() throws IOException, ParserConfigurationException,

Re: Cannot I search documents added by IndexWriter after commit?

2011-07-05 Thread Gabriele Kahlout
and how do you do that? There is no reopen method On Tue, Jul 5, 2011 at 8:09 PM, Michael McCandless luc...@mikemccandless.com wrote: After your writer.commit you need to reopen your searcher to see the changes. Mike McCandless http://blog.mikemccandless.com On Tue, Jul 5, 2011 at 1:48

Re: Cannot I search documents added by IndexWriter after commit?

2011-07-05 Thread Michael McCandless
Sorry, you must reopen the underlying IndexReader, and then make a new IndexSearcher from the reopened reader. Mike McCandless http://blog.mikemccandless.com On Tue, Jul 5, 2011 at 2:12 PM, Gabriele Kahlout gabri...@mysimpatico.com wrote: and how do you do that? There is no reopen method On

Re: Cannot I search documents added by IndexWriter after commit?

2011-07-05 Thread Gabriele Kahlout
Still won't work (same as before). @Test public void testUpdate() throws IOException, ParserConfigurationException, SAXException, ParseException { Analyzer analyzer = getAnalyzer(); QueryParser parser = new QueryParser(Version.LUCENE_32, content, analyzer); Query allQ

Re: Cannot I search documents added by IndexWriter after commit?

2011-07-05 Thread Gabriele Kahlout
Re-open doens't work, but open does. @Test public void testUpdate() throws IOException, ParserConfigurationException, SAXException, ParseException { Analyzer analyzer = getAnalyzer(); QueryParser parser = new QueryParser(Version.LUCENE_32, content, analyzer); Query

Re: Cannot I search documents added by IndexWriter after commit?

2011-07-05 Thread Robert Muir
re-open does work, but you cannot ignore its return value! see the javadocs for an example. On Tue, Jul 5, 2011 at 3:10 PM, Gabriele Kahlout gabri...@mysimpatico.com wrote: Re-open doens't work, but open does. @Test    public void testUpdate() throws IOException,