You can do all of that in a single SQL query, with pgml.embed() and then pgml.train() a custom reranker with xgboost, to pgml.predict() the conversion score of a search result based on click-through-rate, or other objective.
If you'd like free hosting, feel free to reach out. I'm one of the founders at postgresml.org.
If you'd like free hosting, feel free to reach out. I'm one of the founders at postgresml.org.