solr/example/files/conf/velocity/js/jquery.autocomplete.js
function autoFill(q, sValue){
    // autofill in the complete box w/the first match as long as the user hasn't entered in more data
    // if the last user key pressed was backspace, don't autofill
    if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
      // fill in the value (keep the case the user has typed)
      $input.val($input.val() + sValue.substring(lastWord(previousValue).length));
      // select the portion of the value not typed by the user (so the next character will erase)
      $.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length);
    }
  }
function autoFill(q, sValue){
    // autofill in the complete box w/the first match as long as the user hasn't entered in more data
    // if the last user key pressed was backspace, don't autofill
    if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
      // fill in the value (keep the case the user has typed)
      $input.val($input.val() + sValue.substring(lastWord(previousValue).length));
      // select the portion of the value not typed by the user (so the next character will erase)
      $.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length);
    }
  }
function autoFill ( q , sValue ) { // autofill in the complete box w/the first match as long as the user hasn't entered in more data // if the last user key pressed was backspace, don't autofill if ( options . autoFill && ( lastWord ( $input . val ( ) ) . toLowerCase ( ) == q . toLowerCase ( ) ) && lastKeyPressCode != KEY . BACKSPACE ) { // fill in the value (keep the case the user has typed) $input . val ( $input . val ( ) + sValue . substring ( lastWord ( previousValue ) . length ) ) ; // select the portion of the value not typed by the user (so the next character will erase) $ . Autocompleter . Selection ( input , previousValue . length , previousValue . length + sValue . length ) ; } }
fills in the input box w/the first match (assumed to be the best match) q: the term entered sValue: the first matching result
fills in the input box w / the first match ( assumed to be the best match ) q : the term entered sValue : the first matching result