lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henok sahilu <>
Subject Re: Doc IDs via IndexReader?
Date Tue, 28 Jul 2009 11:31:31 GMT
i had the same problem.
then i used TopDocs calss.
it will give the first n top documets. and you can play around

--- On Wed, 7/22/09, Anuj Bhatt <> wrote:

From: Anuj Bhatt <>
Subject: Doc IDs via IndexReader?
Date: Wednesday, July 22, 2009, 7:58 PM


I'm relatively new to Lucene. I have the following case: I have
indexed a bunch of documents. I then, query the index using
IndexSearcher and retrieve the documents using Hits (I do know this is
deprecated -- I'm using v 2.4.1). So, I do this for a set of queries
and maintain which documents are returned to each one. In the end of
it all, I have a list of documents maintained (more specifically, the associated with the doc). Now, I wish to
delete the documents which have not been returned for any query, from
the index. How can I do this?

My initial assumption was that I could retrieve all the doc ids from
IndexReader and just traverse the list that I have maintained, if it
is in the list, I don't delete it otherwise I do. Looking around
didn't yield anything, and hence the mail.

Any suggestions?


To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message