Skip to content

How to Fix macOS Spotlight Not Indexing

DodaTech Updated 2026-06-24 3 min read

In this tutorial, you'll learn about How to Fix macOS Spotlight Not Indexing. We cover key concepts, practical examples, and best practices.

The Problem

Spotlight search returns no results or only partial results:

No results found for "file i need"

Or:

Spotlight is still indexing. Results will appear when indexing is complete.

But the indexing never finishes. The Spotlight index is corrupted or stuck.

Quick Fix

Step 1: Check Spotlight privacy exclusions

  1. System Preferences > Spotlight > Search Privacy
  2. If your drive or folder is listed, select it and click -
  3. Wait 15 minutes for re-indexing to begin

Step 2: Rebuild the index via Terminal

sudo mdutil -E /

The -E flag erases the existing index and starts a fresh one. This affects the entire startup volume.

Step 3: Turn indexing off and on

sudo mdutil -i off /
sudo mdutil -E /
sudo mdutil -i on /

This stops, clears, and restarts indexing for the root volume.

Step 4: Check indexing status

mdutil -s /

Expected:

Indexing and searching enabled.
/ indexing enabled.

If it says "Indexing disabled," re-enable with sudo mdutil -i on /.

Step 5: Reset SPMetadata and Spotlight stores

sudo rm -rf /.Spotlight-V100
sudo rm -rf /System/Volumes/Data/.Spotlight-V100

These are the hidden index files. They are recreated automatically. Restart after deletion:

sudo mdutil -E /

Step 6: Remove and re-add folders to spotlight

# Add a folder to Spotlight's indexing list
sudo mdimport -i /Users/yourname/Documents

If specific folders are not indexed, this forces an immediate import.

Step 7: Verify file metadata is indexed

mdls ~/Documents/test.txt

If mdls returns no metadata attributes, the file is not indexed. Check that its parent folder is included in Spotlight's scope.

Step 8: Check for Time Machine interference

Time Machine backups can slow Spotlight indexing. Temporarily disable Time Machine:

sudo tmutil disable

Re-enable after indexing completes:

sudo tmutil enable

Step 9: Wait for initial indexing (new Mac)

First-time indexing on a new Mac with a large drive can take 24-48 hours. Ensure the Mac is plugged in and connected to Wi-Fi.

Prevention

  • Keep the startup drive at least 15% free for indexing to work efficiently.
  • Do not add the entire drive to the Privacy exclusion list.
  • Restart periodically to clear indexing stuck states.

Common Mistakes with spotlight not indexing

  1. Forgetting deriving (Show, Eq) on custom data types needed for debugging
  2. Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable
  3. Using head and tail instead of pattern matching, causing runtime errors on empty lists

These mistakes appear frequently in real-world MACOS code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### How long does Spotlight indexing take?

Depends on drive size and file count. A 256 GB drive with typical data takes 2-8 hours. A 1 TB drive with many files can take 24+ hours.

Can I index specific folders only?

Yes. In Spotlight > Search Privacy, add the drive, then remove specific folders you want indexed. Alternatively, add folders via mdimport -i /path.

Does Spotlight index external drives?

By default, no. Enable it via sudo mdutil -i on /Volumes/ExternalDriveName.

DodaTech Tool Reference

Doda Browser's Unified Search uses its own indexing engine alongside Spotlight, providing instant file search even when Spotlight is rebuilding.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro