title: select2 filter local JSON data results with query term
body: <p>I am implementing select2 version 3.5.0. I am using the following jQuery inside my document ready function:</p>
  
  <pre><code>jQuery.getJSON('/rest/call/to/retrieve/JSON').done(
    function( data ) {
       jQuery('#byProductName').select2({
           placeholder: 'Type any portion of a single product name...',
           allowClear: true,
           minimumInputLength: 0,
           multiple: true,
           id: function(data){ return data.product; },
           data: data,
           formatResult: function(data){ return data.product; },
           formatSelection: function(data){ return data.product; },
       });
    }
  );
  </code></pre>
  
  <p>HTML hidden input element:</p>
  
  <pre><code>&lt;div id='freeForm'&gt;
      &lt;input name='Search Products' type='hidden' id='byProductName'&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JSON result:</p>
  
  <pre><code>[{"product":""},{"product":" windows"},{"product":" mac"},
   {"product":" linux"},{"product":" RHEL"},{"product":"Test product list"}]
  </code></pre>
  
  <p>The drop down populates my values correctly and I can select multiple items and remove them successfully. However, when I type a string in the input field to filter the result set, it does not filter. </p>
  
  <p>I have tried altering data: to the following:</p>
  
  <pre><code>data: function (data, term){
      return { 
          results: data,
          query: term }
      },
  </code></pre>
  
  <p>but get this error once I click the drop down:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'length' of undefined - select2 line 1784
  </code></pre>
  
  <p>How do I filter the result list successfully with a query term?</p>