Indeed it isn't, in order to make file-level querying performant at all, you really need support for that at the filesystem level. Which is exactly what BFS, the BeOS filesystem had, and of course Haiku reimplements it:
https://www.haiku-os.org/docs/userguide/en/queries.htmlAs that page describes, the "query" command (or its equivalent GUI) can be used to write filesystem queries, e.g.:
query ((MAIL:from=="*joe*") && (MAIL:when>=%2 months%))