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 Cam Bazz <ca...@gmail.com> on 2008/07/23 22:08:50 UTC

deleting documents with doc id

hello -

if I make a query and get the document ids and delete with the document id -
could there be a side effect?

my index is committed periodically, but i can not say when it is committed.

best regards,
-c.b.

Re: deleting documents with doc id

Posted by Cam Bazz <ca...@gmail.com>.
well just checked the api, the deleteDocuments(term[]) method deletes any
document containing any of the terms.

I think I will go to the trunk version.

best.
-c.a.

On Sat, Aug 2, 2008 at 12:14 AM, Cam Bazz <ca...@gmail.com> wrote:

>
> from what I understand:
> there is a deleteDocuments by a term array method?
>
>
> I was asking if there was a side effect of deleting from indexReader that i
> get from an indexsearcher and not the writer.
>
> Best.
>
>
> On Sun, Jul 27, 2008 at 9:44 PM, Karsten F. <karsten-lucene@fiz-technik.de
> > wrote:
>
>>
>> Hi,
>>
>> only to be sure:
>> You know IndexModifier.deleteDocument(int)?
>> It is deprecated, because you should use
>> IndexWriter.deleteDocuments(Term[]).
>>
>> What do you mean with "index is committed".
>> If you mean "optimize()" the document number will change (so there is a
>> side-effect;-)
>>
>> best regards
>>  Karsten
>>
>>
>> cambazz wrote:
>> >
>> > hello,
>> >
>> > the thing is:
>> >
>> > I got a indexwriter and indexsearcher.
>> >
>> > I do a indexsearcher.getIndexReader.delete(int id)
>> >
>> > would not that cause problems? there is not a way to delete from
>> > indexwriter, and I think i will cause a lock issue deleting from
>> > indexsearcher.
>> >
>> > best,
>> > -C.B.
>> >
>> --
>> View this message in context:
>> http://www.nabble.com/deleting-documents-with-doc-id-tp18619372p18679168.html
>> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>

Re: deleting documents with doc id

Posted by Cam Bazz <ca...@gmail.com>.
from what I understand:
there is a deleteDocuments by a term array method?


I was asking if there was a side effect of deleting from indexReader that i
get from an indexsearcher and not the writer.

Best.

On Sun, Jul 27, 2008 at 9:44 PM, Karsten F.
<ka...@fiz-technik.de>wrote:

>
> Hi,
>
> only to be sure:
> You know IndexModifier.deleteDocument(int)?
> It is deprecated, because you should use
> IndexWriter.deleteDocuments(Term[]).
>
> What do you mean with "index is committed".
> If you mean "optimize()" the document number will change (so there is a
> side-effect;-)
>
> best regards
>  Karsten
>
>
> cambazz wrote:
> >
> > hello,
> >
> > the thing is:
> >
> > I got a indexwriter and indexsearcher.
> >
> > I do a indexsearcher.getIndexReader.delete(int id)
> >
> > would not that cause problems? there is not a way to delete from
> > indexwriter, and I think i will cause a lock issue deleting from
> > indexsearcher.
> >
> > best,
> > -C.B.
> >
> --
> View this message in context:
> http://www.nabble.com/deleting-documents-with-doc-id-tp18619372p18679168.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: deleting documents with doc id

Posted by "Karsten F." <ka...@fiz-technik.de>.
Hi,

only to be sure:
You know IndexModifier.deleteDocument(int)?
It is deprecated, because you should use
IndexWriter.deleteDocuments(Term[]).

What do you mean with "index is committed".
If you mean "optimize()" the document number will change (so there is a
side-effect;-)

best regards
  Karsten 


cambazz wrote:
> 
> hello,
> 
> the thing is:
> 
> I got a indexwriter and indexsearcher.
> 
> I do a indexsearcher.getIndexReader.delete(int id)
> 
> would not that cause problems? there is not a way to delete from
> indexwriter, and I think i will cause a lock issue deleting from
> indexsearcher.
> 
> best,
> -C.B.
> 
-- 
View this message in context: http://www.nabble.com/deleting-documents-with-doc-id-tp18619372p18679168.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: deleting documents with doc id

Posted by Cam Bazz <ca...@gmail.com>.
hello,

the thing is:

I got a indexwriter and indexsearcher.

I do a indexsearcher.getIndexReader.delete(int id)

would not that cause problems? there is not a way to delete from
indexwriter, and I think i will cause a lock issue deleting from
indexsearcher.

best,
-C.B.

On Thu, Jul 24, 2008 at 2:13 AM, Karl Wettin <ka...@gmail.com> wrote:

>
> 23 jul 2008 kl. 22.08 skrev Cam Bazz:
>
>
>  hello -
>>
>> if I make a query and get the document ids and delete with the document id
>> -
>> could there be a side effect?
>>
>> my index is committed periodically, but i can not say when it is
>> committed.
>>
>
> The only thing is that the deltions will not be visible until you create a
> new IndexReader. Also, lots and lots of deletions without optimizing an
> index can have an impact on performance, but that is not something you are
> likely to encounter.
>
>
>      karl
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: deleting documents with doc id

Posted by Karl Wettin <ka...@gmail.com>.
23 jul 2008 kl. 22.08 skrev Cam Bazz:

> hello -
>
> if I make a query and get the document ids and delete with the  
> document id -
> could there be a side effect?
>
> my index is committed periodically, but i can not say when it is  
> committed.

The only thing is that the deltions will not be visible until you  
create a new IndexReader. Also, lots and lots of deletions without  
optimizing an index can have an impact on performance, but that is not  
something you are likely to encounter.


       karl

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org