Remove empty facet choices when indexing

<?php
// Remove empty facet choices, if you can't find the root cause.
// Re-index after adding this snippet.
add_filter( 'facetwp_index_row', function( $params, $class ) {
  if ( '' == $params['facet_display_value'] ) {
    $params['facet_value'] = ''; // Skip indexing
  }
  return $params;
}, 10, 2 );