Lucene.Net.Search.Searcher.Doc C# (CSharp) Method

Doc() public abstract method

public abstract Doc ( int i ) : Lucene.Net.Documents.Document
i int
return Lucene.Net.Documents.Document
		public abstract Document Doc(int i);
	    public abstract Document Doc(int docid, FieldSelector fieldSelector);

Same methods

Searcher::Doc ( int docid, FieldSelector fieldSelector ) : Lucene.Net.Documents.Document

Usage Example

コード例 #1
0
ファイル: Hits.cs プロジェクト: ArsenShnurkov/beagle-1
        /// <summary>Returns the stored fields of the n<sup>th</sup> document in this set.
        /// <p>Documents are cached, so that repeated requests for the same element may
        /// return the same Document object. If the fieldselector is changed, then the new
        /// fields will not be loaded.
        /// </summary>
        public Document Doc(int n, FieldSelector fieldSelector)
        {
            HitDoc hitDoc = HitDoc(n);

            // Update LRU cache of documents
            Remove(hitDoc);             // remove from list, if there
            AddToFront(hitDoc);         // add to front of list
            if (numDocs > maxDocs)
            {
                // if cache is full
                HitDoc oldLast = last;
                Remove(last);                 // flush last
                oldLast.doc = null;           // let doc get gc'd
            }

            if (hitDoc.doc == null)
            {
                if (fieldSelector == null)
                {
                    hitDoc.doc = searcher.Doc(hitDoc.id);                     // cache miss: read document
                }
                else
                {
                    hitDoc.doc = searcher.Doc(hitDoc.id, fieldSelector);                     // cache miss: read document
                }
            }

            return(hitDoc.doc);
        }
All Usage Examples Of Lucene.Net.Search.Searcher::Doc