How can I conditionally alter search API relevance score?
Since everyone was telling me to solve this during the query, I decided to have another look at this approach. My main issue was not being able to order by the flagged status, which was eventually solved with an expression. 

In the end I managed to get what I wanted with an implementation of hook_search_api_db_query_alter.

function mymodule_search_api_db_query_alter(SelectQueryInterface &amp;$db_query, SearchApiQueryInterface $query) {
  global $user;
  $uid = $user-&gt;uid;

  // Left join indexed flag table into search index.
  $db_query-&gt;leftJoin('search_api_db_product_index_field_my_flag_field', 'flag', 'flag.item_id = t.item_id');
  // Set a value of 1 for entities flagged by the given uid, 0 otherwise. 
  $alias = $db_query-&gt;addExpression('CASE WHEN flag.value = :uid THEN 1 ELSE 0 END', 'flagged', array(':uid' =&gt; $uid));
  // Order by the flagged value (1 or 0), highest first.
  $db_query-&gt;orderBy($alias, 'DESC');
}