ArchiveOrangemail archive

java-user.lucene.apache.org


(List home) (Recent threads) (34 other Apache Lucene lists)

Subscription Options

  • RSS or Atom: Read-only subscription using a browser or aggregator. This is the recommended way if you don't need to send messages to the list. You can learn more about feed syndication and clients here.
  • Conventional: All messages are delivered to your mail address, and you can reply. To subscribe, send an email to the list's subscribe address with "subscribe" in the subject line, or visit the list's homepage here.
  • Moderate traffic list: up to 30 messages per day
  • This list contains about 41,902 messages, beginning Mar 2005
  • 9 messages added yesterday
Report the Spam
This button sends a spam report to the moderator. Please use it sparingly. For other removal requests, read this.
Are you sure? yes no

IndexReader.deleteDocument(Term) in Lucene 3.6/4.0

Ad
Nikolay Zamosenchuk 1337949948Fri, 25 May 2012 12:45:48 +0000 (UTC)
Hi everyone. We are using IndexReader.deleteDocument(Term) method to
delete documents, since it returns the number of deleted documents.
This is used to be sure that some docs were removed. We must know for
sure if documents were deleted. But in lucene 3.6 this method is final
and can't be overridden in our codebase anymore. Method
IndexWriter.deleteDocument(..) is not final and possibly can be used
in our project, but doesn't return any value so we can't be sure
whether ant documents were deleted. So briefly
IndexReader.deleteDocument(Term) is a final but returns number of
deletions performed and IndexWriter.deleteDocument(..) is not final,
but doesn't return any result. Our functionality requires overriding
and result value.

Can anyone please suggest how to solve this issue? Can simply run term
query before, but it seems to be absolutely inefficient.-- 
Best regards, Nikolay Zamosenchuk
Simon Willnauer 1337950825Fri, 25 May 2012 13:00:25 +0000 (UTC)
hey,On Fri, May 25, 2012 at 2:45 PM, Nikolay Zamosenchuk
 wrote:
> Hi everyone. We are using IndexReader.deleteDocument(Term) method to
> delete documents, since it returns the number of deleted documents.
> This is used to be sure that some docs were removed. We must know for
> sure if documents were deleted. But in lucene 3.6 this method is final
> and can't be overridden in our codebase anymore. Method
> IndexWriter.deleteDocument(..) is not final and possibly can be used
> in our project, but doesn't return any value so we can't be sure
> whether ant documents were deleted. So briefly
> IndexReader.deleteDocument(Term) is a final but returns number of
> deletions performed and IndexWriter.deleteDocument(..) is not final,
> but doesn't return any result. Our functionality requires overriding
> and result value.
>
> Can anyone please suggest how to solve this issue? Can simply run term
> query before, but it seems to be absolutely inefficient.what you can do is use IndexReader#docFreq(Term) to figure out
documents that have been deleted / will be deleted by you delete term

simon>
> --
> Best regards, Nikolay Zamosenchuk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> For additional commands, e-mail: 
>
Uwe Schindler 1337950924Fri, 25 May 2012 13:02:04 +0000 (UTC)
To change the behaviour of IndexReaders use FilterIndexReader, don't
subclass IndexReader's directly.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.deeMail: 


> -----Original Message-----
> From: Nikolay Zamosenchuk 
> Sent: Friday, May 25, 2012 2:45 PM
> To: 
> Subject: IndexReader.deleteDocument(Term) in Lucene 3.6/4.0
> 
> Hi everyone. We are using IndexReader.deleteDocument(Term) method to
> delete documents, since it returns the number of deleted documents.
> This is used to be sure that some docs were removed. We must know for sureif
> documents were deleted. But in lucene 3.6 this method is final and can't
be> overridden in our codebase anymore. Method
> IndexWriter.deleteDocument(..) is not final and possibly can be used inour> project, but doesn't return any value so we can't be sure whether ant
> documents were deleted. So briefly
> IndexReader.deleteDocument(Term) is a final but returns number ofdeletions
> performed and IndexWriter.deleteDocument(..) is not final, but doesn't
return> any result. Our functionality requires overriding and result value.
> 
> Can anyone please suggest how to solve this issue? Can simply run termquery> before, but it seems to be absolutely inefficient.
> 
> --
> Best regards, Nikolay Zamosenchuk
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> For additional commands, e-mail: 
Home | About | Privacy