We have integrated custom search results into Discourse in the past (Algolia and Coveo).
It would be an Enterprise plan type of thing, given the complexity. If you’d like to discuss, shoot off an email to team@discourse.org. The more details we have about your specific integration needs, the better we’ll be able to help you.