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 Manner Róbert <rm...@gmail.com> on 2016/01/12 16:43:55 UTC
IndexWriter.addIndexes with LeafReader parameter
Hi,
we have used lucene 4.7.0 before, we are on the way to upgrade to 5.4.0.
The problem I have is that writer.addIndexes now needs CodecReader and does
not accept a basic LeafReader what we have.
Is there any efficient way to work around that? How would you do it? Query
the documents and addDocument one by one? Or can I somehow wrap my
LeafReader in a CodecReader? What is the reason to require CodecReader and
what is that for? Its documentation seems to be missing, and I could not
find anything on the net either.
Thanks for any pointers in advance,
Robi
Re: IndexWriter.addIndexes with LeafReader parameter
Posted by Manner Róbert <rm...@gmail.com>.
Hi Christoph,
Thanks for the suggestion, it seems to work fine. I have somehow missed
this class.
Br,
Robert
On Wed, Jan 13, 2016 at 9:30 AM, Christoph Kaser <lu...@iconparc.de>
wrote:
> You could try using the org.apache.lucene.index.SlowCodecReader to wrap
> your index reader:
> SlowCodecReaderWrapper.wrap(indexReader) returns a CodecReader from an
> index reader.
>
> Regards
> Christoph
>
>
> Am 13.01.2016 um 09:09 schrieb Manner Róbert:
>
>> Unfortunately I can not use that, because I do not want to copy all the
>> indexes. Our use case is "archiving" of indexes: we would like to copy to
>> separate file (and remove) part of the indexes, for example which are more
>> than a month old. We achieved it by writing a Reader which does the
>> filtering, and use the writer to write them out.
>>
>> Robert
>>
>> On Tue, Jan 12, 2016 at 8:00 PM, Dawid Weiss <da...@gmail.com>
>> wrote:
>>
>> You can addIndexes(Directory... dirs) -- then you don't have to deal
>>> with CodecReader?
>>>
>>> Dawid
>>>
>>> On Tue, Jan 12, 2016 at 4:43 PM, Manner Róbert <rm...@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> we have used lucene 4.7.0 before, we are on the way to upgrade to 5.4.0.
>>>>
>>>> The problem I have is that writer.addIndexes now needs CodecReader and
>>>>
>>> does
>>>
>>>> not accept a basic LeafReader what we have.
>>>>
>>>> Is there any efficient way to work around that? How would you do it?
>>>>
>>> Query
>>>
>>>> the documents and addDocument one by one? Or can I somehow wrap my
>>>> LeafReader in a CodecReader? What is the reason to require CodecReader
>>>>
>>> and
>>>
>>>> what is that for? Its documentation seems to be missing, and I could not
>>>> find anything on the net either.
>>>>
>>>> Thanks for any pointers in advance,
>>>>
>>>> Robi
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>
>>>
>>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
Re: IndexWriter.addIndexes with LeafReader parameter
Posted by Christoph Kaser <lu...@iconparc.de>.
You could try using the org.apache.lucene.index.SlowCodecReader to wrap
your index reader:
SlowCodecReaderWrapper.wrap(indexReader) returns a CodecReader from an
index reader.
Regards
Christoph
Am 13.01.2016 um 09:09 schrieb Manner Róbert:
> Unfortunately I can not use that, because I do not want to copy all the
> indexes. Our use case is "archiving" of indexes: we would like to copy to
> separate file (and remove) part of the indexes, for example which are more
> than a month old. We achieved it by writing a Reader which does the
> filtering, and use the writer to write them out.
>
> Robert
>
> On Tue, Jan 12, 2016 at 8:00 PM, Dawid Weiss <da...@gmail.com> wrote:
>
>> You can addIndexes(Directory... dirs) -- then you don't have to deal
>> with CodecReader?
>>
>> Dawid
>>
>> On Tue, Jan 12, 2016 at 4:43 PM, Manner Róbert <rm...@gmail.com> wrote:
>>> Hi,
>>>
>>> we have used lucene 4.7.0 before, we are on the way to upgrade to 5.4.0.
>>>
>>> The problem I have is that writer.addIndexes now needs CodecReader and
>> does
>>> not accept a basic LeafReader what we have.
>>>
>>> Is there any efficient way to work around that? How would you do it?
>> Query
>>> the documents and addDocument one by one? Or can I somehow wrap my
>>> LeafReader in a CodecReader? What is the reason to require CodecReader
>> and
>>> what is that for? Its documentation seems to be missing, and I could not
>>> find anything on the net either.
>>>
>>> Thanks for any pointers in advance,
>>>
>>> Robi
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: IndexWriter.addIndexes with LeafReader parameter
Posted by Manner Róbert <rm...@gmail.com>.
Unfortunately I can not use that, because I do not want to copy all the
indexes. Our use case is "archiving" of indexes: we would like to copy to
separate file (and remove) part of the indexes, for example which are more
than a month old. We achieved it by writing a Reader which does the
filtering, and use the writer to write them out.
Robert
On Tue, Jan 12, 2016 at 8:00 PM, Dawid Weiss <da...@gmail.com> wrote:
> You can addIndexes(Directory... dirs) -- then you don't have to deal
> with CodecReader?
>
> Dawid
>
> On Tue, Jan 12, 2016 at 4:43 PM, Manner Róbert <rm...@gmail.com> wrote:
> > Hi,
> >
> > we have used lucene 4.7.0 before, we are on the way to upgrade to 5.4.0.
> >
> > The problem I have is that writer.addIndexes now needs CodecReader and
> does
> > not accept a basic LeafReader what we have.
> >
> > Is there any efficient way to work around that? How would you do it?
> Query
> > the documents and addDocument one by one? Or can I somehow wrap my
> > LeafReader in a CodecReader? What is the reason to require CodecReader
> and
> > what is that for? Its documentation seems to be missing, and I could not
> > find anything on the net either.
> >
> > Thanks for any pointers in advance,
> >
> > Robi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
Re: IndexWriter.addIndexes with LeafReader parameter
Posted by Dawid Weiss <da...@gmail.com>.
You can addIndexes(Directory... dirs) -- then you don't have to deal
with CodecReader?
Dawid
On Tue, Jan 12, 2016 at 4:43 PM, Manner Róbert <rm...@gmail.com> wrote:
> Hi,
>
> we have used lucene 4.7.0 before, we are on the way to upgrade to 5.4.0.
>
> The problem I have is that writer.addIndexes now needs CodecReader and does
> not accept a basic LeafReader what we have.
>
> Is there any efficient way to work around that? How would you do it? Query
> the documents and addDocument one by one? Or can I somehow wrap my
> LeafReader in a CodecReader? What is the reason to require CodecReader and
> what is that for? Its documentation seems to be missing, and I could not
> find anything on the net either.
>
> Thanks for any pointers in advance,
>
> Robi
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org