Hi, a call to IndexSearcher.doc(docId) will load the document. Internally this call forwards to IndexReader.document(docId) which could be very expensive because this method will load all stored document fields.
I would recommend to have a look at IndexSearcher.doc(docId, FieldSelector). This method offers you way more control over field loading costs. With the FieldSelector you can directly load fields, do lazy loading or stop the loading process once a certain field was loaded. If you do not load a field due to the fieldSelector a call to Document.get("fieldname") will return null. Simon On Tue, Oct 6, 2009 at 2:38 PM, Dragon Fly <dragon-fly...@hotmail.com> wrote: > > Hi, > > Which of the following method actually loads the document from disk? > > (1) Document document = searcher.doc (docId); > > OR > > (2) string value = document.get ("FirstNameField"); > > It's probably searcher.doc but I just want to be sure.  Thank you. > _________________________________________________________________ > Hotmail: Trusted email with Microsoft’s powerful SPAM protection. > http://clk.atdmt.com/GBL/go/177141664/direct/01/ --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org