def METHOD_NAME(value: float):
    """
    Adjusts pg_trgm.similarity_threshold for the % operator.
    Ideally we would use directly similarity() in the search, but that doesn't seem
    to use index, while using % does.
    """
    if not using_postgresql():
        return
    current_similarity = getattr(connection, "weblate_similarity", -1)
    # Ignore small differences
    if abs(current_similarity - value) < 0.05:
        return
    with connection.cursor() as cursor:
        # The SELECT has to be executed first as othervise the trgm extension
        # might not yet be loaded and GUC setting not possible.
        if current_similarity == -1:
            cursor.execute("SELECT show_limit()")
        # Adjust threshold
        cursor.execute("SELECT set_limit(%s)", [value])
        connection.weblate_similarity = value