管理 Watson Discovery 集群上的定制搜寻器插件

您可以使用 scripts/manage_crawler_plugin.sh 脚本执行常见的插件管理操作。 scripts/manage_crawler_plugin.sh 脚本位于搜寻器插件 SDK 包中。 在命令中使用该脚本时,必须提供 Discovery 集群的端点 URL 以及 IBM Cloud Pak® for Data 实例的用户名和密码。

IBM Cloud Pak for Data IBM Software Hub

此信息仅适用于已安装的部署。

用于管理搜寻器插件的命令和选项

要查看脚本中的以下帮助消息,可以输入 scripts/manage_crawler_plugin.sh --help:

Usage: scripts/manage_crawler_plugin.sh --endpoint endpoint --user username [--password password] command

Watson Discovery Crawler Plug-in Manager

This script will help you deploy, undeploy, and list your crawler plug-ins for Watson Discovery.

Commands:
deploy        Add a new crawler plug-in to your Watson Discovery instance
undeploy      Undeploy your crawler plug-in by ID
list          List all crawler plug-ins for your Watson Discovery instance (default)

Options:
-e --endpoint         The endpoint URL for your cluster and add-on service instance
                      (https://{cpd_cluster_host}{: port}/discovery/{release}/instances/{instance_id}/api)
-u --user             The user name of your Cloud Pak instance
-p --password         The user password of your Cloud Pak instance
                      If the password is not specified, the command line prompts to input
-n --name             The name of the crawler plug-in to upload (deploy only)
-f --file             The path of the crawler plug-in package to upload (deploy only)
--id                  The crawler_resource_id value to delete the crawler plug-in (undeploy only)
--help                Show this message

要部署、取消部署和列出搜寻器插件,可以使用以下命令。 将变量引用 {variable} 替换为所需信息:

  • 部署搜寻器插件:scripts/manage_crawler_plugin.sh --endpoint {endpoint_URL} --user {username} deploy --name {plugin_name}
  • 取消部署搜寻器插件:scripts/manage_crawler_plugin.sh --endpoint {endpoint_URL} --user {username} undeploy --id {crawler_resource_id}
  • 列出已部署的搜寻器插件:scripts/manage_crawler_plugin.sh --endpoint {endpoint_URL} --user {username} list

使用 scripts/manage_crawler_plugin.sh 脚本部署搜寻器插件后,可以在 Discovery 工具中选择该插件来创建集合。 有关 Discovery 中搜寻器插件设置的更多信息,请参阅搜寻器插件设置。