Method Document
Document(Int64, StoredFieldVisitor)
Expert: visits the fields of a stored document, for
custom processing/loading of each field. If you
simply want to load all fields, use
Declaration
public abstract void Document(long docID, StoredFieldVisitor visitor)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | docID | |
StoredFieldVisitor | visitor |
Document(Int64)
Returns the stored fields of the n
th
Document in this index. This is just
sugar for using DocumentStoredFieldVisitor.
NOTE: for performance reasons, this method does not check if the requested document is deleted, and therefore asking for a deleted document may yield unspecified results. Usually this is not required, however you can test if the doc is deleted by checking the IBits returned from GetLiveDocs(IndexReader).
NOTE: only the content of a field is returned, if that field was stored during indexing. Metadata like boost, omitNorm, IndexOptions, tokenized, etc., are not preserved.
Declaration
public Document Document(long docID)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | docID |
Returns
Type | Description |
---|---|
Document |
Document(Int64, ISet<String>)
Like Document(Int64) but only loads the specified fields. Note that this is simply sugar for DocumentStoredFieldVisitor(ISet<String>).
Declaration
public Document Document(long docID, ISet<string> fieldsToLoad)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | docID | |
ISet<System.String> | fieldsToLoad |
Returns
Type | Description |
---|---|
Document |