You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Miklos Pocsaji <mi...@gmail.com> on 2005/06/16 11:23:55 UTC

Two problems

Hi!

Started working with Jackrabbit a month ago and I ran into two problems:

1. I saw a post here that the time-consuming startup is maintained by
somebody. Is there an improvement? Even if there are few hundred
megabytes of stored data, startup time (repository creation is really
slow)

2. I started writing a TextFilter which knows how to extract text from
PDF (I implemented the TextFilter interface). It is simple, I only
have to return a java.io.Reader from which Jackrabbit extracts text.
Obvious and ugly method would be to extract a text to a string and
then return a StringReader but this would require a lot of memory. I
decided to use PiperReader-PipedWriter - a separate thread writes the
text to a PipedWriter and I return the PipedReader instance from the
doFilter() method. It seems that Jackrabbit won't read through the
passed stream immediately. I see my writing thread to stop, then after
performing a search, it throws an exception that the other end of the
pipe is closed...
I do not know if my approach is correct, so if somebody could, please
inform me if this thing could work somehow. I'm thinking about
examining the source itself but if somebody could help me I can spare
a lot of time.

Thank you in advance,
Miklos Pocsaji.

Re: Two problems

Posted by Marcel Reutegger <ma...@gmx.net>.
Miklos Pocsaji wrote:
> 2. I started writing a TextFilter which knows how to extract text from
> PDF (I implemented the TextFilter interface). It is simple, I only
> have to return a java.io.Reader from which Jackrabbit extracts text.
> Obvious and ugly method would be to extract a text to a string and
> then return a StringReader but this would require a lot of memory. I
> decided to use PiperReader-PipedWriter - a separate thread writes the
> text to a PipedWriter and I return the PipedReader instance from the
> doFilter() method. It seems that Jackrabbit won't read through the
> passed stream immediately.

Indexing of nodes is buffered in jackrabbit. this may mean that nodes 
are not added to the index until a query is issued.

As far as I can see you have to make sure that the PipedWriter is not 
closed until the PipedReader is closed.

regards
  marcel