Re: How to add a Lucene index to a jar file?
David Spencer wrote: Isn't "ZipDirectory" the thing to search for? I think it's actually URLDirectory: http://www.mail-archive.com/lucene-dev@jakarta.apache.org/msg02453.html Doug - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to add a Lucene index to a jar file?
On Mon, 2005-01-17 at 13:10, Doug Cutting wrote: > The problem is that a jar file entry becomes an InputStream, but > InputStream is not random access, and Lucene requires random access. So > you need to extract the index either to disk or RAM in order to get > random access. I think folks have posted code for this to the list > previously. I think it would be cool if Lucene included a class that facilitated creating a RAMDirectory from an index in a JAR file, for the kind of point-and-click startup that Bill is talking about. Regards, Luke Francl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to add a Lucene index to a jar file?
Doug Cutting wrote: Miles Barr wrote: You'll have to implement org.apache.lucene.store.Directory to load the index from the JAR file. Take a look at FSDirectory and RAMDirectory for some more details. Then you have either load the JAR file with java.util.jar.JarFile to get to the files or you can use Classloader#getResourceAsStream to get to them. The problem is that a jar file entry becomes an InputStream, but InputStream is not random access, and Lucene requires random access. So you need to extract the index either to disk or RAM in order to get random access. I think folks have posted code for this to the list Isn't "ZipDirectory" the thing to search for? previously. Doug - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to add a Lucene index to a jar file?
Miles Barr wrote: You'll have to implement org.apache.lucene.store.Directory to load the index from the JAR file. Take a look at FSDirectory and RAMDirectory for some more details. Then you have either load the JAR file with java.util.jar.JarFile to get to the files or you can use Classloader#getResourceAsStream to get to them. The problem is that a jar file entry becomes an InputStream, but InputStream is not random access, and Lucene requires random access. So you need to extract the index either to disk or RAM in order to get random access. I think folks have posted code for this to the list previously. Doug - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to add a Lucene index to a jar file?
On Mon, 2005-01-17 at 10:25 -0800, Bill Janssen wrote: > I'd like to package up a Lucene index with the Lucene class files and > my own application classes into a single jar file, so that it forms a > "double-clickable" single-file Java application that supports > searching over the index. However, I'm not sure how to read the index > (create an IndexReader) if the files that form the index are packaged > into the same jar file with the code. > > If anyone could shed some light on how to do this, I'd appreciate it. You'll have to implement org.apache.lucene.store.Directory to load the index from the JAR file. Take a look at FSDirectory and RAMDirectory for some more details. Then you have either load the JAR file with java.util.jar.JarFile to get to the files or you can use Classloader#getResourceAsStream to get to them. -- Miles Barr <[EMAIL PROTECTED]> Runtime Collective Ltd. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to add a Lucene index to a jar file?
Hi. I'd like to package up a Lucene index with the Lucene class files and my own application classes into a single jar file, so that it forms a "double-clickable" single-file Java application that supports searching over the index. However, I'm not sure how to read the index (create an IndexReader) if the files that form the index are packaged into the same jar file with the code. If anyone could shed some light on how to do this, I'd appreciate it. Thanks! Bill - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]