[英]Compass Search request through slate - Palantir Foundry
I'm trying to create a Slate application which uses the compass search
endpoint.我正在尝试创建一个使用罗盘
search
端点的 Slate 应用程序。
I've managed to connect to the endpoint trough postman just fine using <host>/foundry-search/api/compass/v0/search
, and get the desired results.我已经成功地使用
<host>/foundry-search/api/compass/v0/search
连接到端点槽 postman ,并获得了想要的结果。
However in Slate I'm unable to get a 200 response with the same query, using search
in the path, example:但是在 Slate 中,我无法使用相同的查询获得 200 响应,在路径中使用
search
,例如:
{
"path": "search",
"method": "POST",
"bodyJson": {
"query": {},
"limit": 5
},
"extractors": {
"results": "$"
},
"headers": {
"Content-Type": "application/json",
"Content-Length": 64
}
}
Other compass endpoints work fine, its just the search one I cant manage to work out.其他指南针端点工作正常,只是我无法解决的搜索问题。 For this query in particular I get 500, with errorCode
INTERNAL
.特别是对于这个查询,我得到 500,errorCode
INTERNAL
。 Is there any magic trick one needs to do for search?搜索需要什么魔术吗?
From the layout of the request, it looks like the Compass datasource being queried has been configured with an HttpJson type.从请求的布局来看,被查询的 Compass 数据源似乎配置了HttpJson类型。 It's generally not recommended to query Foundry services through the HttpJson configuration as certain endpoints may only be considered internally supported, and liable to change at any time (which could possibly break your Slate application without warning).
通常不建议通过HttpJson配置查询 Foundry 服务,因为某些端点可能仅被认为是内部支持的,并且随时可能更改(这可能会在没有警告的情况下破坏您的 Slate 应用程序)。
Slate datasources that point to Foundry services should be configured as a ServiceApi type as they provide an easy editor layout that displays available supported endpoints, endpoint parameter inputs (with Handlebar support), and the expected parameter types.指向 Foundry 服务的 Slate 数据源应配置为ServiceApi类型,因为它们提供了一个简单的编辑器布局,可显示可用的支持端点、端点参数输入(具有 Handlebar 支持)和预期的参数类型。
Please contact your Palantir rep and ask for the Compass service to be configured as a ServiceApi with the search
Compass endpoint enabled.请联系您的 Palantir 代表,并要求将 Compass 服务配置为启用
search
Compass 端点的ServiceApi 。 Doing so will allow you to query any supported Compass endpoint without needing to worry about correctly formatting the HttpJson structure, or guessing which endpoint parameters are required.这样做将允许您查询任何受支持的 Compass 端点,而无需担心正确格式化 HttpJson 结构,或猜测需要哪些端点参数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.