Even though extending your custom search would be the proper WP way to solve your problem, the answer to your workaround question would be the below function:
function change_content_on_save($post_id, $post, $update) {
if ($_SERVER['REQUEST_METHOD'] !== 'POST' || empty($_POST))
return;
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
return;
if (!current_user_can('edit_post', $post_id))
return;
// create your terms list and insert to content here:
$post->post_content = $terms_list;
// Delete hook to avoid endless loop
remove_action('save_post', 'change_content_on_save', 10);
wp_update_post($post);
}
add_action( 'save_post', 'change_content_on_save', 10, 3 );
save_post
is an action triggered whenever a post or page is created or updated
https://developer.wordpress.org/reference/hooks/save_post/