Assets/Watson/Scripts/Services/RetrieveAndRank/RetrieveAndRank.cs
/// <summary>
/// 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).
/// </summary>
/// <param name="callback"></param>
/// <param name="clusterID">Cluster ID for the configuration.</param>
/// <param name="configName">The name of the configuration to create.</param>
/// <param name="configPath">The path to the compressed configuration files.</param>
/// <param name="customData"></param>
/// <returns></returns>
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 .
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 .
public bool UploadClusterConfig(OnUploadClusterConfig callback, string clusterID, string configName, string configPath, string customData = default(string))
        {
            if (callback == null)
                throw new ArgumentNullException("callback");
            if (string.IsNullOrEmpty(clusterID))
                throw new ArgumentNullException("A clusterID is required for UploadClusterConfig!");
            if (string.IsNullOrEmpty(configName))
                throw new ArgumentNullException("A configName is required for UploadClusterConfig!");
            if (string.IsNullOrEmpty(configPath))
                throw new ArgumentNullException("A configPath is required for UploadClusterConfig!");
            UploadClusterConfigRequest req = new UploadClusterConfigRequest();
            req.Callback = callback;
            req.Data = customData;
            req.ClusterID = clusterID;
            req.ConfigName = configName;
            req.OnResponse = UploadClusterConfigResponse;
            req.Timeout = REQUEST_TIMEOUT;
            byte[] configData = null;
            if (LoadFile != null)
            {
                configData = LoadFile(configPath);
            }
            else
            {
#if !UNITY_WEBPLAYER
                configData = File.ReadAllBytes(configPath);
#endif
            }
            if (configData == null)
                Log.Error("RetrieveAndRank", "Failed to upload {0}!", configPath);
            req.Headers["Content-Type"] = "application/zip";
            req.Send = configData;
            RESTConnector connector = RESTConnector.GetConnector(SERVICE_ID, string.Format(SERVICE_CLUSTER_CONFIG, clusterID, configName));
            if (connector == null)
                return false;
            return connector.Send(req);
        }
public bool UploadClusterConfig ( OnUploadClusterConfig callback , string clusterID , string configName , string configPath , string customData = default ( string ) ) { if ( callback == null ) throw new ArgumentNullException ( " " ) ; if ( string . IsNullOrEmpty ( clusterID ) ) throw new ArgumentNullException ( " " ) ; if ( string . IsNullOrEmpty ( configName ) ) throw new ArgumentNullException ( " " ) ; if ( string . IsNullOrEmpty ( configPath ) ) throw new ArgumentNullException ( " " ) ; UploadClusterConfigRequest req = new UploadClusterConfigRequest ( ) ; req . Callback = callback ; req . Data = customData ; req . ClusterID = clusterID ; req . ConfigName = configName ; req . OnResponse = UploadClusterConfigResponse ; req . Timeout = REQUEST_TIMEOUT ; byte [ ] configData = null ; if ( LoadFile != null ) { configData = LoadFile ( configPath ) ; } else { if ! UNITY_WEBPLAYER configData = File . ReadAllBytes ( configPath ) ; endif } if ( configData == null ) Log . Error ( " " , " " , configPath ) ; req . Headers [ " " ] = " " ; req . Send = configData ; RESTConnector connector = RESTConnector . GetConnector ( SERVICE_ID , string . Format ( SERVICE_CLUSTER_CONFIG , clusterID , configName ) ) ; if ( connector == null ) return false ; return connector . Send ( req ) ; }
Uploads a zip file containing the configuration files for your Solr collection.
Uploads a zip file containing the configuration files for your Solr collection .
None
callback
OnUploadClusterConfig
None
clusterID
string
Cluster ID for the configuration.
Cluster ID for the configuration .
configName
string
The name of the configuration to create.
The name of the configuration to create .
configPath
string
The path to the compressed configuration files.
The path to the compressed configuration files .
customData
string
None