Re: svn: /web/php/branches/PROTOTYPE_2010/ css/structure.css css/theme.css index.html js/common.js js/jquery.autocomplete.pack.js
js/search-index-en.js

From: Date: Thu, 24 Dec 2009 06:53:30 +0000
Subject: Re: svn: /web/php/branches/PROTOTYPE_2010/ css/structure.css css/theme.css index.html js/common.js js/jquery.autocomplete.pack.js
js/search-index-en.js
References: 1 2 3 4 5 6 7 8  Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-6834@lists.php.net to get a copy of this message
On 23-Dec-09, at 12:30 PM, Paul Dragoonis wrote:
I see that you're now trying to do it client-side. I thought we were doing some server side stuff too.
That was the original plan, but Hannes suggested sending the whole index to the client and it looks to be a winning strategy. It makes the autocomplete very snappy.
Can you show me your source code, or point me to the file/line in the repository code that performs the client-side scoring. If you have existing source, I can see more thoroughly what you're trying to do and then modify the jquery plugins API.
The source code is check into SVN here: http://svn.php.net/repository/web/php/branches/PROTOTYPE_2010/ The scoring logic basically comes down to this (in PHP): if (($pos = stripos($result, $query)) !== false) {
    $score = 100 - ($pos * 2) - (strlen($result) - strlen($query));
} Where $query is what the user typed, and $result is the current match we're scoring. It hasn't been converted to JavaScript yet, but as you can see it's quite short. Thanks Paul! Let me know if you have any questions. Cheers, Stew

« previous php.webmaster (#6834) next »