hey
i had the same problem.
then i used TopDocs calss.
it will give the first n top documets. and you can play around
cheers


--- On Wed, 7/22/09, Anuj Bhatt <anuj.bh...@gmail.com> wrote:

From: Anuj Bhatt <anuj.bh...@gmail.com>
Subject: Doc IDs via IndexReader?
To: java-user@lucene.apache.org
Date: Wednesday, July 22, 2009, 7:58 PM

Hi,

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
hits.id(some_iterator_int) 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?


Regards,
Anuj

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




      

Reply via email to