©2011 Google -
Code Home -
Site Terms of Service -
Privacy Policy -
Site Directory
Google Code offered in:
English -
Español -
日本語 -
한국어 -
Português -
Pусский -
中文(简体) -
中文(繁體)
The google.pers.ranking
namespace contains methods for using
the ranking engine.
Methods in this namespace let you create rankable items,
change how an attribute affects ranking,
and make requests to sort items.
See also: Personalization API Developer Guide, RankableItem
<static>
object
createProfile(applicationName)
<static>
RankableItem
createRankableItem()
<static>
modifyAttributeAlgorithm(name, algorithm)
<static>
modifyAttributeWeight(name, weight)
<static>
Array<RankableItem>, contentItems
rankAllItems(profile, items, maxItemsPerSource)
<static>
Array<RankableItem>, contentItems
rankItemsForDataSource(profile, items, dataSourceId)
<static> object createProfile(applicationName)
var profile = google.pers.ranking.createProfile("MyGadget");
string applicationName
- The name of the application
that the profile represents;
used to identify the profile
object
The profile
<static> RankableItem createRankableItem()
var rankItem = google.pers.ranking.createRankableItem();
RankableItem
A rankable item
<static> modifyAttributeAlgorithm(name, algorithm)
google.pers.ranking.modifyAttributeAlgorithm(
"NumberOfClicks",
contentRankingAlgorithm.DirectlyProportional | contentRankingAlgorithm.MostSteep);
See also: Changing an attribute's algorithm
string name
- The name of the attribute, such as "LastClickedTime"
integer algorithm
- A combination of
contentRankingAlgorithm
constants
<static> modifyAttributeWeight(name, weight)
The higher an attribute's weight is (compared to other attributes' weights) the more that attribute's score affects the ranking. To ignore an attribute, set its weight to 0.0.
See also: Changing an attribute's weight
string name
- The name of the attribute, such as "LastClickedTime"
float weight
- The new weight of the attribute
<static> Array<RankableItem>, contentItems rankAllItems(profile, items, maxItemsPerSource)
object profile
- An object (returned by
createProfile()
)
that identifies this gadget
Array<RankableItem>, contentItems items
- The items to be sorted
integer maxItemsPerSource
- The maximum number of items to display per data source
Array<RankableItem>, contentItems
A newly sorted array of items
<static> Array<RankableItem>, contentItems rankItemsForDataSource(profile, items, dataSourceId)
object profile
- An object (returned by
createProfile()
)
that identifies this gadget
Array<RankableItem>, contentItems items
- An array of items
integer dataSourceId
- The data source associated with
all the items to be sorted
Array<RankableItem>, contentItems
A newly sorted array of items