Watson Developer Cloud Unity SDK  1.0.0
The Unity SDK uses the Watson Developer Cloud services, a collection of REST APIs and SDKs that use cognitive computing to solve complex problems.
IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank Class Reference

This class wraps the Retrieve and Rank service. Retrieve and Rank Service More...

Inheritance diagram for IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank:
IBM.Watson.DeveloperCloud.Services.IWatsonService

Classes

class  CollectionRequest
 The ForwardCollectionRequest request More...
 
class  CreateClusterRequest
 The Create Cluster request. More...
 
class  CreateRankerRequest
 The Create Ranker request. More...
 
class  DeleteClusterConfigRequest
 The Delete Cluster Config request More...
 
class  DeleteClusterRequest
 The Delete Cluster request More...
 
class  DeleteRankerRequest
 The Delete Ranker request More...
 
class  GetClusterConfigsRequest
 The GetClusterConfigs request. More...
 
class  GetClusterRequest
 The Get Cluster request More...
 
class  GetClustersRequest
 The GetCluster request. More...
 
class  GetRankerRequest
 The Get Ranker request More...
 
class  GetRankersRequest
 The GetRanker request. More...
 
class  IndexDocumentsRequest
 The Create Ranker request. More...
 
class  RankRequest
 The Rank request. More...
 
class  SearchRequest
 The search request. More...
 

Public Member Functions

 RetrieveAndRank (Credentials credentials)
 
delegate byte[] LoadFileDelegate (string filename)
 The delegate for loading a file, used by TrainClassifier(). More...
 
delegate void SaveFileDelegate (string filename, byte[] data)
 The delegate for saving a file, used by DownloadDialog(). More...
 
delegate void OnGetClusters (SolrClusterListResponse resp, string data)
 OnGetClusters delegate. More...
 
bool GetClusters (OnGetClusters callback, string customData=default(string))
 Retrieves the list of Solr clusters for the service instance. More...
 
delegate void OnCreateCluster (SolrClusterResponse resp, string data)
 OnCreateCluster callback delegate. More...
 
bool CreateCluster (OnCreateCluster callback, string clusterName=default(string), string clusterSize=default(string), string customData=default(string))
 Provisions a Solr cluster asynchronously. When the operation is successful, the status of the cluster is set to NOT_AVAILABLE. The status must be READY before you can use the cluster. For information about cluster sizing see http://www.ibm.com/watson/developercloud/doc/retrieve-rank/solr_ops.shtml#sizing. More...
 
delegate void OnDeleteCluster (bool success, string data)
 Delete cluster callback delegate. More...
 
bool DeleteCluster (OnDeleteCluster callback, string clusterID, string customData=default(string))
 Delete a Solr cluster. More...
 
delegate void OnGetCluster (SolrClusterResponse resp, string data)
 Get cluster info callback delegate. More...
 
bool GetCluster (OnGetCluster callback, string clusterID, string customData=default(string))
 Returns status and other information about a cluster. More...
 
delegate void OnGetClusterConfigs (SolrConfigList resp, string data)
 Get Cluster Configs callback delegate. More...
 
bool GetClusterConfigs (OnGetClusterConfigs callback, string clusterID, string customData=default(string))
 Returns a configuration .zip file for a cluster. More...
 
delegate void OnDeleteClusterConfig (bool success, string data)
 Delete cluster config callback delegate. More...
 
bool DeleteClusterConfig (OnDeleteClusterConfig callback, string clusterID, string configID, string customData=default(string))
 Deletes the configuration for a cluster. Before you delete the configuration, delete any collections that point to it. More...
 
delegate void OnGetClusterConfig (byte[] resp, string data)
 The GetClusterConfig delegate. More...
 
bool GetClusterConfig (OnGetClusterConfig callback, string clusterID, string configName, string customData=default(string))
 Retrieves the configuration for a cluster by its name. More...
 
delegate void OnSaveClusterConfig (bool success, string data)
 OnSaveClusterConfig callback delegate. More...
 
