public class RetrieveAndRank extends WatsonService implements ClusterLifecycleManager, SolrConfigManager
VERSION
Constructor and Description |
---|
RetrieveAndRank()
Instantiates a new ranker client.
|
Modifier and Type | Method and Description |
---|---|
Ranker |
createRanker(String name,
File training)
Sends data to create and train a ranker, and returns information about the new ranker.
|
SolrCluster |
createSolrCluster()
Creates a new Solr cluster.
|
SolrCluster |
createSolrCluster(SolrClusterOptions config)
Creates a new Solr cluster, based on the provided configuration.
|
void |
deleteRanker(String rankerID)
Deletes a ranker.
|
void |
deleteSolrCluster(String solrClusterId)
Deletes an existing Solr Cluster
SolrCluster . |
void |
deleteSolrClusterConfiguration(String solrClusterId,
String configName)
Deletes a configuration namespace in ZooKeeper.
|
Rankers |
getRankers()
retrieves the list of rankers for the user.
|
Ranker |
getRankerStatus(String rankerID)
Retrieves the status of a ranker.
|
SolrCluster |
getSolrCluster(String solrClusterId)
Returns a Solr cluster information.
|
InputStream |
getSolrClusterConfiguration(String solrClusterId,
String configName)
Gets the configuration from ZooKeeper.
|
List<String> |
getSolrClusterConfigurations(String solrClusterId)
Lists the configuration sets in ZooKeeper.
|
SolrClusterList |
getSolrClusters()
Lists all Solr clusters currently associated with the service instance.
|
String |
getSolrUrl(String solrClusterId)
This URL can be used with the SolrJ library to access Solr functionality.
|
Ranking |
rank(String rankerID,
File answers,
Integer topAnswers)
Gets and returns the ranked answers.
|
void |
uploadSolrClusterConfigurationDirectory(String solrClusterId,
String configName,
File directory)
Uploads a configuration
File to ZooKeeper's namespace, including schema.xml,
solrconfig.xml, and all other necessary config files to configure a SolrCloud collection. |
void |
uploadSolrClusterConfigurationZip(String solrClusterId,
String configName,
File zippedConfig)
Uploads a configuration ZIP
File to ZooKeeper's namespace, including schema.xml,
solrconfig.xml, and all other necessary config files to configure a SolrCloud collection. |
configureHttpClient, execute, executeRequest, executeWithoutResponse, getApiKey, getEndPoint, getName, getToken, setApiKey, setAuthentication, setDefaultHeaders, setEndPoint, setUsernameAndPassword, toString
public Ranker createRanker(String name, File training)
name
- Name of the rankertraining
- The file with the training data i.e., the set of (qid, feature values, and
rank) tuplesRanker
public SolrCluster createSolrCluster()
ClusterLifecycleManager
createSolrCluster
in interface ClusterLifecycleManager
public SolrCluster createSolrCluster(SolrClusterOptions config)
ClusterLifecycleManager
createSolrCluster
in interface ClusterLifecycleManager
config
- the solr cluster configurationpublic void deleteRanker(String rankerID)
rankerID
- the ranker idpublic void deleteSolrCluster(String solrClusterId)
ClusterLifecycleManager
SolrCluster
. deleteSolrCluster
in interface ClusterLifecycleManager
solrClusterId
- the Solr cluster idpublic void deleteSolrClusterConfiguration(String solrClusterId, String configName)
SolrConfigManager
deleteSolrClusterConfiguration
in interface SolrConfigManager
solrClusterId
- the solr cluster idconfigName
- the name of the configuration in ZooKeeper.public Rankers getRankers()
public Ranker getRankerStatus(String rankerID)
rankerID
- the ranker IDRanker
public SolrCluster getSolrCluster(String solrClusterId)
ClusterLifecycleManager
getSolrCluster
in interface ClusterLifecycleManager
solrClusterId
- the Solr cluster idpublic InputStream getSolrClusterConfiguration(String solrClusterId, String configName)
SolrConfigManager
getSolrClusterConfiguration
in interface SolrConfigManager
solrClusterId
- the solr cluster idconfigName
- the name of the configuration in ZooKeeperpublic List<String> getSolrClusterConfigurations(String solrClusterId)
SolrConfigManager
getSolrClusterConfigurations
in interface SolrConfigManager
solrClusterId
- the solr cluster idpublic SolrClusterList getSolrClusters()
ClusterLifecycleManager
getSolrClusters
in interface ClusterLifecycleManager
public String getSolrUrl(String solrClusterId)
solrClusterId
- the ID of the Solr cluster to connect topublic Ranking rank(String rankerID, File answers, Integer topAnswers)
rankerID
- The ranker IDanswers
- The CSV file that contains the search results that you want to rank.topAnswers
- The number of top answers needed, default is 10public void uploadSolrClusterConfigurationDirectory(String solrClusterId, String configName, File directory)
SolrConfigManager
File
to ZooKeeper's namespace, including schema.xml,
solrconfig.xml, and all other necessary config files to configure a SolrCloud collection.
The configuration directory is sent to Solr as a ZIP file. For uploading a ZIP file directly,
use SolrConfigManager.uploadSolrClusterConfigurationZip(String, String, File)
instead. Config files on
the XSLT path will not be uploaded.
uploadSolrClusterConfigurationDirectory
in interface SolrConfigManager
solrClusterId
- the solr cluster idconfigName
- the name of the config in ZooKeeper. This name is used when referencing the
config when creating a collection.directory
- the directory to upload.public void uploadSolrClusterConfigurationZip(String solrClusterId, String configName, File zippedConfig)
SolrConfigManager
File
to ZooKeeper's namespace, including schema.xml,
solrconfig.xml, and all other necessary config files to configure a SolrCloud collection.
For uploading a directory, use
SolrConfigManager.uploadSolrClusterConfigurationDirectory(String , String, File)
instead. Config files
on the XSLT path will not be uploaded.
uploadSolrClusterConfigurationZip
in interface SolrConfigManager
solrClusterId
- the solr cluster idconfigName
- the name of the config in ZooKeeper. This name is used when referencing the
config when creating a collection.zippedConfig
- the ZIP file to upload.Copyright © 2015–2016. All rights reserved.