FileSearchResult: {
    contentType: string;
    customMetadata?: Record<string, string>;
    excerpt?: string;
    lastModified: Date;
    matchInFilename?: boolean;
    name: string;
    objectId?: string;
    path: string;
    providerData?: Record<string, any>;
    relevance?: number;
    size: number;
}

Represents a single search result from a file storage provider. Combines file metadata with search-specific information like relevance and excerpts.

Type declaration

  • contentType: string

    MIME type of the file.

  • Optional customMetadata?: Record<string, string>

    Custom metadata associated with the file.

  • Optional excerpt?: string

    Text excerpt showing the search term in context (for content searches). May contain HTML highlighting tags from the provider. Undefined if content search was not performed or no match in content.

  • lastModified: Date

    When the file was last modified.

  • Optional matchInFilename?: boolean

    Whether the match was found in the filename (true) or content (false). Undefined if this information is not available from the provider.

  • name: string

    Filename without the directory path.

  • Optional objectId?: string

    Provider-specific object ID that can be used for direct access. This ID can be passed to GetObject/GetMetadata to bypass path resolution. Examples: Box file ID, Google Drive file ID, SharePoint item ID, Dropbox id. Provides significant performance improvement by avoiding path traversal.

  • path: string

    Full path to the file including directory and filename.

  • Optional providerData?: Record<string, any>

    Provider-specific additional data. Example: Google Drive file ID, SharePoint list item ID, etc.

  • Optional relevance?: number

    Relevance score from the search provider (0.0 to 1.0). Higher scores indicate better matches. May be undefined if provider doesn't return relevance scores.

  • size: number

    File size in bytes.