FoundDocument class

FoundDocument class

Represents a found document.

Learn more:

The FoundDocument type exposes the following members:

Methods

Method Description
deserialize Deserializes a FoundDocument instance from a byte array.
serialize Serializes the current instance to a byte array.
to_string Returns a string representation of the found document.

Properties

Property Description
attributes The attributes associated with the found document. The corresponding option must be enabled in the search options to retrieve attributes.
document_info The document info.
found_fields The document fields found.
occurrence_count The number of occurrences found.
relevance The relevance of search result.
term_sequences The term sequences found.
terms The terms found; the value is evaluated each time the property is accessed.

Example

from groupdocs.search import Index

index = Index("./index")
index.add("./documents")
result = index.search("contract")
for found in result:  # FoundDocument
    print(found.document_info.file_path, found.occurrence_count, found.relevance)
    print("fields:", [f.field_name for f in found.found_fields])

See Also