ActivityPub is not well suited for this application. It's for publishing activities made by actors — hence the name. You'll want to invent your own federation protocol specifically for federated search.
Even so you could base it on activitypub I suspect. It would need to be extended for sure to implement the sorts of things believe would be required.