This is not a complete plugin, but a how-to. Want more, take a look at my WP Loop plugin. Search is in class-wp-loupe-search.php
Sample below:
- expects that you've created your own
search()
function, which returns an array with post id. (eg.: Eg.:[ [ 'id' => 1 ], [ 'id' => 2 ] ]
) - includes pagination
- tested (using WP Loop plugin) with Twenty Twenty-Four and Twenty Twenty-Five