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 Vinay Kakade <vi...@yahoo.com> on 2002/11/17 04:37:19 UTC
Indexing of documents in memory
Hi,
I want to use Lucene for indexing some documents which
are in memory. I do not want to store them in a
seperate directory.
The IndexWriter class accepts directory name, where
all documents to be indexed are stored. Is there any
way by which we can specify memory buffer in which
documents are stored while creating Index?
Thanks
Vinay.
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Indexing of documents in memory
Posted by Vinay Kakade <vi...@yahoo.com>.
Thanks Karl.
I used ByteArrayInputStream and it is now working !
Thanks again,
-Vinay.
--- Karl_�ie <ka...@gan.no> wrote:
> The org.apache.lucene.store.InputStream is not a
> _stream_ per see as it
> requires a seek() function and it is therefore not
> compatible with the
> java.io.InputStream consept, however you can quite
> easily create a
> java.io.InputStream by grabbing hold of the byte
> content of a
> org.apache.lucene.store.InputStream and stuff it
> into a
> java.io.ByteArrayInputStream.
>
> This doesn't make any sense anyhow because the raw
> bytestream from a
> RAMDirectory will not make any real sense to a HTML
> parser because the
> content of the RAMDir is an binary index. If you
> want to store the
> input HTML documents you should store them into a
> byte or char array in
> a file or database.
>
> mvh karl �ie
>
>
>
> On Monday, Nov 18, 2002, at 03:24 Europe/Oslo, Vinay
> Kakade wrote:
>
> > Hi
> > I am trying to use RAMDirectory to store the input
> > HTML documents which are used to create index by
> the
> > IndexHTML demo program, but I am facing problems.
> > I tried to get individual InputStream objects for
> > individual files from RAMDirectory & pass it to
> > HTMLParser class to parse the file, but the
> HTMLParser
> > class accepts java.io.InputStream object while
> > RAMDirectory returns lucene.store.InputStream
> object.
> > Is there any way to perform any conversion between
> > there two objects? or do I have to modify
> HTMLParser
> > class & all other classes it uses to achieve
> this??
> > Please let me know
> > regards
> > Vinay.
> >
> >
> > --- Otis Gospodnetic <ot...@yahoo.com>
> > wrote:
> >> Look at RAMDirectory.
> >>
> >> Otis
> >>
> >> --- Vinay Kakade <vi...@yahoo.com> wrote:
> >>> Hi,
> >>>
> >>> I want to use Lucene for indexing some documents
> >> which
> >>> are in memory. I do not want to store them in a
> >>> seperate directory.
> >>> The IndexWriter class accepts directory name,
> >> where
> >>> all documents to be indexed are stored. Is there
> >> any
> >>> way by which we can specify memory buffer in
> which
> >>> documents are stored while creating Index?
> >>> Thanks
> >>> Vinay.
> >>>
> >>>
> >>>
> __________________________________________________
> >>> Do you Yahoo!?
> >>> Yahoo! Web Hosting - Let the expert host your
> site
> >>> http://webhosting.yahoo.com
> >>>
> >>> --
> >>> To unsubscribe, e-mail:
> >>>
> >>
> <ma...@jakarta.apache.org>
> >>> For additional commands, e-mail:
> >>> <ma...@jakarta.apache.org>
> >>>
> >>
> >>
> >>
> __________________________________________________
> >> Do you Yahoo!?
> >> Yahoo! Web Hosting - Let the expert host your
> site
> >> http://webhosting.yahoo.com
> >>
> >> --
> >> To unsubscribe, e-mail:
> >>
> <ma...@jakarta.apache.org>
> >> For additional commands, e-mail:
> >> <ma...@jakarta.apache.org>
> >>
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Web Hosting - Let the expert host your site
> > http://webhosting.yahoo.com
> >
> > --
> > To unsubscribe, e-mail:
> >
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Indexing of documents in memory
Posted by Karl Øie <ka...@gan.no>.
The org.apache.lucene.store.InputStream is not a _stream_ per see as it
requires a seek() function and it is therefore not compatible with the
java.io.InputStream consept, however you can quite easily create a
java.io.InputStream by grabbing hold of the byte content of a
org.apache.lucene.store.InputStream and stuff it into a
java.io.ByteArrayInputStream.
This doesn't make any sense anyhow because the raw bytestream from a
RAMDirectory will not make any real sense to a HTML parser because the
content of the RAMDir is an binary index. If you want to store the
input HTML documents you should store them into a byte or char array in
a file or database.
mvh karl øie
On Monday, Nov 18, 2002, at 03:24 Europe/Oslo, Vinay Kakade wrote:
> Hi
> I am trying to use RAMDirectory to store the input
> HTML documents which are used to create index by the
> IndexHTML demo program, but I am facing problems.
> I tried to get individual InputStream objects for
> individual files from RAMDirectory & pass it to
> HTMLParser class to parse the file, but the HTMLParser
> class accepts java.io.InputStream object while
> RAMDirectory returns lucene.store.InputStream object.
> Is there any way to perform any conversion between
> there two objects? or do I have to modify HTMLParser
> class & all other classes it uses to achieve this??
> Please let me know
> regards
> Vinay.
>
>
> --- Otis Gospodnetic <ot...@yahoo.com>
> wrote:
>> Look at RAMDirectory.
>>
>> Otis
>>
>> --- Vinay Kakade <vi...@yahoo.com> wrote:
>>> Hi,
>>>
>>> I want to use Lucene for indexing some documents
>> which
>>> are in memory. I do not want to store them in a
>>> seperate directory.
>>> The IndexWriter class accepts directory name,
>> where
>>> all documents to be indexed are stored. Is there
>> any
>>> way by which we can specify memory buffer in which
>>> documents are stored while creating Index?
>>> Thanks
>>> Vinay.
>>>
>>>
>>> __________________________________________________
>>> Do you Yahoo!?
>>> Yahoo! Web Hosting - Let the expert host your site
>>> http://webhosting.yahoo.com
>>>
>>> --
>>> To unsubscribe, e-mail:
>>>
>> <ma...@jakarta.apache.org>
>>> For additional commands, e-mail:
>>> <ma...@jakarta.apache.org>
>>>
>>
>>
>> __________________________________________________
>> Do you Yahoo!?
>> Yahoo! Web Hosting - Let the expert host your site
>> http://webhosting.yahoo.com
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - Let the expert host your site
> http://webhosting.yahoo.com
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Indexing of documents in memory
Posted by Vinay Kakade <vi...@yahoo.com>.
Hi
I am trying to use RAMDirectory to store the input
HTML documents which are used to create index by the
IndexHTML demo program, but I am facing problems.
I tried to get individual InputStream objects for
individual files from RAMDirectory & pass it to
HTMLParser class to parse the file, but the HTMLParser
class accepts java.io.InputStream object while
RAMDirectory returns lucene.store.InputStream object.
Is there any way to perform any conversion between
there two objects? or do I have to modify HTMLParser
class & all other classes it uses to achieve this??
Please let me know
regards
Vinay.
--- Otis Gospodnetic <ot...@yahoo.com>
wrote:
> Look at RAMDirectory.
>
> Otis
>
> --- Vinay Kakade <vi...@yahoo.com> wrote:
> > Hi,
> >
> > I want to use Lucene for indexing some documents
> which
> > are in memory. I do not want to store them in a
> > seperate directory.
> > The IndexWriter class accepts directory name,
> where
> > all documents to be indexed are stored. Is there
> any
> > way by which we can specify memory buffer in which
> > documents are stored while creating Index?
> > Thanks
> > Vinay.
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Web Hosting - Let the expert host your site
> > http://webhosting.yahoo.com
> >
> > --
> > To unsubscribe, e-mail:
> >
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - Let the expert host your site
> http://webhosting.yahoo.com
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Indexing of documents in memory
Posted by Otis Gospodnetic <ot...@yahoo.com>.
Look at RAMDirectory.
Otis
--- Vinay Kakade <vi...@yahoo.com> wrote:
> Hi,
>
> I want to use Lucene for indexing some documents which
> are in memory. I do not want to store them in a
> seperate directory.
> The IndexWriter class accepts directory name, where
> all documents to be indexed are stored. Is there any
> way by which we can specify memory buffer in which
> documents are stored while creating Index?
> Thanks
> Vinay.
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - Let the expert host your site
> http://webhosting.yahoo.com
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>