File Search

The File Search tab provides a powerful, multi-criteria search across one or more SharePoint Online sites. It uses SharePoint's built-in KQL (Keyword Query Language) Search API for fast server-side filtering, and optionally applies a client-side regex filter for fine-grained matching.


How It Works

  1. The tool builds a KQL query from the filters you specify.
  2. The query is sent to the SharePoint Search REST API.
  3. Results are fetched in pages (auto-pagination) until all matching items are retrieved or the Max results limit is reached.
  4. If a Name regex is specified, a client-side regex filter is applied to the fetched results.
  5. Results are displayed in the UI and exported on demand.
⚠️ Note: SharePoint Search only indexes content that the crawl has processed. Newly uploaded files may not appear in results for up to 15–60 minutes depending on crawl schedules.

Filters

File Extensions

Enter one or more file extensions separated by spaces (no dots required):

docx pdf xlsx pptx

The tool translates this into KQL FileType clauses:

FileType:docx OR FileType:pdf OR FileType:xlsx OR FileType:pptx

Leave blank to search all file types.

Name / Regex

ModeBehavior
Plain textPassed to KQL as a Title: contains filter
RegexApplied client-side after the API response is received

Regex examples:

PatternMatches
^Budget_202[34]Files starting with Budget_2023 or Budget_2024
\.(bak|tmp)$Files ending with .bak or .tmp
(?i)invoiceFiles containing "invoice" (case-insensitive)

Date Filters

FilterKQL property
Created afterCreated>={date}
Created beforeCreated<={date}
Modified afterLastModifiedTime>={date}
Modified beforeLastModifiedTime<={date}

Author Filters

FilterKQL property
Created byAuthor:{loginName or display name}
Modified byEditor:{loginName or display name}

Library Path

Restrict the search to a specific library or folder using the Path: operator (prefix match):

/sites/HR/Shared Documents/Policies

Max Results

ValueBehavior
10 – 50,000Maximum number of results to fetch (auto-paginated)
⚠️ Note: Fetching large result sets (e.g., 50,000 items) takes time and may trigger SharePoint throttling. Use specific filters to narrow your query before raising the limit.

Version History Exclusion

SharePoint Search may index historical versions of files. These appear as paths containing /_vti_history/. SharePoint ToolBox automatically excludes these paths from results, ensuring that only the current (live) version of each file is returned.


Auto-Pagination

SharePoint's Search API returns a maximum of 500 items per request. The tool automatically issues additional requests, incrementing the start row, until all matching results have been fetched or the Max results limit is reached. No manual intervention is required.


Example Queries

Find all PDF files modified in 2024

Find files created by a specific user this month

Find all Excel files with "Budget" in the name, in a specific library


Output Formats

CSV

Semicolon-delimited, UTF-8 with BOM. Filename: FileSearch_<YYYYMMDD>.csv

Columns: Title, Path, FileType, Author, Editor, Created, LastModified, Size

HTML

Self-contained interactive file with real-time filter and sortable columns. Filename: FileSearch_<YYYYMMDD>.html


Tips

Tip: Start with a broad query and narrow it using the regex filter rather than relying entirely on KQL for complex patterns.

See Also