Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 45707 invoked from network); 5 May 2003 02:50:37 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 5 May 2003 02:50:37 -0000 Received: (qmail 18199 invoked by uid 97); 5 May 2003 02:52:47 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@nagoya.betaversion.org Received: (qmail 18192 invoked from network); 5 May 2003 02:52:46 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 5 May 2003 02:52:46 -0000 Received: (qmail 45399 invoked by uid 500); 5 May 2003 02:50:34 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 45384 invoked from network); 5 May 2003 02:50:33 -0000 Received: from web11707.mail.yahoo.com (216.136.172.73) by daedalus.apache.org with SMTP; 5 May 2003 02:50:33 -0000 Message-ID: <20030505025043.85314.qmail@web11707.mail.yahoo.com> Received: from [172.200.178.109] by web11707.mail.yahoo.com via HTTP; Sun, 04 May 2003 19:50:43 PDT Date: Sun, 4 May 2003 19:50:43 -0700 (PDT) From: Kevin Moran Subject: RE: Index Path in WAR To: Lucene Users List In-Reply-To: <1DB01C48A0A9D311995A00508B62B9F00E3CDEC8@svntjt1-03.watercorporation.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi Les, I haven't run any metrics on the JarDirectory approach. But, at least in my application, searches are surprisingly fast as long as the Jar is uncompressed. If it's compressed, searches are noticeably slower. When I wrote that class I didn't think I'd have concurrency issues because my users are only ever searching, and not updating, the Jar. But maybe I'm missing something obvious. If so, please let me know. In any case, if you get a chance, I would like to see your WARDirectory class. That's an interesting approach that I hadn't considered. TIA, -kevin --- Leslie Hughes wrote: > > Hi, > > I've written a simple WARDirectory which delegates > to either a RAMDir or > FSDir. The WARDir is initialised by a listener > (servlet 2.3/4? spec) and > either copies the index to the servlet temp > directory or to RAM depending > upon a setting in the web.xml file. > > I dont have the source with me but if you want, I'll > bring it into work > tomorrow. > > I did think about going the jardir route but had > performance concerns about > lucene accessing a single jarfile. > > Bye > > Les > > > > > -----Original Message----- > > From: Kevin Moran [SMTP:gridplan@yahoo.com] > > Sent: Monday, May 05, 2003 8:38 AM > > To: Lucene Users List > > Subject: Re: Index Path in WAR > > > > Hi Jason, > > This may not be the best solution and may > differ > > from your situation if your index is read/write > (mine > > isn't). But hey, it works for me. How I got > around > > the problem was first to Jar up the index. I > Jarred > > it up uncompressed for speed. I then subclassed > > Directory. I called it JarDirectory. I made > > JarDirectory's constructor use > > ClassLoader.getResource() to find the Jar and then > > create a java.util.jar.JarFile from it. The > methods I > > overrode in Directory (e.g., list(), fileExists(), > > etc.) use the JarFile as appropriate. After I > > debugged that class all I had to do was create an > > instance of JarDirectory and pass it to > > IndexSearcher's constructor. My searches then > went > > against the Jar file. As long as the Jar is in > the > > classpath -- which you can bundle with your web > app > > and set a classpath to in your manifest file -- it > > works. That allows you to bundle the index with > the > > web app and avoid hard-coding a path to it. > > > > HTH, > > -kevin > > > > P.S. Unfortunately, I can't provide the source to > > JarDirectory as it is not mine to give. But it > didn't > > take long to write and was less than 400 lines > long. > > Maybe someone else on the mailing list can point > you > > to a better concrete example. > > > > --- Jason.Cox@trw.com wrote: > > > List, > > > > > > I'm having problems using an absolute path to > the > > > index directory when my web application is > deployed > > > in a WAR file. The absolute path changes > depending > > > on the server. Is there a way to either > dynamically > > > determine an absolute path to the index > directory or > > > to use relative pathing? > > > > > > Thanks in advance, > > > > > > Jason > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: > > > lucene-user-unsubscribe@jakarta.apache.org > > > For additional commands, e-mail: > > > lucene-user-help@jakarta.apache.org > > > > > > > > > __________________________________ > > Do you Yahoo!? > > The New Yahoo! Search - Faster. Easier. Bingo. > > http://search.yahoo.com > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > lucene-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: > lucene-user-help@jakarta.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > lucene-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: > lucene-user-help@jakarta.apache.org > __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org