FacetWP – match beginning of word with autocomplete LIKE

<?php

// Add the following to your (child) theme's functions.php

add_filter( 'facetwp_wpdb_sql', function( $sql, facet ) {
    if ( 'annuaire_specialite' == $facet['name'] ) {
        $sql = str_replace( 'LIKE %', 'LIKE ', $sql );
    }
    return $sql;
}, 10, 2 );