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 Bernd Müller <be...@googlemail.com> on 2013/01/30 14:26:41 UTC

IndexWriter deleteDocuments

Hello,

In my index, I have documents identified by a field with their unique
identifier. Now, I tried to delete documents having such a unique
identifier using deleteDocuments(Term t). If I test the IndexWriter
for deletions with hasDeletions(), it tells me true. Even if I commit
and close the index, open, delete, and close again, it still
hasDeletions() being true.

In previous lucene versions, there was something like expungeDeletes()
to actually delete the documents that I deleted.

How can I delete a document with my IndexWriter in a way that it is
really deleted and not just flagged as deleted?

Regards,
  Bernd

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


Re: IndexWriter deleteDocuments

Posted by Bernd Müller <be...@googlemail.com>.
sorry, user error... please discard the question ;-)

2013/1/30 Bernd Müller <be...@googlemail.com>:
> Hello,
>
> In my index, I have documents identified by a field with their unique
> identifier. Now, I tried to delete documents having such a unique
> identifier using deleteDocuments(Term t). If I test the IndexWriter
> for deletions with hasDeletions(), it tells me true. Even if I commit
> and close the index, open, delete, and close again, it still
> hasDeletions() being true.
>
> In previous lucene versions, there was something like expungeDeletes()
> to actually delete the documents that I deleted.
>
> How can I delete a document with my IndexWriter in a way that it is
> really deleted and not just flagged as deleted?
>
> Regards,
>   Bernd

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


Re: IndexWriter deleteDocuments

Posted by Michael McCandless <lu...@mikemccandless.com>.
Documents are still only "marked' as deleted.

expungeDeletes was renamed to forceMergeDeletes, but it's a horribly,
horribly costly operation.

Normal merging will collapse the deletes anyway, and the default merge
policy favors segments with more deletions ... so you shouldn't have
to force merge them away yourself.

Mike McCandless

http://blog.mikemccandless.com

On Wed, Jan 30, 2013 at 8:26 AM, Bernd Müller <be...@googlemail.com> wrote:
> Hello,
>
> In my index, I have documents identified by a field with their unique
> identifier. Now, I tried to delete documents having such a unique
> identifier using deleteDocuments(Term t). If I test the IndexWriter
> for deletions with hasDeletions(), it tells me true. Even if I commit
> and close the index, open, delete, and close again, it still
> hasDeletions() being true.
>
> In previous lucene versions, there was something like expungeDeletes()
> to actually delete the documents that I deleted.
>
> How can I delete a document with my IndexWriter in a way that it is
> really deleted and not just flagged as deleted?
>
> Regards,
>   Bernd
>
> ---------------------------------------------------------------------
> 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 deleteDocuments

Posted by wgggfiy <wu...@qq.com>.
it seems that a doc is really deleted until next index merge or something.
I'm not sure.



-----
--------------------------
Email: wuqiu.main@qq.com
--------------------------
--
View this message in context: http://lucene.472066.n3.nabble.com/IndexWriter-deleteDocuments-tp4037365p4037377.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