|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.raritantechnologies.recommend.Verity.VerityRecommend
Class for utilizing the Verity K2 recommendation features
The class has methods for pushing data to the recommendation engine as well as methods for retreiving users/documents/queries based on various inputs
XML Configuration Template:
<RecommendImpl class="com.raritantechnologies.recommend.Verity.VerityRecommend"
k2ServerSpec="[ Verity K2 Server host:port ]"
queryRecommendationIndexType="[ Type of recommendation index for queries ]"
queryRecommendationIndexAlias="[ Alias of query recommendation index ]"
userGroupRecommendationIndexType="[ Type of recommendation index for user group ]"
userGroupRecommendationIndexAlias="[ Alias of user group recommendation index ]"
queryGroupRecommendationIndexType="[ Type of recommendation index for query group ]"
queryGroupRecommendationIndexAlias="[ Alias of query group recommendation index ]"
queryParser="[ Valid Verity query parser - "FreeText" "Simple" "BoolPlus" ]"
<VQLParserStringFilter
outputFormat="[type of filter to apply to queries - RulesValueString or ToEnglishString]" />
</RecommendImpl>
| Field Summary | |
static java.lang.String |
CREATE_ALL_RELATIONSHIPS
Transaction type for creating all relationships. |
static java.lang.String |
DOC_AND_QUERY_TO_USER
Transaction type for associating a document and query to a user. |
static java.lang.String |
DOC_AND_QUERY_TO_USER_GROUP
Transaction type for associating a document and a query to a user group. |
static java.lang.String |
DOC_TO_QUERY
Transaction type for associating a document to a query. |
static java.lang.String |
GET_QUERIES
|
static java.lang.String |
QUERY_TO_DOC
Transaction type for associating a query to a document. |
static java.lang.String |
QUERY_TO_QUERY_GROUP
Transaction type for associating a query to a query group. |
| Constructor Summary | |
VerityRecommend()
|
|
| Method Summary | |
void |
addDocuments(ILoginInfo userInfo,
OrderedMap queryMap,
IDocument[] document)
Not used for K2 implementation of recommendation. |
void |
addQuery(ILoginInfo userInfo,
OrderedMap queryMap)
Not used for K2 implementation of recommendation. |
void |
addUser(ILoginInfo userInfo)
Not used for K2 implementation of recommendation. |
void |
createNewLogEntity(java.lang.String riType,
java.lang.String entityID)
createNewLogEntity is public so that a batch update program can use it. |
void |
createRecommendationLogEntries(java.lang.String transactionType,
OrderedMap transMap)
Creates and submits a transaction to the Verity K2 recommendation log(s). |
ILoginInfo[] |
getExpertUsers(IQueryList queries,
IDocument document,
int returnCount)
Retreives users that match the query/document specified. |
IDocument[] |
getRelatedDocuments(java.util.Collection repositories,
java.util.Collection docFields,
ILoginInfo userInfo,
boolean isGroup,
int returnCount)
Retreives documents that match the user or user group specified. |
IDocument[] |
getRelatedDocuments(java.util.Collection repositories,
java.util.Collection docFields,
ILoginInfo userInfo,
IDocument document,
OrderedMap queryMap,
boolean isGroup,
int returnCount)
Retreives documents that match the user or group/document/query specified. |
IQueryList |
getRelatedQueries(java.util.Collection repositories,
ILoginInfo userInfo,
IQueryList queries,
IDocument document,
boolean isGroup,
int returnCount)
Retreives queries that match the user or group/document/query specified. |
IQueryList |
getRelatedQueries(ILoginInfo userInfo,
boolean isGroup,
int returnCount)
Retreives queries that match the user/group specified. |
ILoginInfo[] |
getRelatedUsers(ILoginInfo userInfo,
OrderedMap queryMap,
boolean isGroup,
int returnCount)
Retreives users that match the user or group/query specified. |
void |
initialize(org.w3c.dom.Element elem)
Sets variable values from the RecommendationWebServicesConfig.xml file |
IDocument[] |
recommendDocuments(java.util.Collection repositories,
java.util.Collection docFields,
OrderedMap queryMap,
ILoginInfo userInfo,
int returnCount)
Retreives documents that match the query/user specified. |
IDocument[] |
recommendSimilarDocuments(java.util.Collection repositories,
java.util.Collection docFields,
OrderedMap queryMap,
IDocument document,
int returnCount)
Retreives documents that match the document/query specified. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String DOC_AND_QUERY_TO_USER
Requires the transMap contain a TargetValue and a TargetWeight describing the target user. SourceValue1/SourceWeight1 describe the document. SourceValue2/SourceWeight2 describe the query.
An example:
TargetValue=Tom
TargetWeight=100
SourceValue1=1234@doccollection
SourceWeight1=65
SourceValue2=automobile
SourceWeight2=85
createRecommendationLogEntries(java.lang.String, com.raritantechnologies.utils.OrderedMap),
Constant Field Valuespublic static final java.lang.String QUERY_TO_DOC
Requires the transMap contain a TargetValue and a TargetWeight describing the target document. SourceValue1/SourceWeight1 describe the query.
An example:
TargetValue=1234@doccollection
TargetWeight=100
SourceValue1=automobile
SourceWeight1=65
createRecommendationLogEntries(java.lang.String, com.raritantechnologies.utils.OrderedMap),
Constant Field Valuespublic static final java.lang.String DOC_TO_QUERY
Requires the transMap contain a TargetValue and a TargetWeight describing the target query. SourceValue1/SourceWeight1 describe the document.
An example:
TargetValue=automobile
TargetWeight=100
SourceValue1=1234@doccollection
SourceWeight1=65
createRecommendationLogEntries(java.lang.String, com.raritantechnologies.utils.OrderedMap),
Constant Field Valuespublic static final java.lang.String DOC_AND_QUERY_TO_USER_GROUP
Requires the transMap contain a TargetValue and a TargetWeight describing the target user group. SourceValue1/SourceWeight1 describe the document. SourceValue2/SourceWeight2 describe the query.
An example:
TargetValue=All
TargetWeight=100
SourceValue1=1234@doccollection
SourceWeight1=65
SourceValue2=automobile
SourceWeight2=85
createRecommendationLogEntries(java.lang.String, com.raritantechnologies.utils.OrderedMap),
Constant Field Valuespublic static final java.lang.String QUERY_TO_QUERY_GROUP
Requires the transMap contain a TargetValue and a TargetWeight describing the target query group. SourceValue1/SourceWeight1 describe the query.
An example:
TargetValue=All
TargetWeight=100
SourceValue1=automobile
SourceWeight1=65
createRecommendationLogEntries(java.lang.String, com.raritantechnologies.utils.OrderedMap),
Constant Field Valuespublic static final java.lang.String CREATE_ALL_RELATIONSHIPS
Requires the transMap contain a user, group(s), query, document, target weight and source weight.
An example:
User=Tom
Group=All
Query=(frequency
Document=123@ieejrns
TargetWeight=100
SourceWeight=65
public static final java.lang.String GET_QUERIES
| Constructor Detail |
public VerityRecommend()
| Method Detail |
public void initialize(org.w3c.dom.Element elem)
initialize in interface IConfigurablepublic void addUser(ILoginInfo userInfo)
addUser in interface IRecommenduserInfo - contains user namecreateRecommendationLogEntries(java.lang.String, com.raritantechnologies.utils.OrderedMap)
public void addQuery(ILoginInfo userInfo,
OrderedMap queryMap)
addQuery in interface IRecommenduserInfo - contains user namequeryMap - contains query textcreateRecommendationLogEntries(java.lang.String, com.raritantechnologies.utils.OrderedMap)
public void addDocuments(ILoginInfo userInfo,
OrderedMap queryMap,
IDocument[] document)
addDocuments in interface IRecommenduserInfo - contains user namequeryMap - contains query textdocument - contains documentscreateRecommendationLogEntries(java.lang.String, com.raritantechnologies.utils.OrderedMap)
public void createRecommendationLogEntries(java.lang.String transactionType,
OrderedMap transMap)
throws RecommendException
Creates and submits a transaction to the Verity K2 recommendation log(s).
The following applies to all transactions except CREATE_ALL_RELATIONSHIPS A K2 recommendation transaction requires one target entity and at least one source entity. A value and a weight are required to build an entity. The transMap must contain a TargetValue and a TargetWeight with their associated data. The transMap must contain SourceValue1 and SourceWeight1 with their associated data. Depending on the transaction type, a SourceValue2 and SourceWeight2 will be required. See the transaction types below for more details.
For transaction CREATE_ALL_RELATIONSHIPS, a user, query, group, document
target weight and source weight are used to generate and call the following
5 transactions:
DOC_AND_QUERY_TO_USER
QUERY_TO_DOC
DOC_TO_QUERY
DOC_AND_QUERY_TO_USER_GROUP
QUERY_TO_QUERY_GROUP
createRecommendationLogEntries in interface IRecommendtransactionType - specifies a VerityRecommend transaction type.transMap - contains target and source data to format a K2 recommendation transaction.
RecommendExceptionDOC_AND_QUERY_TO_USER,
QUERY_TO_DOC,
DOC_TO_QUERY,
DOC_AND_QUERY_TO_USER_GROUP,
QUERY_TO_QUERY_GROUP,
CREATE_ALL_RELATIONSHIPS
public IDocument[] getRelatedDocuments(java.util.Collection repositories,
java.util.Collection docFields,
ILoginInfo userInfo,
boolean isGroup,
int returnCount)
throws RecommendException
getRelatedDocuments in interface IRecommendrepositories - recommendation indexes to searchdocFields - return specified fields in addition to document ID and URLuserInfo - Use the getUserName method to get seed user or groupisGroup - used to determine if user is a group or individualreturnCount - number of documents to return
RecommendException
public IDocument[] getRelatedDocuments(java.util.Collection repositories,
java.util.Collection docFields,
ILoginInfo userInfo,
IDocument document,
OrderedMap queryMap,
boolean isGroup,
int returnCount)
throws RecommendException
getRelatedDocuments in interface IRecommendrepositories - recommendation indexes to searchdocFields - return specified fields in addition to document ID and URLuserInfo - Use the getUserName method to get seed user or groupdocument - Use the getDocumentID method to get seed documentqueryMap - Use the getValue method with a key of 'Query' to get seed queryisGroup - used to determine if user is a group or individualreturnCount - number of documents to return
RecommendException
public IDocument[] recommendSimilarDocuments(java.util.Collection repositories,
java.util.Collection docFields,
OrderedMap queryMap,
IDocument document,
int returnCount)
throws RecommendException
recommendSimilarDocuments in interface IRecommendrepositories - recommendation indexes to searchdocFields - return specified fields in addition to document ID and URLqueryMap - Use the getValue method with a key of 'Query' to get seed querydocument - Use the getDocumentID method to get seed documentreturnCount - number of documents to return
RecommendException
public IDocument[] recommendDocuments(java.util.Collection repositories,
java.util.Collection docFields,
OrderedMap queryMap,
ILoginInfo userInfo,
int returnCount)
throws RecommendException
recommendDocuments in interface IRecommendrepositories - recommendation indexes to searchdocFields - return specified fields in addition to document ID and URLqueryMap - Use the getValue method with a key of 'Query' to get seed queryuserInfo - Use the getUserName method to get the seed userreturnCount - number of documents to return
RecommendException
public IQueryList getRelatedQueries(ILoginInfo userInfo,
boolean isGroup,
int returnCount)
throws RecommendException
getRelatedQueries in interface IRecommenduserInfo - Use the getUserName method to get the seed userisGroup - used to determine if user is a group or individualreturnCount - number of documents to return
RecommendException
public IQueryList getRelatedQueries(java.util.Collection repositories,
ILoginInfo userInfo,
IQueryList queries,
IDocument document,
boolean isGroup,
int returnCount)
throws RecommendException
getRelatedQueries in interface IRecommendrepositories - recommendation indexes to searchuserInfo - Use the getUserName method to get seed user or groupqueries - Use the getQueryFromMap method to get seed querydocument - Use the getDocumentID method to get seed documentisGroup - used to determine if user is a group or individualreturnCount - number of documents to return
RecommendException
public ILoginInfo[] getExpertUsers(IQueryList queries,
IDocument document,
int returnCount)
throws RecommendException
getExpertUsers in interface IRecommendqueries - Use the getQueryFromMap method to get seed querydocument - Use the getDocumentID method to get seed documentreturnCount - number of documents to return
RecommendException
public ILoginInfo[] getRelatedUsers(ILoginInfo userInfo,
OrderedMap queryMap,
boolean isGroup,
int returnCount)
throws RecommendException
getRelatedUsers in interface IRecommenduserInfo - Use the getUserName method to get seed user or groupqueryMap - Use the getQueryFromMap method to get seed queryisGroup - used to determine if user is a group or individualreturnCount - number of documents to return
RecommendException
public void createNewLogEntity(java.lang.String riType,
java.lang.String entityID)
throws RecommendException
This method first checks if the entity exists. If the entity is not found a TX_NEW transaction is created to establish the entity. This method can not create an entity of type 'doc'. Documents must be created in the document collection. The mkre -update would then create the entity in the recommendation index.
The entity must be fully qualified. The format is: entity@alias where entity is the entity to be created and alias is the alias of the recommendation index. To create a user, the riType would be 'user' and the entityID would be 'Tom@users'.
riType - recommendation index type of entity to be createdentityID - entity to be created
RecommendException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||