Here’s some code that creates a custom search in classic web part or wiki page. It will search all web parts only on the current page but regardless if the web parts are batched to show only so many at a time.
Use case: A custom list where I want users to only be able to view or search for entries where their name is in a field, but there are multiple people pickers it could apply to.
Set up custom list with permission to edit all items
Turn off “Allow items from the list to appear in search results”
Create a view that filters to only return items if their name is in a people picker. Example: Manager (field) is equal to [Me]