Autocomplete search with link on Name

I want to click on name in search box and open profile of that person. How can I add link on this item.firstname. My route for user profile is ‘/users/{id}’..

this is my javascript code for autocomplete

<script type="text/javascript">
        $('.livesearch').select2({
            placeholder: 'Search users',
            ajax: {
                url: '/master/autocomplete',
                dataType: 'json',
                delay: 250,
                processResults: function (data) {
                    return {
                        results: $.map(data, function (item) {
                            return {
                                text: item.firstname+' '+item.lastname,
                                id: item.id,

                            }
                        })
                    };
                },
                cache: true,
            }
        });
    </script>

enter image description here