Reputation: 37
I am trying to created a servlet that uses Lucene. How would I display the results from indexSearcher as a list of document names or path names? It used to be in the older versions, you could just do searcher.getDocument(scoreDoc) to get a document which you can get then get names or pathnames from with document.get(string). The new version has gotten rid of getDocument and I am not really sure how to change scoreDocs or topDocs into documents so I can fetch relevant information.
Thanks!
Upvotes: 0
Views: 50
Reputation: 5974
It's searcher.doc(int scoreDoc)
. This method returns the Document
instance where you can call get
to obtain the stored value.
Upvotes: 1