void SaveConfig (OnSaveClusterConfig callback, byte[] configData, string configFileName, string customData)
 Saves the config zip to the file system. More...
 
delegate void OnUploadClusterConfig (UploadResponse resp, string data)
 UploadClusterConfig callback delegate. More...
 
bool UploadClusterConfig (OnUploadClusterConfig callback, string clusterID, string configName, string configPath, string customData=default(string))
 Uploads a zip file containing the configuration files for your Solr collection. The zip file must include schema.xml, solrconfig.xml, and other files you need for your configuration. Configuration files on the zip file's path are not uploaded. The request fails if a configuration with the same name exists. To update an existing config, use the Solr configuration API (https://cwiki.apache.org/confluence/display/solr/Config+API). More...
 
delegate void OnCollections (CollectionsResponse resp, string data)
 The OnGetCollections delegate. More...
 
bool ForwardCollectionRequest (OnCollections callback, string clusterID, string action, string collectionName=default(string), string configName=default(string), string customData=default(string))
 An example of a method that forwards to the Solr Collections API (https://cwiki.apache.org/confluence/display/solr/Collections+API). This Retrieve and Rank resource improves error handling and resiliency of the Solr Collections API. More...
 
delegate void OnIndexDocuments (IndexResponse resp, string data)
 OnIndexDocuments callback delegate. More...
 
bool IndexDocuments (OnIndexDocuments callback, string indexDataPath, string clusterID, string collectionName, string customData=default(string))
 Adds content to a Solr index so you can search it. An example of a method that forwards to Solr. For more information about indexing, see Indexing and Basic Data Operations in the Apache Solr Reference (https://cwiki.apache.org/confluence/display/solr/Indexing+and+Basic+Data+Operations). You must commit your documents to the index to search for them. For more information about when to commit, see UpdateHandlers in SolrConfig in the Solr Reference (https://cwiki.apache.org/confluence/display/solr/UpdateHandlers+in+SolrConfig). More...
 
delegate void OnSearch (SearchResponse resp, string data)
 The OnSearch callback delegate. More...
 
bool Search (OnSearch callback, string clusterID, string collectionName, string query, string[] fl, bool isRankedSearch=false, string rankerID=default(string), string customData=default(string))
 Return reranked results for your query. The request is similar to the Search Solr standard query parser method, but includes the ranker_id and, in the default configuration, fcselect replaces the select request handler. (https://cwiki.apache.org/confluence/display/solr/The+Standard+Query+Parser). More...
 
delegate void OnGetRankers (ListRankersPayload resp, string data)
 OnGetRankers delegate. More...
 
bool GetRankers (OnGetRankers callback, string customData=default(string))
 Retrieves the list of rankers for the service instance. More...
 
delegate void OnCreateRanker (RankerStatusPayload resp, string data)
 OnCreateCluster callback delegate. More...
 
bool CreateRanker (OnCreateRanker callback, string trainingDataPath, string name=default(string), string customData=default(string))
 Sends data to create and train a ranker and returns information about the new ranker. When the operation is successful, the status of the ranker is set to Training. The status must be Available before you can use the ranker. More...
 
delegate void OnRank (RankerOutputPayload resp, string data)
 OnRank callback delegate. More...
 
bool Rank (OnRank callback, string rankerID, string searchResultPath=default(string), string customData=default(string))
 Returns the top answer and a list of ranked answers with their ranked scores and confidence values. Use the Get information about a ranker method to retrieve the status (http://www.ibm.com/watson/developercloud/retrieve-and-rank/api/v1/#get_status). Use this method to return answers when you train the ranker with custom features. However, in most cases, you can use the Search and rank method (http://www.ibm.com/watson/developercloud/retrieve-and-rank/api/v1/#query_ranker). More...
 
delegate void OnDeleteRanker (bool success, string data)
 Delete Ranker callback delegate. More...
 
bool DeleteRanker (OnDeleteRanker callback, string rankerID, string customData=default(string))
 Deletes a ranker. More...
 
delegate void OnGetRanker (RankerStatusPayload resp, string data)
 Get ranker info callback delegate. More...
 
bool GetRanker (OnGetRanker callback, string rankerID, string customData=default(string))
 Returns status and other information about a ranker. More...
 
string GetServiceID ()
 <exclude> More...
 

Properties

string Url [get, set]
 Gets and sets the endpoint URL for the service. More...
 
Credentials Credentials [get, set]
 Gets and sets the credentials of the service. Replace the default endpoint if endpoint is defined. More...
 
LoadFileDelegate LoadFile [get, set]
 Set this property to overload the internal file loading of this class. More...
 
SaveFileDelegate SaveFile [get, set]
 Set this property to overload the internal file saving for this class. More...
 

Detailed Description

This class wraps the Retrieve and Rank service. Retrieve and Rank Service

Constructor & Destructor Documentation

IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.RetrieveAndRank ( Credentials  credentials)
inline

Member Function Documentation

bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.CreateCluster ( OnCreateCluster  callback,
string  clusterName = default(string),
string  clusterSize = default(string),
string  customData = default(string) 
)
inline

Provisions a Solr cluster asynchronously. When the operation is successful, the status of the cluster is set to NOT_AVAILABLE. The status must be READY before you can use the cluster. For information about cluster sizing see http://www.ibm.com/watson/developercloud/doc/retrieve-rank/solr_ops.shtml#sizing.

Parameters
callback
clusterNameName to identify the cluster.
clusterSizeSize of the cluster to create. Ranges from 1 to 7. Send an empty value to create a small free cluster for testing. You can create only one free cluster.
customData
Returns
bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.CreateRanker ( OnCreateRanker  callback,
string  trainingDataPath,
string  name = default(string),
string  customData = default(string) 
)
inline

Sends data to create and train a ranker and returns information about the new ranker. When the operation is successful, the status of the ranker is set to Training. The status must be Available before you can use the ranker.

Parameters
callback
trainingDataPathTraining data in CSV format. The first header must be question_id and the last header must be the relevance label. The other headers are alphanumeric feature names. For details, see Using your own data (http://www.ibm.com/watson/developercloud/doc/retrieve-rank/data_format.shtml).
nameMetadata in JSON format. The metadata identifies an optional name to identify the ranker.
customData
Returns
bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.DeleteCluster ( OnDeleteCluster  callback,
string  clusterID,
string  customData = default(string) 
)
inline

Delete a Solr cluster.

Parameters
callback
clusterID
customData
Returns
bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.DeleteClusterConfig ( OnDeleteClusterConfig  callback,
string  clusterID,
string  configID,
string  customData = default(string) 
)
inline

Deletes the configuration for a cluster. Before you delete the configuration, delete any collections that point to it.

Parameters
callback
clusterIDThe name of the configuration to delete.
configIDCluster ID for the configuration.
customData
Returns
bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.DeleteRanker ( OnDeleteRanker  callback,
string  rankerID,
string  customData = default(string) 
)
inline

Deletes a ranker.

Parameters
callback
rankerIDID of the ranker to delete.
customData
Returns
bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.ForwardCollectionRequest ( OnCollections  callback,
string  clusterID,
string  action,
string  collectionName = default(string),
string  configName = default(string),
string  customData = default(string) 
)
inline

An example of a method that forwards to the Solr Collections API (https://cwiki.apache.org/confluence/display/solr/Collections+API). This Retrieve and Rank resource improves error handling and resiliency of the Solr Collections API.

Parameters
callback
clusterIDCluster ID for the collection.
actionOperation to carry out. Either "CREATE", "LIST", or "DELETE"
collectionNameThe collectionName required for "CREATE" or "DELETE".
configNameThe cluster configuration name to use for "CREATE".
customData
Returns
bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.GetCluster ( OnGetCluster  callback,
string  clusterID,
string  customData = default(string) 
)
inline

Returns status and other information about a cluster.

Parameters
callback
clusterIDUnique identifier for this cluster.
customData
Returns
bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.GetClusterConfig ( OnGetClusterConfig  callback,
string  clusterID,
string  configName,
string  customData = default(string) 
)
inline

Retrieves the configuration for a cluster by its name.

Parameters
callback
clusterIDCluster ID for the configuration.
configNameThe name of the configuration to retrieve.
customData
Returns
bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.GetClusterConfigs ( OnGetClusterConfigs  callback,
string  clusterID,
string  customData = default(string) 
)
inline

Returns a configuration .zip file for a cluster.

Parameters
callback
clusterID
customData
Returns
bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.GetClusters ( OnGetClusters  callback,
string  customData = default(string) 
)
inline

Retrieves the list of Solr clusters for the service instance.

Parameters
callback
customData
Returns
bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.GetRanker ( OnGetRanker  callback,
string  rankerID,
string  customData = default(string) 
)
inline

Returns status and other information about a ranker.

Parameters
callback
rankerIDID of the ranker to query.
customData
Returns
bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.GetRankers ( OnGetRankers  callback,
string  customData = default(string) 
)
inline

Retrieves the list of rankers for the service instance.

Parameters
callback
customData
Returns
string IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.GetServiceID ( )
inline
bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.IndexDocuments ( OnIndexDocuments  callback,
string  indexDataPath,
string  clusterID,
string  collectionName,
string  customData = default(string) 
)
inline

Adds content to a Solr index so you can search it. An example of a method that forwards to Solr. For more information about indexing, see Indexing and Basic Data Operations in the Apache Solr Reference (https://cwiki.apache.org/confluence/display/solr/Indexing+and+Basic+Data+Operations). You must commit your documents to the index to search for them. For more information about when to commit, see UpdateHandlers in SolrConfig in the Solr Reference (https://cwiki.apache.org/confluence/display/solr/UpdateHandlers+in+SolrConfig).

Parameters
callback
indexdataPathPath to the file that defines the content.
clusterIDCluster ID.
collectionNameCollection.
customData
Returns
delegate byte [] IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.LoadFileDelegate ( string  filename)

The delegate for loading a file, used by TrainClassifier().

Parameters
filenameThe filename to load.
Returns
Should return a byte array of the file contents or null of failure.
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnCollections ( CollectionsResponse  resp,
string  data 
)

The OnGetCollections delegate.

Parameters
resp
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnCreateCluster ( SolrClusterResponse  resp,
string  data 
)

OnCreateCluster callback delegate.

Parameters
resp
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnCreateRanker ( RankerStatusPayload  resp,
string  data 
)

OnCreateCluster callback delegate.

Parameters
resp
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnDeleteCluster ( bool  success,
string  data 
)

Delete cluster callback delegate.

Parameters
deleteSuccess
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnDeleteClusterConfig ( bool  success,
string  data 
)

Delete cluster config callback delegate.

Parameters
deleteSuccess
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnDeleteRanker ( bool  success,
string  data 
)

Delete Ranker callback delegate.

Parameters
deleteSuccess
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnGetCluster ( SolrClusterResponse  resp,
string  data 
)

Get cluster info callback delegate.

Parameters
resp
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnGetClusterConfig ( byte[]  resp,
string  data 
)

The GetClusterConfig delegate.

Parameters
getSuccess
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnGetClusterConfigs ( SolrConfigList  resp,
string  data 
)

Get Cluster Configs callback delegate.

Parameters
resp
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnGetClusters ( SolrClusterListResponse  resp,
string  data 
)

OnGetClusters delegate.

Parameters
resp
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnGetRanker ( RankerStatusPayload  resp,
string  data 
)

Get ranker info callback delegate.

Parameters
resp
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnGetRankers ( ListRankersPayload  resp,
string  data 
)

OnGetRankers delegate.

Parameters
resp
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnIndexDocuments ( IndexResponse  resp,
string  data 
)

OnIndexDocuments callback delegate.

Parameters
resp
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnRank ( RankerOutputPayload  resp,
string  data 
)

OnRank callback delegate.

Parameters
resp
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnSaveClusterConfig ( bool  success,
string  data 
)

OnSaveClusterConfig callback delegate.

Parameters
success
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnSearch ( SearchResponse  resp,
string  data 
)

The OnSearch callback delegate.

Parameters
resp
data
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.OnUploadClusterConfig ( UploadResponse  resp,
string  data 
)

UploadClusterConfig callback delegate.

Parameters
resp
data
bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.Rank ( OnRank  callback,
string  rankerID,
string  searchResultPath = default(string),
string  customData = default(string) 
)
inline

Returns the top answer and a list of ranked answers with their ranked scores and confidence values. Use the Get information about a ranker method to retrieve the status (http://www.ibm.com/watson/developercloud/retrieve-and-rank/api/v1/#get_status). Use this method to return answers when you train the ranker with custom features. However, in most cases, you can use the Search and rank method (http://www.ibm.com/watson/developercloud/retrieve-and-rank/api/v1/#query_ranker).

Parameters
callback
rankerIDID of the ranker to use.
searchResultPathThe path to the CSV file that contains the search results that you want to rank. The first column header of the CSV must be labeled answer_id. The remaining column headers must match the names of the features in the training data that was used when this ranker was created.
customData
Returns
void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.SaveConfig ( OnSaveClusterConfig  callback,
byte[]  configData,
string  configFileName,
string  customData 
)
inline

Saves the config zip to the file system.

Parameters
callback
configDataByte array of the config data.
configFileNameWhere to save the zip file in the file system.
customData
delegate void IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.SaveFileDelegate ( string  filename,
byte[]  data 
)

The delegate for saving a file, used by DownloadDialog().

Parameters
filenameThe filename to save.
dataThe data to save into the file.
bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.Search ( OnSearch  callback,
string  clusterID,
string  collectionName,
string  query,
string[]  fl,
bool  isRankedSearch = false,
string  rankerID = default(string),
string  customData = default(string) 
)
inline

Return reranked results for your query. The request is similar to the Search Solr standard query parser method, but includes the ranker_id and, in the default configuration, fcselect replaces the select request handler. (https://cwiki.apache.org/confluence/display/solr/The+Standard+Query+Parser).

Parameters
callback
clusterIDCluster ID.
collectionNameThe name of the collection to use.
queryThe query. Uses Solr standard query syntax.
flThe fields to return.
isRankedSearchUse ranked search instead of standard search.
rankerIDThe trained ranker to query.
customData
Returns
bool IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.UploadClusterConfig ( OnUploadClusterConfig  callback,
string  clusterID,
string  configName,
string  configPath,
string  customData = default(string) 
)
inline

Uploads a zip file containing the configuration files for your Solr collection. The zip file must include schema.xml, solrconfig.xml, and other files you need for your configuration. Configuration files on the zip file's path are not uploaded. The request fails if a configuration with the same name exists. To update an existing config, use the Solr configuration API (https://cwiki.apache.org/confluence/display/solr/Config+API).

Parameters
callback
clusterIDCluster ID for the configuration.
configNameThe name of the configuration to create.
configPathThe path to the compressed configuration files.
customData
Returns

Property Documentation

Credentials IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.Credentials
getset

Gets and sets the credentials of the service. Replace the default endpoint if endpoint is defined.

LoadFileDelegate IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.LoadFile
getset

Set this property to overload the internal file loading of this class.

SaveFileDelegate IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.SaveFile
getset

Set this property to overload the internal file saving for this class.

string IBM.Watson.DeveloperCloud.Services.RetrieveAndRank.v1.RetrieveAndRank.Url
getset

Gets and sets the endpoint URL for the service.


The documentation for this class was generated from the following file: