title: Twitter Typeahead.js how to return all matched elements within a string
body: <p>By default twitter typeahead.js returns only elements matched in the begining of a string, for example:</p>
  
  <p>source: ['type','typeahead','ahead']</p>
  
  <p>query: 'type'</p>
  
  <p>returns: 'type' and 'typeahead'</p>
  
  <p>--</p>
  
  <p>query: 'ahead'</p>
  
  <p>returns: 'ahead'</p>
  
  <p>I want it to return 'ahead' and 'typeahead'</p>
  
  <p>my code:</p>
  
  <pre><code>var clients = new Bloodhound({
      datumTokenizer: function(d) { return Bloodhound.tokenizers.whitespace(d.value); },
      queryTokenizer: Bloodhound.tokenizers.whitespace,
      limit: 10,
      prefetch: {
          url: '/clients.json',
          filter: function(list) {
              return $.map(list, function(value) { return { name: value }; });
          }
      }
  });
  
  clients.initialize();
  
  $('.client').typeahead(null, {
      displayKey: 'value',
      source: clients.ttAdapter(),
      minLength: 1,
  });
  </code></pre>
  
  <p>There is already a question about it but i didnt understand the answer.</p>