When it comes to searching the WordPress database, there’s probably no better API than WP_Query. That doesn’t mean it’s not without it’s limitations, though (only which will be improved over time, I’m sure).
For example, consider the case where you have two types of meta data that are completely unrelated and you need to run a search for both of them. Essentially, you have WP_Query and multiple meta keys that you need in order to search for information from this database.
In this specific case, I’m not talking about a single piece of meta data that has multiple keys and that would support and AND
or and OR
clause.
Instead, I’m talking about the idea of having multiple meta keys each of which are associated with a given post, but must all be searched in order to find the posts that have the data associated with it.
In more technical terms, I’m looking for the intersection of post IDs all of which share a common set of multiple, unrelated meta keys.