Rerank specified Items

Normally, LiftIgniter picks the top items to recommend from the entire pool of items. Sometimes you may want to restrict the items to re-rank to a specified list (e.g. picked by an editor). That can be specified in the register function as a special itemsToRank field as below:

$p('register', {
                 max: 5,
                 widget: 'default-widget',
                 opts: {itemsToRank: ["list","of","items"]},
                 callback: function(resp) {
                   console.log(JSON.stringify(resp, null, 2));
                 }
               }
);

$p('fetch');

Note that we will return only those items within this list that match with our existing inventory. If, for some reason, you want to have us try and rank items including ones that are not in our inventory, you can set useInventory to false in the options.

$p('register', {
                 max: 5,
                 widget: 'default-widget',
                 opts: {itemsToRank: ["list","of","items"], "useInventory": "false"},
                 callback: function(resp) {
                   console.log(JSON.stringify(resp, null, 2));
                 }
               }
);

$p('fetch');

Reducing query URL by using a prefix

If the number of items you wish to rank is very large, the GET query that gets sent to our servers can get extremely long. As a rule of thumb, if the number of items you wish to rank exceeds 25, you are likely to hit query size limits.

We offer a solution to this problem by allowing you to specify a common prefix to prepend to all the items to rank. Explicitly, let's say all your items have http://dummydomain.com/articles/ in the beginning. Then, instead of sending:

$p('register', {
                 max: 5,
                 widget: 'default-widget',
                 opts: {itemsToRank: ["http://www.dummydomain.com/articles/a","http://www.dummydomain.com/articles/b","http://www.dummydomain.com/articles/c"]},
                 callback: function(resp) {
                   console.log(JSON.stringify(resp, null, 2));
                 }
               }
);

$p('fetch');

you can send:

$p('register', {
                 max: 5,
                 widget: 'default-widget',
                 opts: {itemsToRankPrefix: "http://www.dummydomain.com/articles/", itemsToRank: ["a","b","c"]},
                 callback: function(resp) {
                   console.log(JSON.stringify(resp, null, 2));
                 }
               }
);

$p('fetch');