public final class RecommendToManyServlet extends AbstractMyrrixServlet
Responds to a GET request to
/recommendToMany/[userID1](/[userID2]/...)(?howMany=n)(&considerKnownItems=true|false)(&rescorerParams=...)
and in turn calls
MyrrixRecommender.recommendToMany(long[], int, boolean, IDRescorer).
If howMany is not specified, defaults to
AbstractMyrrixServlet.DEFAULT_HOW_MANY. If considerKnownItems is not specified,
it is considered false.
Output is in CSV or JSON format. Select output format using the HTTP Accept header.
CSV output contains one recommendation per line, and each line is of the form itemID, strength,
like 325, 0.53. Strength is an opaque indicator of the relative quality of the recommendation.
JSON output is an array of arrays, with each sub-array containing an item ID and strength.
Example: [[325, 0.53], [98, 0.499]].
ALL_PARTITIONS_REF_KEY, LOCAL_INPUT_DIR_KEY, PARTITION_KEY, RECOMMENDER_KEY, RESCORER_PROVIDER_KEY, TIMINGS_KEY| Constructor and Description |
|---|
RecommendToManyServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected Integer |
getPartitionToServe(javax.servlet.http.HttpServletRequest request,
int numPartitions) |
determineResponseType, getConsiderKnownItems, getHowMany, getRecommender, getRescorerParams, getRescorerProvider, getTiming, init, output, servicedoDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceprotected void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException
doGet in class javax.servlet.http.HttpServletIOExceptionprotected Integer getPartitionToServe(javax.servlet.http.HttpServletRequest request, int numPartitions)
getPartitionToServe in class AbstractMyrrixServletCopyright © 2012. All Rights Reserved.