|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Interface for an object used to maintain search Best Bets. Best Bets are mappings from user search queries to (up to) three top-ranked results; they allow an administrator to hardwire certain common searches to known good results that wouldn't necessarily rank at the top otherwise.
The normal usage pattern for this object is not completely obvious:
| Method Summary | |
void |
Clear()
Clears all best bets out of this object, usually in preparation for replacing them by repeated calls to GetNewBBIdAndAdd(). |
int |
GetNewBBIdAndAdd(java.lang.String queryString,
int numTargets,
java.lang.String target1Key1,
java.lang.String target1Key2,
java.lang.String target1Name,
java.lang.String target2Key1,
java.lang.String target2Key2,
java.lang.String target2Name,
java.lang.String target3Key1,
java.lang.String target3Key3,
java.lang.String target3Name)
Adds a new Best Bet to the collection in memory, and returns a numeric id for the best bet that may be used in future calls to GetQueryString, GetTargetKeyX, and GetTargetName. |
int |
GetNumBBsDefinedInDB()
Call this method first to initialize the object from the database. |
int |
GetNumTargets(int nID)
Returns the number of hardwired targets (top-ranked search results) for this best bet. |
java.lang.String |
GetQueryString(int nID)
Returns the user search query that triggers the best bet with id nID. |
java.lang.String |
GetTargetKey1(int nID,
int nTargetNum)
Returns the first part of the search server key for the indicated best bet and target (result). |
java.lang.String |
GetTargetKey2(int nID,
int nTargetNum)
Returns the second part of the search server key for the indicated best bet and target (result). |
java.lang.String |
GetTargetName(int nID,
int nTargetNum)
Returns a displayable name for the indicated best bet target, usually just the name of the document or object. |
void |
ReplaceBBsInDB()
Commits the best bets currently stored in this object to the database, replacing all best bets previously in the database. |
| Methods inherited from interface com.plumtree.server.IPTUnknown |
GetInterfaces |
| Method Detail |
public void Clear()
public int GetNumBBsDefinedInDB()
public int GetNewBBIdAndAdd(java.lang.String queryString,
int numTargets,
java.lang.String target1Key1,
java.lang.String target1Key2,
java.lang.String target1Name,
java.lang.String target2Key1,
java.lang.String target2Key2,
java.lang.String target2Name,
java.lang.String target3Key1,
java.lang.String target3Key3,
java.lang.String target3Name)
Ordinarily, a search is run just before calling this method, and the search results are used to determine the values of the key fields. Use the value returned by IPTSearchResponse.GetResultInternalField(PT_SEARCH_INTERNAL_FIELD.PT_SEARCH_IF_BESTBETKEY) as the first half of the key, and the value returned by IPTSearchResponse.GetResultApp() as the second half.
There is currently a limit of 30 best bets that may be defined at one time; if more than 30 are added this method will throw an exception.
queryString - the user's search query that will trigger this best betnumTargets - the number of targets (search results) to force to be at the top of the result set; must be 1, 2, or 3target1Key1 - First part of the search server key for target 1.target1Key2 - Second part of the search server key for target 1.target1Name - Displayable name for the first target; will be ignored in 5.0SP1 and later.target2Key1 - First part of the search server key for target 2, or null.target2Key2 - Second part of the search server key for target 2, or null.target2Name - Displayable name for the second target; will be ignored in 5.0SP1 and later.target3Key1 - First part of the search server key for target 3, or null.target3Key2 - Second part of the search server key for target 3, or null.target3Name - Displayable name for the third target; will be ignored in 5.0SP1 and later.public void ReplaceBBsInDB()
public java.lang.String GetQueryString(int nID)
nID - numeric ID of the best bet. 0-based, must be less than the value returned by GetNumBBsDefinedInDB (or a value returned by GetNewBBIdAndAdd).public int GetNumTargets(int nID)
nID - numeric ID of the best bet. 0-based, must be less than the value returned by GetNumBBsDefinedInDB (or a value returned by GetNewBBIdAndAdd).
public java.lang.String GetTargetKey1(int nID,
int nTargetNum)
nID - numeric ID of the best bet. 0-based, must be less than the value returned by GetNumBBsDefinedInDB (or a value returned by GetNewBBIdAndAdd).nTargetNum - target number desired; must be 1, 2, or 3.
public java.lang.String GetTargetKey2(int nID,
int nTargetNum)
nID - numeric ID of the best bet. 0-based, must be less than the value returned by GetNumBBsDefinedInDB (or a value returned by GetNewBBIdAndAdd).nTargetNum - target number desired; must be 1, 2, or 3.
public java.lang.String GetTargetName(int nID,
int nTargetNum)
nID - numeric ID of the best bet. 0-based, must be less than the value returned by GetNumBBsDefinedInDB (or a value returned by GetNewBBIdAndAdd).nTargetNum - target number desired; must be 1, 2, or 3.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||