The Mac Messages app in Sonoma added filtering capability.
In macOS Sonoma, Apple has improved the search function in its stock Messages app for Mac, which now allows you to combine search queries and narrow down results to quickly find the messages that you're looking for. This article explains how it works. Previously in macOS, you could type a word...
www.macrumors.com
You might find more info in the Messages User Guide:
In Messages on your Mac, search to find the exact conversation you need by selecting from various suggestions or typing specific text.
support.apple.com
I don't use Messages.app on any Macs, so I can't provide steps.
My search terms that yielded those 2 pages were: mac messages search filters
Another option might be a Spotlight search for a particular person and day, limited to Messages content.