Christopher, > I?m working on a site-grabber to wich I would like to add offline search > funktionality. I experimented with lucene, and it covers all my needs. I?m > planning to realize the search functionality with an applet. > > Problem: I cannot access the index created with lucene from my applet. The > only way to access resources on a remote host (wich could be the file-system > as well) is with a stream.
This sounds about right. It's a question of the applet sandbox, not of lucene itself. I've done a little applet work in the past; my general advice is that a "site-grabber with offline search functionality" is not compatible with the constraints an applet must run under. Specifically applets have no access to the local file system, and applets may only open network connections back to the server they were downloaded from. I strongly suggest you ditch the applet aspect entirely, and maybe look into sun's Java Web Start, which attempts to give you a good combination of the features of an applet and an application. > //Something like this > URL source = new URL(getCodeBase(), "path_to_index"); > BufferedReader in = new BufferedReader(new > InputStreamReader(source.openStream())); > ... > > >From what I tested lucene I found that the only possibilities to access an > existing index is directly with a 'org.apache.lucene.store.Directory' or a > 'java.io.File' or a 'java.lang.String' containing the path to the index. What you say in this sentence could be rewritten more correctly as, "it is only possible to access an existing index stored on a disk by using one of three classes that access the disk." Do you see the tautology there? > It seems to me that maybe lucene should add this possibility to access an > index? You do bring up one interesting possibility, which is that perhaps Lucene should have some option to retrieve an index file from a URL. I'm not sure how wise this would be - if you're retrieving the index file from a URL, why not just run the search at that URL? - but it's something to consider. You should think carefully about what your goal is, and whether such an approach would help, and do a little experimentation with the lucene code - after all, you have the source, so you can create a new class to load an index from some remote location. If you have good results, maybe post the code here. Steven J. Owens [EMAIL PROTECTED] -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>