title: Select2: Extend matcher for tag data
body: <p>I use <a href="http://ivaynberg.github.com/select2/" rel="nofollow">Select2</a> for tagging purposes. It works like a charm, but i have an additional requirement: <strong>The matcher should match more than only the text of the items.</strong></p>
  
  <p>Let me explain. The <code>matcher</code> function takes two parameters, <code>term</code> and <code>text</code>. This allows us to compare the given tags and the entered text. But if i define additional data for each tag (via the <code>tags</code> function) i am unable to access it in the matcher.</p>
  
  <p>Example code:</p>
  
  <pre><code>// #myinput is a hidden input field
  $('#myinput').select2({
    matcher: function(term, text) {
        return text.toUpperCase().indexOf(term.toUpperCase()) &gt;= 0;
    },
    tags: function() {
        var tags = [];
        $('#myselect').find('option').each(function(index, option) {
            option = $(option);
            tags.push({
                id: option.val(),
                text: option.text(),
                category: option.data('category')
            });
        });
        return tags;
    }
  })
  </code></pre>
  
  <p>I set the mandatory <code>id</code> and <code>text</code> properties for each tag. In addition, there is a string named <code>category</code>. I want to match against the text and the category instead of only the text.</p>
  
  <p>Is that possible?</p>