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: Wed, 23 Dec 2009 10:51:10 +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  Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-6825@lists.php.net to get a copy of this message
Hi Stewart. Your solution would be to do the following. jQuery.getScript("js/search-index-" + getLanguage() + ".js", function(){ $('#headsearch-keywords').autocomplete(searchIndex, { matchContains: true, scrollHeight: 240, formatItem: function(item) { return item.name; } }).result( function(event, item){ $.post('score.php', {itemid: item.id, itemname: item.name}); } ); }); This will be stored in the database. That means when you're obtaining your information via javascript (initially) - You perform a "ORDER BY score DESC" so that the most popular scored results come first in the list. On Tue, Dec 22, 2009 at 4:04 PM, Stewart Lord <stewey@ambitious.ca> wrote: > On 22-Dec-09, at 6:38 AM, Paul Dragoonis wrote: > > Again, if you explain to me what you want to autocomplete, i can implement >> it for you. >> >> Cheers. >> Paul Dragoonis. >> > > > Hi Paul, > > We have autocomplete for search field on the prototype here: > > http://prototype.php.net/ > > The problem is that there is no sorting/scoring of results. It just shows > the first N matches. I can edit the original source to add this feature, but > I would prefer to leave that source unaltered and dynamically > overwrite/extend one of the existing functions using JavaScript. > > Please let me know if you see a way to do this. > > Thanks! > Stew > >

« previous php.webmaster (#6825) next »