function recommender_top_similarity in Recommender API 6.2
Same name and namespace in other branches
- 6.3 recommender.module \recommender_top_similarity()
- 7.3 recommender.module \recommender_top_similarity()
- 7.4 recommender.module \recommender_top_similarity()
Return a list of items that are top similar with $id
Parameters
$app_name The $app_name for the depending modules:
$id usually the $node_id of the target item.:
$top_n how many similar items to return:
$test_func optional function to test whether an item satisfy some conditions:
Return value
an array of the most similar items to $id.
File
- ./
recommender.module, line 145
Code
function recommender_top_similarity($app_name, $id, $top_n, $test_func = NULL) {
// create a null recommender to access the topSimilarity() function.
$recommender = new Recommender($app_name, NULL, NULL, NULL, NULL);
return $recommender
->topSimilarity($id, $top_n, $test_func);
}