Thanks.
> Date: Wed, 7 Oct 2009 00:05:43 +0200 > Subject: Re: Document loading > From: simon.willna...@googlemail.com > To: java-user@lucene.apache.org > > 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 > _________________________________________________________________ Hotmail: Powerful Free email with security by Microsoft. http://clk.atdmt.com/GBL/go/171222986/direct/01/