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 Dirk Hennig <dh...@rrzn.uni-hannover.de> on 2005/07/07 11:11:44 UTC
IOException IndexReader out of date
Hallo,
When I try to use this to remove several documents from the index
---------------------------------------------------------------------
indexReader.open(index);
while (!removeStack.empty()) {
int hitId = ((Integer)(removeStack.pop())).intValue();
indexReader.delete(hitId);
}
indexReader.close();
---------------------------------------------------------------------
I get
---------------------------------------------------------------------
java.io.IOException
with message: IndexReader out of date and no longer valid for delete,
undelete, or setNorm operations
---------------------------------------------------------------------
What's the problem?
Greetings,
Dirk
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: IOException IndexReader out of date
Posted by Dirk Hennig <dh...@rrzn.uni-hannover.de>.
Volodymyr Bychkoviak wrote:
> method open is static method wich returns new indexReader. maybe this is
> the problem.
I did not see the wood for the trees!
That's it!
The correct program looks like this:
---------------------------------------------------------------------
indexReader = IndexReader.open(index);
while (!removeStack.empty()) {
int hitId = ((Integer)(removeStack.pop())).intValue();
indexReader.delete(hitId);
}
indexReader.close();
---------------------------------------------------------------------
Thanx a lot,
Dirk
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: IOException IndexReader out of date
Posted by Volodymyr Bychkoviak <vb...@i-hypergrid.com>.
Dirk Hennig wrote:
> Volodymyr Bychkoviak wrote:
>
>> the problem is than index was modified between
>> indexReader.open(index); and indexReader.delete(hitId); method calls.
>
>
> That would explain the exception.
> But How?
it can be modified by another indexReader or indexWriter.
> The program is exactly as I wrote it!
method open is static method wich returns new indexReader. maybe this is
the problem.
>
>
>>> ---------------------------------------------------------------------
>>> indexReader.open(index);
>>> while (!removeStack.empty()) {
>>> int hitId = ((Integer)(removeStack.pop())).intValue();
>>> indexReader.delete(hitId);
>>> }
>>> indexReader.close();
>>> ---------------------------------------------------------------------
>>
>
>
> Dirk
>
>
> ---------------------------------------------------------------------
> 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: IOException IndexReader out of date
Posted by Dirk Hennig <dh...@rrzn.uni-hannover.de>.
Volodymyr Bychkoviak wrote:
> the problem is than index was modified between indexReader.open(index);
> and indexReader.delete(hitId); method calls.
That would explain the exception.
But How?
The program is exactly as I wrote it!
>> ---------------------------------------------------------------------
>> indexReader.open(index);
>> while (!removeStack.empty()) {
>> int hitId = ((Integer)(removeStack.pop())).intValue();
>> indexReader.delete(hitId);
>> }
>> indexReader.close();
>> ---------------------------------------------------------------------
Dirk
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: IOException IndexReader out of date
Posted by Volodymyr Bychkoviak <vb...@i-hypergrid.com>.
the problem is than index was modified between indexReader.open(index);
and indexReader.delete(hitId); method calls.
regards,
Volodymyr Bychkoviak
Dirk Hennig wrote:
> Hallo,
>
> When I try to use this to remove several documents from the index
> ---------------------------------------------------------------------
> indexReader.open(index);
> while (!removeStack.empty()) {
> int hitId = ((Integer)(removeStack.pop())).intValue();
> indexReader.delete(hitId);
> }
> indexReader.close();
> ---------------------------------------------------------------------
>
> I get
> ---------------------------------------------------------------------
> java.io.IOException
> with message: IndexReader out of date and no longer valid for delete,
> undelete, or setNorm operations
> ---------------------------------------------------------------------
>
> What's the problem?
>
> Greetings,
> Dirk
>
>
>
>
>
> ---------------------------------------------------------------------
> 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