This was taken from TCoSolvingMacProblems. by Joe Kissel
If it works I don't want a upvote.
If that happens, try each of these steps in order until the problem goes away:
1. Make sure that neither the folder ~/Library/Mail nor any of its parent folders is in Spotlight’s Privacy list (Ventura or later: System Settings > Siri & Spotlight > Spotlight Privacy; Big Sur or Monterey: System Preferences > Spotlight > Privacy).
2. You may have mailboxes whose contents have not yet been downloaded to your Mac. To ensure that they have been, choose Mail > Mailbox > Synchronize > “Account Name” (which may take some time).
3. Force Mail to rebuild its envelope index—that is, its internal metadata index:
a. Quit Mail.
b. In the Finder, navigate to ~/Library/Mail/Vx/MailData, where Vx varies by operating system (Ventura or later: V10, Monterey: V9; Big Sur: V8).
c. Drag the files Envelope Index, Envelope Index-shm, and Envelope Index-wal to the Trash.
d. Open Mail again. It will say you need to “import” all your messages again, which is Mail’s way of saying it needs to rebuild its index. This process should take only a few minutes.
4. Open Terminal (in /Applications/Utilities) and enter this command, followed by Return, to re-import your Mail messages into the Spotlight index:
mdimport -r/System/Library/Spotlight/Mail.mdimporter