lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: [subscriptions] Re: Please make org.apache.lucene.index.IndexWriter non-final
Date Sun, 05 Oct 2003 14:13:11 GMT
On Sunday, October 5, 2003, at 09:56  AM, Mike Hogan wrote:
> I am trying to test this:
>
> public void index(String componentId, String componentDescription) 
> throws
> SearchService.Exception {
>         IndexWriter writer = null;
>         try {
>             writer = new IndexWriter(INDEX_FILE_PATH, new
> StandardAnalyzer(), !indexExists());
>             final Document document = new Document();
>             document.add(Field.Text("id", componentId));
>             document.add(Field.Text("contents", componentDescription));
>             writer.addDocument(document);
>             writer.optimize();
>             writer.close();
>         } catch (IOException e) {
>             throw new SearchService.Exception("Exception updating 
> Lucene
> index", e);
>         }
>     }

Looks pretty much like you're testing Lucene here, not your application 
around it.... nothing inside the try block is your own stuff its just 
Lucene API calls.

>
> What ya reckon?

I reckon ya oughta have a look at Lucene's test cases and source code.  
Ever hear of RAMDirectory?!  :))

	Erik



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message