Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 11209 invoked from network); 7 May 2003 12:32:35 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 7 May 2003 12:32:35 -0000 Received: (qmail 7556 invoked by uid 97); 7 May 2003 12:34:36 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@nagoya.betaversion.org Received: (qmail 7549 invoked from network); 7 May 2003 12:34:36 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 7 May 2003 12:34:36 -0000 Received: (qmail 10916 invoked by uid 500); 7 May 2003 12:32:31 -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 10895 invoked from network); 7 May 2003 12:32:31 -0000 Received: from mclean.mail.mindspring.net (207.69.200.57) by daedalus.apache.org with SMTP; 7 May 2003 12:32:31 -0000 Received: from h-66-167-237-119.mclnva23.covad.net ([66.167.237.119] helo=POWERPACK) by mclean.mail.mindspring.net with smtp (Exim 3.33 #1) id 19DO63-0003Oz-00 for lucene-user@jakarta.apache.org; Wed, 07 May 2003 08:32:31 -0400 Message-ID: <1a5901c31494$baaf45b0$0501a8c0@POWERPACK> From: "Terry Steichen" To: "Lucene Users List" References: <1DB01C48A0A9D311995A00508B62B9F00E3CDED6@svntjt1-03.watercorporation.com.au> Subject: Re: Index Path in WAR Date: Wed, 7 May 2003 08:32:30 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Leslie, Sorry but, at least for my e-mail, the attachment got stripped off. Could you send a copy embedded in the message itself? TIA, Terry Steichen ----- Original Message ----- From: "Leslie Hughes" To: "'Lucene Users List'" Sent: Tuesday, May 06, 2003 9:43 PM Subject: RE: Index Path in WAR > > Here it is. Enjoy.... > > > <> > > > -----Original Message----- > > From: Kevin Moran [SMTP:gridplan@yahoo.com] > > Sent: Monday, May 05, 2003 10:51 AM > > To: Lucene Users List > > Subject: RE: Index Path in WAR > > > > 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 > > ---------------------------------------------------------------------------- ---- > --------------------------------------------------------------------- > 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