I have an application where I would like to pick one document from somewhere in the list of search results. For example, I would like to retrieve one of the results at rank 57, another at rank 1223, etc. I'm not real clear on how to do it.

I have seen some things on simulating pagination with Lucene, some code on using hitlists and some comments on hitlists being deprecated.

I have seen the class TopDocsCollector and the method
|*topDocs <http://lucene.apache.org/java/2_9_3/api/core/org/apache/lucene/search/TopDocsCollector.html#topDocs%28int,%20int%29>*(int start, int howMany)|
          Returns the documents in the rage [start ..

I can see using topDocs with howMany = 1, but I'm wondering whether that means that the system iterates over the entire return list until it finds the the one at rank start?

Is this the best way to do it?

I'm using pyLucene 2.9 on Ubuntu 10.04.

Thanks for any pointers.

Reply via email to