Hi Doug,
I haven't verified it but another one of our techies tells me that WLS
returns the name of the warfile that the webapp is sourced from without any
path info. I do need to check this for WLS 6.1 though ;-)
For my app, the index is only a few tens of megs so RAM isn't a problem.
Once I've sorted that version of WARDirectory out I'll probably annd
something that is either config's from the deployment descriptor
(use-ramdirectory = true kindof thing) or just unwar's the index into a temp
dir as you say. I'm guessing but since most Unix boxes use swap for /tmp
then this'll be nearly as fast as a RAMDirextory?
Either way, at the moment I'm grabbing a list of resources stored under (for
example /WEB-INF/index) doing a getResourceAsStream and then creating each
"file" in a RAMDirectory - in a similar way to your suggestion.
Hope to release something early next week.
Bye,
Les
> -----Original Message-----
> From: Doug Cutting [mailto:[EMAIL PROTECTED]]
> Sent: 14 February 2002 18:00
> To: 'Lucene Developers List'
> Subject: RE: Indexes in WAR files
>
>
> > From: Les Hughes [mailto:[EMAIL PROTECTED]]
> >
> > Reading the servlet spec again it says that calls such as
> > servletcontext.getRealPath() will *possibly* return null if
> > the content is
> > being served from a war as opposed the physical path on disk
> > - I'm informed
> > that weblogic actually returns the name of the warfile and
> > not the exploded
> > location. But you're right, Tomcat works differently.
>
> What kind of URL does weblogic return for
> servletContext.getResource("//index/segments")?
> Is it a file: URL?
>
> Keeping the index in files and using FSDirectory will be much more
> efficient. If all the major servlet containers support this
> it would be a
> shame not to take advantage of it. You might look at the result of
> getResource and use an FSDirectory if a file: url is returned, and do
> something else when it's not.
>
> > So in order to isolate from different interpretations of the
> > spec, I'm going
> > to knock up a WARDirectory that probably will wrap a
> > RAMDirectory (going
> > back to the servlet container to getResourceAsStream seems
> > awfully expensive
> > to me) as a first go.
> > I'll post my efforts in a couple of days.
>
> One technique you might consider is, when the index is not
> available as a
> file, use getResourceAsStream to copy it to a temporary directory in
> System.getProperty("java.io.tmpdir"), then use FSDirectory.
> Storing the
> whole index in a RAMDirectory will make searches really fast,
> but could also
> chew up a lot of memory. If the index isn't that big anyway,
> maybe this
> isn't an issue.
>
> Doug
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>