title: Log informations from typeahead search input
body: <p>I created a typeahead search field in my meteor app using <code>sergeyt:typeahead</code>. </p>
  
  <p>Now I want to log all search requests to know which informations are missing in my database. The thing is, that the users maybe won't press enter. Because of the typeahead-function the user will type some characters and if there is no result, they maybe abort typing. Some of the users will delete the input to try another keyword. I would like to get those informations, if it is technically possible.</p>
  
  <p>So first of all I have to check how many results typeahead gives me, but I don't know where to get this information.</p>
  
  <p>This is my code so far:</p>
  
  <pre><code>Template.search.helpers({
      searchData: function() {
          return [
              {
                  name: 'cat1',
                  valueKey: 'title',
                  displayKey: 'title',
                  header: '&lt;h3 class="category-name"&gt;Category 1&lt;/h3&gt;',
                  template: 'searchResults',
                  local: function() { return Collection.find().fetch(); }
              }
          ]
      },
      selected: function(event, suggestion) {
          if (Router.routes[suggestion.type] === void 0) {
              console.warn('Route not found');
              return;
          }
          else Router.go(suggestion.type, { _id : suggestion.id });
      }
  });
  </code></pre>
  
  <p>I would start with a event for that template:</p>
  
  <pre><code>Template.search.events({
      'submit form': function(event, template) {
          event.preventDefault();
          var newElement = template.firstNode.children[0][1].value;
          Log.insert({ title: newElement, missing: true });
      },
      'keyup input': function(event, template) {
          var keyword = event.target.value;
          Log.insert({ title: keyword });
      }
  });
  </code></pre>
  
  <ol>
  <li><p>submit-event: So if the user presses enter, the keyword will be saved to the collection. But this is quite bad, because this should just happen if there is no typeahead-result, as the user can select a suggestion and then press the enter key to go for that result, but with my code this would be overwritten...</p></li>
  <li><p>keyup-event: Problem with this is, that every key-event will be tracked. For typing 'just searching', there would be 14 inserts to the collection. That's not what I want. If I'm using the change event, the input has to get a blur and that's also not what I need.</p></li>
  </ol>
  
  <p>So this seems to me not to be the best way.</p>
  
  <p>Maybe it is possible to use the custom events of typeahead.js, like <code>typeahead:render</code>. </p>