我们编写了一个RESTful服务器API.无论出于何种原因,我们决定对于DELETE,我们希望返回204(无内容)状态代码,并返回空响应.我试图从jQuery调用它,传入成功处理程序并将动词设置为DELETE:
jQuery.ajax({
type:'DELETE',
url: url,
success: callback,
});
Run Code Online (Sandbox Code Playgroud)
服务器返回204,但永远不会调用成功处理程序.有没有办法配置jQuery以允许204s触发成功处理程序?
我试图在嵌套的过滤器聚合中使用嵌套查询过滤器.当我这样做时,聚合返回没有项目.如果我将查询更改为一个普通的旧match_all过滤器,我确实会在桶中获取项目.
这是我正在使用的映射的简化版本:
"player": {
"properties": {
"rating": {
"type": "float"
},
"playerYears": {
"type": "nested",
"properties": {
"schoolsOfInterest": {
"type": "nested",
"properties": {
"name": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
此查询在聚合上使用match_all过滤器:
GET /players/_search
{
"size": 0,
"aggs": {
"rating": {
"nested": {
"path": "playerYears"
},
"aggs": {
"rating-filtered": {
"filter": {
"match_all": {}
},
"aggs": {
"rating": {
"histogram": {
"field": "playerYears.rating",
"interval": 1
}
}
}
}
}
}
},
"query": {
"filtered": …Run Code Online (Sandbox Code Playgroud) 当使用 redux-connect(@asynConnect 属性)时,如何链接第二个 saga,这取决于第一个 saga 的成功完成?
只是简单地putting在第一个 saga 中适当位置的 saga 调度操作在客户端上工作,而不是在服务器上。