select2: disable case sensitive
<p>I am trying to configure select2 plugin. It is working fine at the moment but when i try to disable case sensitivity then i am not able to figure it out.</p>

<p>Below are the codes.</p>

<pre><code>&lt;script type="text/javascript"&gt;
var lastResults = [];

$("#tags").select2({
    multiple: true,
    tags: true,
    placeholder: "Please enter keywords",
    tokenSeparators: [',', ' '],//[","],
    initSelection : function (element, callback) {
        var data = [];
        $(element.val().split(",")).each(function () {
            data.push({id: this, text: this});
        });
        callback(data);
    },
    ajax: {
        multiple: true,
        url: "fetch_keywords.php",
        dataType: 'json',

       data: function(term,page) {
                        return {
                            term: term
                           };
                    },
                    results: function(data,page) {
                         lastResults = data;
                          return {results: data};

                    }, 
    },
    maximumSelectionSize: 3,
    minimumInputLength: 3,
    maximumInputLength: 30,                       

createSearchChoice: function(term) {

    var text = term + (lastResults.some(function(r) {

      return r.text == term
    }) ? "" : " (new)");

    return {
      id: term,
      text: text
    };
  },
});
</code></pre>

<p>I have checked this question <a href="https://stackoverflow.com/questions/30944275/select2-disable-case-sensitive-matches">select2: Disable case-sensitive matches</a> but i am not sure how can i use the same in my code.</p>

<p>If user entered <strong>test</strong> then it will return the match from database but if user enter <strong>Test</strong> then it create a new tag.</p>

<p>Thanks </p>