
用于在Amazon Elasticsearch集群中搜索概念的API服务。
注意:AWS SDK for Go目前https://github.com/aws/aws-sdk-go/issues/710%EF%BC%8C%E4%BD%86%E8%87%AAv1.2.0%E7%89%88%E6%9C%AC%E8%B5%B7%E5%B7%B2%E6%9A%B4%E9%9C%B2%E7%AD%BE%E5%90%8D%E5%99%A8%EF%BC%88Signer%EF%BC%89%E3%80%82
访问AES(Amazon Elasticsearch Service)的实现方式:
适用于需要从Amazon Elasticsearch集群中检索概念数据的应用场景,如内容管理系统、知识图谱查询、自动补全功能等。
确保本地已安装dep工具,如未安装,执行以下命令:
bashcurl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
bashmkdir $GOPATH/src/github.com/Financial-Times/concept-search-api cd $GOPATH/src/github.com/concept-search-api git clone https://github.com/Financial-Times/concept-search-api.git cd concept-search-api && dep ensure -vendor-only go build ./concept-search-api --aws-access-key="{access key}" --aws-secret-access-key="{secret key}"
可通过命令行参数配置服务,支持以下参数(未指定时使用默认值):
aws-access-key:AWS访问密钥(必填)aws-secret-access-key:AWS密钥(必填)elasticsearch-endpoint:Elasticsearch端点elasticsearch-region:Elasticsearch区域port:服务运行端口(默认:8080)index-name:搜索索引名(默认:concept)elasticsearch-index:Elasticsearch索引(默认:concept)search-result-limit:最大返回结果数(默认:50)elasticsearch-trace:是否启用ES跟踪(默认:false)需本地运行Elasticsearch实例,并设置环境变量:
bashexport ELASTICSEARCH_TEST_URL=http://localhost:9200
执行测试命令:
bashgo test -race ./...
使用-short选项跳过集成测试:
bashgo test -race -short ./...
用于搜索概念,请求体为包含term字段的JSON,term值为搜索条件。
请求示例
搜索"FOO":
bashcurl -XPOST {concept-search-api-url}/concept/search -d '{"term":"FOO"}'
可选查询参数
include_score=true:返回结果中包含匹配分数
bashcurl -XPOST {concept-search-api-url}/concept/search?include_score=true -d '{"term":"FOO"}'
searchAllAuthorities=true:扩展搜索域至所有权威来源(TME、Smartlogic、Factset等)
bashcurl -XPOST {concept-search-api-url}/concept/search?searchAllAuthorities=true -d '{"term":"FOO"}'
include_deprecated=true:包含已弃用的概念
bashcurl -XPOST {concept-search-api-url}/concept/search?include_deprecated=true -d '{"term":"FOO"}'
响应示例
json[ { "id": "http://api.ft.com/things/d79f6383-9271-3a03-aacd-5ce8e57d6f5e", "apiUrl": "http://api.ft.com/organisations/d79f6383-9271-3a03-aacd-5ce8e57d6f5e", "prefLabel": "FOO LLC", "types": [ "http://www.ft.com/ontology/core/Thing", "http://www.ft.com/ontology/concept/Concept", "http://www.ft.com/ontology/organisation/Organisation" ], "directType": "http://www.ft.com/ontology/organisation/Organisation", "aliases": ["FOO LLC", "FOO"], "score": 10.117536, "isDeprecated": true }, { "id": "http://api.ft.com/things/87c69c2c-ad53-3888-9958-835098db4dae", "apiUrl": "http://api.ft.com/organisations/87c69c2c-ad53-3888-9958-835098db4dae", "prefLabel": "FOO International", "types": [ "http://www.ft.com/ontology/core/Thing", "http://www.ft.com/ontology/concept/Concept", "http://www.ft.com/ontology/organisation/Organisation" ], "directType": "http://www.ft.com/ontology/organisation/Organisation", "aliases": ["FOO International", "FOO INTERNATIONAL"], "score": 2.8585405 } ]
响应状态码
用于类型提前(typeahead)风格的概念查询,type参数为必填项。
基础请求示例(查询Genre类型)
bashcurl {concept-search-api-url}/concepts?type=http://www.ft.com/ontology/Genre
可选查询参数
mode=search:激活搜索模式,需配合q参数指定搜索词
bashcurl {concept-search-api-url}/concepts?type=http://www.ft.com/ontology/organisation/Organisation&mode=search&q=FOO
boost=authors:在搜索模式下提升作者相关结果(仅支持作者类型)
bashcurl {concept-search-api-url}/concepts?type=http://www.ft.com/ontology/person/Person&mode=search&q=FOO&boost=authors
searchAllAuthorities=true:扩展搜索域至所有权威来源include_deprecated=true:包含已弃用的概念返回标准FT格式的服务连通性和集群健康状态。
返回ES集群的详细健康状态,格式与{elasticsearch-endpoint}/_cluster/health一致。服务不可用时返回503。
服务健康时返回200,不健康时返回503(服务不可用)。
更多详情请参见Swagger YML。
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务