You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Chris Hostetter <ho...@fucit.org> on 2008/06/01 21:23:59 UTC

Re: Opening an index directory inside a jar

: The crux of the issue seems to be that lucene cannot open segments file that
: is inside the jar (under luceneFiles/index directory)

i'm not entirely sure why it would have problems finding the segments 
file, but a larger problem is that Lucene needs random access which (last 
time i checked) isn't available when accessing files in jars...

http://www.nabble.com/Accessing-Lucene-Index-stored-in-a-jar-file-to3009604.html

...you cn always include the index in a jar, and then extract it before 
using it.

: unit/integration/functional tests depend on index files to be created. The
: manual step of creating the index files breaks the automated CI builds or
: some reliance on building the index in some tmp directory. Unfortunately
: that approach has issues if we run tests concurrently. Also, building the
: index takes a couple of minutes, so generating them on the fly for tests is
: expensive and increases the build time.

there's no inherent reason why concurrent tests need to collide if you use 
temp directories -- just have each test create it's own private tmp 
directory and copy the index (or exactract the index from the jar) to 
that private directory in the "setUp" method.




-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Opening an index directory inside a jar

Posted by Benzion G <be...@yahoo.com>.
Hi,

I try to solve the big index problem by zipping it and reading via VFS. I
suppose I'll need to write my own Directory implementation. Did you guys
succeed to do it? How the search speed is?
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Opening-an-index-directory-inside-a-jar-tp554532p2197059.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Opening an index directory inside a jar

Posted by Doron Cohen <cd...@gmail.com>.
>
> : The crux of the issue seems to be that lucene cannot open segments file
> that
> : is inside the jar (under luceneFiles/index directory)
>
> i'm not entirely sure why it would have problems finding the segments
> file, but a larger problem is that Lucene needs random access which (last
> time i checked) isn't available when accessing files in jars...
>
>
> http://www.nabble.com/Accessing-Lucene-Index-stored-in-a-jar-file-to3009604.html
>

I bumped into (though never used)
http://commons.apache.org/vfs/apidocs/org/apache/commons/vfs/provider/jar/JarFileSystem.html
There, FileContent has this method
getRandomAccessContent(org.apache.commons.vfs.util.RandomAccessMode)
so it seems worth exploring.

HTH,
Doron