Issue 7 in freebase-suggest: Add hooks for customising the way results are ordered and displayed

1 view
Skip to first unread message

codesite...@google.com

unread,
Aug 15, 2009, 6:03:05 AM8/15/09
to freebase...@googlegroups.com
Status: New
Owner: ----

New issue 7 by simonwillisonnet: Add hooks for customising the way results
are ordered and displayed
http://code.google.com/p/freebase-suggest/issues/detail?id=7

I want to use Freebase Suggest as a topic picker for my own site. As part
of this, I want to alter
its behaviour slightly - when showing a list of results, I would like to
move items that have
previously been used on my site to the top of the suggestions list and
visually highlight them
(with an asterisk).

My ideal way of doing this would be to include a JavaScript array of items
that have already been
used on my site (which will normally be somewhere between 1 and 100 items
long) on the page,
and then customise Freebase Suggest, intercepting the incoming list of
suggestions and
bumping any that match my hard-coded list of IDs up to the top.

To do this, I need customisation hooks that allow me to:

1. Intercept the results returned by freebase before they are rendered by
the widget
2. Modify the DOM elements used by Freebase Suggest to populate the
suggestion list, as they
are being created.

These hooks would be useful for much more than just my example here.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

codesite...@google.com

unread,
Aug 17, 2009, 1:14:52 PM8/17/09
to freebase...@googlegroups.com

Comment #1 on issue 7 by daepark: Add hooks for customising the way results

You should be able to accomplish this using the new freebase suggest which
is now
hosted on freebaselibs.com. The latest version:
http://freebaselibs.com/static/suggest/0.9.4/index.html

you can do something like:

var base = {
response: $.suggest.suggest.response
}

$.suggest("mysuggest", {

response: function(data) {

// you can modify the data here

// and call super.response

base.response.apply(this, [data]);

}

});

codesite...@google.com

unread,
Aug 17, 2009, 2:28:35 PM8/17/09
to freebase...@googlegroups.com
Updates:
Status: Accepted

Comment #2 on issue 7 by daepark: Add hooks for customising the way results

(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages