I'm not sure there is much work here, depending on how the implementation goes, but there is some risk that in order to compute the rank for a $search pipeline we will need to generate this pipeline:
db.example.aggregate([
{$search: {/* query*}},
{$sort: {score: {$meta: "searchScore"}}},
{$_internalSetWindowFields: {output: {rank: {$rank: {}}}}
])
The second $sort doesn't do anything. It might be generated as part of $rankFusion's desugaring, since we need to specify a sortBy to $setWindowFields in order to compute the rank. Note that SERVER-91281 might mean that we don't need to generate this kind of pipeline, in which case this ticket is more of a no-op and can be tracked on the backlog as a request to optimize out a $sort in this scenario, if it comes up for a user who is using $setWindowFields.