How to correct a view query?
Finally, I found how to do it. I don't understand why I got lots of errors previously.
 function sully_ad_import_views_query_alter(ViewExecutable $view, QueryPluginBase $query) {
if ($view-&gt;id() == 'document_list' &amp;&amp; in_array($view-&gt;current_display,array('block_1','block_3'))) {

  $query-&gt;addField(
    'taxonomy_term_field_data_media__field_standard_termref_1__node__field_categorie',
    'delta',
    'delta'
  );
  $query-&gt;addOrderBy(
    NULL,
    NULL,
    'asc',
    'delta'
  );

}

}