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 Ganesh <em...@yahoo.co.in> on 2008/12/01 05:34:48 UTC
Re: Which is faster/better
I have to Tag a document based on User request. On deletion, I should do
'marked for delete' and on document state change, i need to update the
document.
Update internally does delete and add. I am commiting the writer and
re-opening the reader, every minute.
Consider, In a minute, lets say User has deleted a document from the UI.
If i use IndexWriter, then it is updating the document. but it is getting
refreshed only after a minute. If User refreshes his page, then he could see
the deleted item again.
In order to avoid this situitation, i need to plan
1. Delete the document using reader
2. Add the document with new state using Writer.
I think, we can't avoid using DeleteDocument of Reader. Suggest me, if there
is any other way.
Regards
Ganesh
----- Original Message -----
From: "Antony Bowesman" <ad...@teamware.com>
To: <ja...@lucene.apache.org>
Sent: Wednesday, November 26, 2008 4:00 AM
Subject: Re: Which is faster/better
> Michael McCandless wrote:
>>
>> If you have nothing open already, and all you want to do is delete
>> certain documents and make a commit point, then using IndexReader vs
>> IndexWriter should show very little difference in speed.
>
> Thanks. This use case can assume there may be nothing open. I prefer
> IndexWriter as delete=write is a much clearer concept that delete=read...
>
>> As of 2.4, IndexWriter now provides delete-by-Query, which I think
>> ought to meet nearly all of the cases where someone wants to
>> delete-by-docID using IndexReader.
>
> Yes, that is an excellent addition. Up to now, our only use case for
> delete-by-docId is to perform a dBQ and so far, we have been using your
> suggestion from last year about how to do delete documents for ALL terms.
>
> Antony
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
Send instant messages to your online friends http://in.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Which is faster/better
Posted by Ganesh <em...@yahoo.co.in>.
>
> So in your UI, you'd like the delete to happen immediately and then it's
> OK if the updated (added) document then takes a minute to appear?
Yes. Whenever a document state is changed, it moves to different store
(basically a Mail applicaiton, each mail has state of deleted, junk,
delivered etc). Each store has separate UI. When User is viewing a store and
updates a document. The record will be deleted, certain action will be
performed and added with new state so that it could be viewed from different
store. I am using only Lucene as my DB and not using any other database.
Regards
Ganesh
----- Original Message -----
From: "Michael McCandless" <lu...@mikemccandless.com>
To: <ja...@lucene.apache.org>
Sent: Tuesday, December 02, 2008 6:34 AM
Subject: Re: Which is faster/better
>
> So in your UI, you'd like the delete to happen immediately and then it's
> OK if the updated (added) document then takes a minute to appear?
>
> OK, I agree this (the immediacy of doing deletes via IndexReader) is a
> good reason to keep IndexReader.deleteDocument for now.
>
> Mike
>
> Ganesh wrote:
>
>> I have to Tag a document based on User request. On deletion, I should do
>> 'marked for delete' and on document state change, i need to update the
>> document.
>> Update internally does delete and add. I am commiting the writer and
>> re-opening the reader, every minute.
>>
>> Consider, In a minute, lets say User has deleted a document from the UI.
>> If i use IndexWriter, then it is updating the document. but it is
>> getting refreshed only after a minute. If User refreshes his page, then
>> he could see the deleted item again.
>>
>> In order to avoid this situitation, i need to plan
>> 1. Delete the document using reader
>> 2. Add the document with new state using Writer.
>>
>> I think, we can't avoid using DeleteDocument of Reader. Suggest me, if
>> there is any other way.
>>
>> Regards
>> Ganesh
>>
>>
>> ----- Original Message ----- From: "Antony Bowesman" <ad...@teamware.com>
>> To: <ja...@lucene.apache.org>
>> Sent: Wednesday, November 26, 2008 4:00 AM
>> Subject: Re: Which is faster/better
>>
>>
>>> Michael McCandless wrote:
>>>>
>>>> If you have nothing open already, and all you want to do is delete
>>>> certain documents and make a commit point, then using IndexReader vs
>>>> IndexWriter should show very little difference in speed.
>>>
>>> Thanks. This use case can assume there may be nothing open. I prefer
>>> IndexWriter as delete=write is a much clearer concept that
>>> delete=read...
>>>
>>>> As of 2.4, IndexWriter now provides delete-by-Query, which I think
>>>> ought to meet nearly all of the cases where someone wants to
>>>> delete-by-docID using IndexReader.
>>>
>>> Yes, that is an excellent addition. Up to now, our only use case for
>>> delete-by-docId is to perform a dBQ and so far, we have been using your
>>> suggestion from last year about how to do delete documents for ALL
>>> terms.
>>>
>>> Antony
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>> Send instant messages to your online friends
>> http://in.messenger.yahoo.com
>> ---------------------------------------------------------------------
>> 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
>
Send instant messages to your online friends http://in.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Which is faster/better
Posted by Jason Rutherglen <ja...@gmail.com>.
It would be nice to have a pluggable solution for deleteddocs in IndexReader
that accepts a Filter, and have BitVector implement Filter. This way I do
not have to implement IndexReader.clone.
On Mon, Dec 1, 2008 at 5:04 PM, Michael McCandless <
lucene@mikemccandless.com> wrote:
>
> So in your UI, you'd like the delete to happen immediately and then it's OK
> if the updated (added) document then takes a minute to appear?
>
> OK, I agree this (the immediacy of doing deletes via IndexReader) is a good
> reason to keep IndexReader.deleteDocument for now.
>
> Mike
>
>
> Ganesh wrote:
>
> I have to Tag a document based on User request. On deletion, I should do
>> 'marked for delete' and on document state change, i need to update the
>> document.
>> Update internally does delete and add. I am commiting the writer and
>> re-opening the reader, every minute.
>>
>> Consider, In a minute, lets say User has deleted a document from the UI.
>> If i use IndexWriter, then it is updating the document. but it is getting
>> refreshed only after a minute. If User refreshes his page, then he could see
>> the deleted item again.
>>
>> In order to avoid this situitation, i need to plan
>> 1. Delete the document using reader
>> 2. Add the document with new state using Writer.
>>
>> I think, we can't avoid using DeleteDocument of Reader. Suggest me, if
>> there is any other way.
>>
>> Regards
>> Ganesh
>>
>>
>> ----- Original Message ----- From: "Antony Bowesman" <ad...@teamware.com>
>> To: <ja...@lucene.apache.org>
>> Sent: Wednesday, November 26, 2008 4:00 AM
>> Subject: Re: Which is faster/better
>>
>>
>> Michael McCandless wrote:
>>>
>>>>
>>>> If you have nothing open already, and all you want to do is delete
>>>> certain documents and make a commit point, then using IndexReader vs
>>>> IndexWriter should show very little difference in speed.
>>>>
>>>
>>> Thanks. This use case can assume there may be nothing open. I prefer
>>> IndexWriter as delete=write is a much clearer concept that delete=read...
>>>
>>> As of 2.4, IndexWriter now provides delete-by-Query, which I think
>>>> ought to meet nearly all of the cases where someone wants to
>>>> delete-by-docID using IndexReader.
>>>>
>>>
>>> Yes, that is an excellent addition. Up to now, our only use case for
>>> delete-by-docId is to perform a dBQ and so far, we have been using your
>>> suggestion from last year about how to do delete documents for ALL terms.
>>>
>>> Antony
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>
>>
>> Send instant messages to your online friends
>> http://in.messenger.yahoo.com
>> ---------------------------------------------------------------------
>> 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: Which is faster/better
Posted by Michael McCandless <lu...@mikemccandless.com>.
So in your UI, you'd like the delete to happen immediately and then
it's OK if the updated (added) document then takes a minute to appear?
OK, I agree this (the immediacy of doing deletes via IndexReader) is a
good reason to keep IndexReader.deleteDocument for now.
Mike
Ganesh wrote:
> I have to Tag a document based on User request. On deletion, I
> should do 'marked for delete' and on document state change, i need
> to update the document.
> Update internally does delete and add. I am commiting the writer and
> re-opening the reader, every minute.
>
> Consider, In a minute, lets say User has deleted a document from the
> UI.
> If i use IndexWriter, then it is updating the document. but it is
> getting refreshed only after a minute. If User refreshes his page,
> then he could see the deleted item again.
>
> In order to avoid this situitation, i need to plan
> 1. Delete the document using reader
> 2. Add the document with new state using Writer.
>
> I think, we can't avoid using DeleteDocument of Reader. Suggest me,
> if there is any other way.
>
> Regards
> Ganesh
>
>
> ----- Original Message ----- From: "Antony Bowesman"
> <ad...@teamware.com>
> To: <ja...@lucene.apache.org>
> Sent: Wednesday, November 26, 2008 4:00 AM
> Subject: Re: Which is faster/better
>
>
>> Michael McCandless wrote:
>>>
>>> If you have nothing open already, and all you want to do is delete
>>> certain documents and make a commit point, then using IndexReader vs
>>> IndexWriter should show very little difference in speed.
>>
>> Thanks. This use case can assume there may be nothing open. I
>> prefer IndexWriter as delete=write is a much clearer concept that
>> delete=read...
>>
>>> As of 2.4, IndexWriter now provides delete-by-Query, which I think
>>> ought to meet nearly all of the cases where someone wants to
>>> delete-by-docID using IndexReader.
>>
>> Yes, that is an excellent addition. Up to now, our only use case
>> for delete-by-docId is to perform a dBQ and so far, we have been
>> using your suggestion from last year about how to do delete
>> documents for ALL terms.
>>
>> Antony
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>
> Send instant messages to your online friends http://in.messenger.yahoo.com
> ---------------------------------------------------------------------
> 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