
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
用于在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。
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务